NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · Langflow

CVE-2025-34291: Langflow CORS misconfiguration enables Account Takeover and RCE

criticalCVSS 4.0 9.4 · 3.1 8.8ExploitedGHSA-577h-p2hh-v4mv

Langflow 1.6.9 and earlier lets a malicious web page steal a logged-in user's tokens and then run code on the Langflow server. CISA lists CVE-2025-34291 as exploited in the wild. It chains a wildcard CORS policy with a `SameSite=None` refresh cookie. The package data lists langflow 1.7.0 as the patched version.

Published Dec 6, 2025 · Updated May 29, 2026 · Analysis Oct 26, 2026

What an attacker can do

Three weaknesses chain together. First, the default CORS middleware allows any origin with credentials, so a page on another site can send credentialed requests and read the replies (CWE-346). Second, the refresh_token_lf cookie is SameSite=None; Secure and lives up to a week. /api/v1/refresh accepts that cookie as its only authentication, so the browser attaches it to cross-site calls. The access-token cookie is SameSite=Lax, which is why the attacker goes through the refresh path. Third, /api/v1/validate/code runs function definitions, including default arguments and decorators, during validation. A valid token satisfies the authentication on that endpoint.

The victim only has to open the attacker's page while logged in to Langflow. The page calls the refresh endpoint, receives fresh access_token and refresh_token values, and then calls the code validation endpoint to execute code on the server. Because the request comes from the victim's browser, instances that are not reachable from the internet are also exposed.

The attacker gets code execution as the Langflow process. Langflow's global variables hold credentials such as API keys, database passwords and service tokens, so a compromise can reach everything the flows touch.

Who is affected

The langflow package on PyPI, version 1.6.9 and earlier. Version 1.6.0 added environment variables to customize CORS, but the defaults stayed vulnerable. Check:

pip show langflow

Then check how CORS and the refresh cookie are configured. A default install is affected. If you run the Docker image, read the version from the image tag.

langflow

Ecosystem
PyPI
Affected
<= 1.6.9
Fixed in
1.7.0
Check
pip show langflow

How to fix it

Upgrade to langflow 1.7.0:

pip install --upgrade 'langflow>=1.7.0'

CISA's required action for this KEV entry: apply mitigations per vendor instructions, follow BOD 22-01 guidance for cloud services, or discontinue use of the product if mitigations are unavailable. The due date was 2026-06-04, and it binds US federal agencies.

Mitigations from the Obsidian write-up while you upgrade:

  • Restrict credentialed CORS to an explicit list of origins, not a wildcard.
  • If the frontend and backend share a site, set REFRESH_SAME_SITE to Lax or Strict.
  • Rotate every credential stored as a Langflow global variable, since they may have been exposed.

CISA required action: Apply mitigations per vendor instructions, follow applicable BOD 22-01 guidance for cloud services, or discontinue use of the product if mitigations are unavailable.

How to tell if you were hit

Look in web server and proxy logs for requests to /api/v1/refresh and /api/v1/validate/code with an Origin header that is not your own frontend. Look for validate/code calls from sessions that never used it before. Check the Langflow host for unexpected processes, files or outbound connections from the Langflow user. Check your cloud audit logs for use of the API keys stored in global variables from unfamiliar addresses. Assume exposure of those secrets if you find a hit.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Langflow versions up to and including 1.6.9 contain a chained vulnerability that enables account takeover and remote code execution. An overly permissive CORS configuration (allow_origins='*' with allow_credentials=True) combined with a refresh token cookie configured as SameSite=None allows a malicious webpage to perform cross-origin requests that include credentials and successfully call the refresh endpoint. An attacker-controlled origin can therefore obtain fresh access_token / refresh_token pairs for a victim session. Obtained tokens permit access to authenticated endpoints — including built-in code-execution functionality — allowing the attacker to execute arbitrary code and achieve full system compromise.

Credited to augustocesarperin.

Questions

Is CVE-2025-34291 exploited in the wild?

Yes. CISA added it to the Known Exploited Vulnerabilities catalog on 2026-05-21, with a due date of 2026-06-04. No ransomware use is recorded.

Is an internal Langflow instance affected?

Yes. The attack runs in the victim's own browser, so an instance that is not exposed to the internet can still be reached when its user visits a malicious page.

Which version fixes it?

langflow 1.7.0 per the package data. Version 1.6.9 was still exploitable with default settings.

What should I rotate?

Every credential stored as a Langflow global variable, plus any session tokens. Code execution on the server lets an attacker read and decrypt them.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More Langflow vulnerabilities

All Langflow entries