# CVE-2025-34291: Langflow Origin Validation Error

> Attackers can hijack user sessions via CORS misconfiguration to steal tokens and execute arbitrary code on Langflow instances.

- **Severity:** Critical 9.4 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H`)
- **Exploited in the wild:** Yes, since 21 May 2026 (CISA KEV)
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 5 Dec 2025
- **Updated:** 8 Oct 2026
- **Also known as:** GHSA-577h-p2hh-v4mv, PYSEC-2025-78, ROOT-APP-PYPI-CVE-2025-34291

## What is CVE-2025-34291?

CVE-2025-34291 is a critical vulnerability in Langflow Langflow, published on 5 Dec 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

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.

Weakness: CWE-346 (Origin Validation Error)

## Which versions are affected by CVE-2025-34291?

3 open source packages ship an affected version, including langflow. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `langflow` | PyPI | All versions | 1.7.0 |
| `langflow` | PyPI | All versions | 1.7.0 |
| `langflow` | PyPI | All versions | 1.7.0 |

Products: Langflow Langflow.

## How do I fix CVE-2025-34291?

Upgrade langflow to 1.7.0 or later. US federal agencies must fix it by 4 Jun 2026.

## Is CVE-2025-34291 being exploited?

Yes. Attackers have exploited CVE-2025-34291 in the wild since at least 21 May 2026.

Public exploit code:

- A lightweight Python-based security assessment tool for detecting dangerous Cross-Origin Resource Sharing (CORS) misconfigurations - CVE-2025-34291. (github_poc): https://github.com/amnnrth/CVE-2025-34291_cors_security_scanner
- Scanner: CVE-2025-34291 Langflow Origin Validation Error / CORS Misconfiguration — Python checker (CISA KEV) (github_poc): https://github.com/ridhinva/langflow-cors-scanner
- Langflow AI <= 1.6.9 - CORS Misconfiguration (nuclei): http/cves/2025/CVE-2025-34291.yaml

## Other vulnerabilities in Langflow Langflow

- [CVE-2026-9198](https://insights.sbomify.com/CVE-2026-9198/): IBM Langflow Code Injection (critical 9.8, exploited in the wild)
- [CVE-2026-0770](https://insights.sbomify.com/CVE-2026-0770/): Langflow Inclusion of Functionality from Untrusted Control Sphere (critical 9.8, exploited in the wild)
- [CVE-2025-3248](https://insights.sbomify.com/CVE-2025-3248/): Langflow Missing Authentication (critical 9.8, exploited in the wild)
- [CVE-2026-33017](https://insights.sbomify.com/CVE-2026-33017/): Langflow Code Injection (critical 9.3, exploited in the wild)
- [CVE-2026-55255](https://insights.sbomify.com/CVE-2026-55255/): Langflow Authorization Bypass Through User-Controlled Key (high 8.4, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-34291 and fix it if it is affected.

What it is: CVE-2025-34291 is a critical vulnerability in Langflow Langflow, published on 5 Dec 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: Yes. Attackers have exploited CVE-2025-34291 in the wild since at least 21 May 2026.

Affected packages and fixed versions:
- langflow (PyPI): affected all versions; fixed in 1.7.0
- langflow (PyPI): affected all versions; fixed in 1.7.0
- langflow (PyPI): affected all versions; fixed in 1.7.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-34291/ (Markdown: https://insights.sbomify.com/CVE-2025-34291/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-34291
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-34291
- OSV: https://osv.dev/vulnerability/CVE-2025-34291

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-34291/
Summaries are generated and may contain mistakes; the official description above is the record.
