Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2024-52872

CVE-2024-52872: Flagsmith Auth Bypass Vulnerability

CVE-2024-52872 is an authentication bypass vulnerability in Flagsmith affecting versions before 2.134.1. The get_document endpoint lacks proper permission protection, allowing unauthorized access. This article covers technical details, affected versions, impact assessment, and mitigation strategies.

Published:

CVE-2024-52872 Overview

CVE-2024-52872 is a broken access control vulnerability affecting Flagsmith, an open-source feature flag and remote configuration service. Versions prior to 2.134.1 ship a get_document endpoint that is not correctly protected by permission checks. Unauthenticated or under-privileged network attackers can query the endpoint and retrieve document data they should not be authorized to access. The flaw enables confidentiality loss without requiring user interaction or elevated privileges. Flagsmith addressed the issue in release 2.134.1 via pull request #4459.

Critical Impact

Remote attackers can access protected document data exposed by the get_document endpoint without proper authorization, leading to disclosure of sensitive feature flag and configuration information.

Affected Products

  • Flagsmith versions prior to 2.134.1
  • Self-hosted Flagsmith deployments running affected releases
  • Container and source-based installations built from vulnerable commits

Discovery Timeline

  • 2024-11-17 - CVE-2024-52872 published to NVD
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2024-52872

Vulnerability Analysis

Flagsmith exposes a get_document endpoint intended to return structured configuration documents to authorized callers. In releases before 2.134.1, the endpoint does not apply the permission classes used by sibling routes. Requests that should be rejected by the authorization layer are processed and return document content to the caller. The fix in version 2.134.1 introduces the missing permission enforcement on the endpoint. The patch is visible in the v2.134.0...v2.134.1 diff.

Root Cause

The root cause is missing authorization enforcement [CWE-862-class issue] on a Django REST Framework view. The get_document handler lacked the project- and organisation-scoped permission checks required to validate the requester against the document being retrieved. Authentication state alone determined response behavior, bypassing object-level access control.

Attack Vector

An attacker reaches the vulnerable endpoint over the network by issuing a crafted HTTP request to a Flagsmith instance. No user interaction is required and attack complexity is low. Because the impact is confined to confidentiality, the attacker reads document data such as environment configuration, feature flag definitions, and project metadata. Integrity and availability of the service are not directly affected by this flaw.

No verified public proof-of-concept code is available. Refer to the Flagsmith pull request #4459 for the authoritative description of the vulnerable code path and the corresponding fix.

Detection Methods for CVE-2024-52872

Indicators of Compromise

  • Unauthenticated or low-privilege HTTP requests targeting the get_document route in Flagsmith access logs.
  • Anomalous spikes in 2xx responses from get_document originating from unexpected source IPs or user agents.
  • Document retrievals from accounts that have no legitimate project membership for the requested resource.

Detection Strategies

  • Audit Flagsmith application and reverse-proxy logs for requests to get_document and correlate them against the requester's project permissions.
  • Compare deployed Flagsmith version strings against 2.134.1 across container images, Helm charts, and source builds.
  • Add SIEM rules that flag access to get_document from API tokens with no associated project scope.

Monitoring Recommendations

  • Forward Flagsmith API gateway logs to a centralized log platform and retain them long enough to support retrospective investigation.
  • Alert on bursts of get_document requests from a single IP or token within short time windows.
  • Track Flagsmith release versions in your software inventory and trigger alerts when a host runs a release below 2.134.1.

How to Mitigate CVE-2024-52872

Immediate Actions Required

  • Upgrade all Flagsmith deployments to version 2.134.1 or later without delay.
  • Rotate any API keys, environment keys, and secrets that may have been exposed through get_document responses.
  • Review historical access logs for unauthorized get_document calls and assess what document data was returned.

Patch Information

Flagsmith released the fix in version 2.134.1. The change adds the missing permission enforcement to the get_document endpoint. Review the version comparison and merge details in pull request #4459 before deploying. Rebuild container images and redeploy Helm charts to ensure the patched binary is in service.

Workarounds

  • Restrict network exposure of the Flagsmith API to trusted clients using firewall, VPN, or service mesh policies until the upgrade is applied.
  • Place a reverse proxy or WAF rule in front of Flagsmith to deny access to the get_document route from unauthenticated sources.
  • Disable or quarantine self-hosted Flagsmith instances that cannot be patched quickly and that expose the API to untrusted networks.
bash
# Configuration example: deny unauthenticated access to get_document at the proxy layer
# NGINX snippet — adjust auth_request endpoint to your environment
location ~* /api/v[0-9]+/.*get[-_]document {
    auth_request /internal/validate-token;
    proxy_pass http://flagsmith_upstream;
}

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.