CVE DatabaseCVE-2025-34291
한국어 권고문 →
CVE-2025-342918.8/HIGHCISA KEVCWE-346

Langflow CORS Misconfiguration and Token Hijacking leading to Remote Code Execution (CVE-2025-34291)

Affected Vendors
langflow-ai
Affected Components
langflow
Published Date
2025-12-05

Executive & SecOps Summary

SECOPS ASSESSMENT
Affected Scope

Langflow versions up to and including 1.6.9

Impact

Attackers can hijack victim sessions to take over accounts and execute arbitrary code via built-in code execution features, leading to full system compromise

Mitigation

Upgrade Langflow to the latest patched version, restrict CORS configurations, and update refresh token cookie attributes to Lax/Strict

Affected Products & Version Scope

All Langflow versions up to and including 1.6.9

Remediation & Live Workaround Commands

PATCH & WORKAROUND

1. Official Patch Application

Upgrade your Langflow package to the latest secure version.

bash
pip install --upgrade langflow

2. Temporary Mitigations (If patching cannot be applied immediately)

A. Restrict CORS Configurations

Modify the Langflow configuration or reverse proxy (e.g., Nginx, Apache) to ensure that the Access-Control-Allow-Origin header is not set to a wildcard (*) when credentials are allowed. Restrict allowed origins to trusted internal domains only.

B. Harden Cookie Attributes

Force the SameSite attribute of the refresh token cookie to Lax or Strict and ensure the Secure flag is enabled via your application configuration or reverse proxy layer.

C. WAF (Web Application Firewall) Rules

Deploy WAF rules to detect and block suspicious cross-origin requests targeting Langflow API endpoints, particularly the /api/v1/refresh and workflow execution endpoints.

Recommended Security Control & Mitigation Partner
Snyk Open Source & Container Security
This is an actively exploited high-severity vulnerability; immediately upgrade Langflow to the latest version and restrict external access.

Scan Your Repositories for Transitive Vulnerable Dependencies in 30 Seconds

Automatically detect vulnerable packages across npm, PyPI, Maven, and Go, and open automated fix Pull Requests without breaking your build.

Free Forever Tier · 1-Click GitHub/GitLab Auto-PR
Master DevSecOps: Automated SAST/SCA in GitHub Actions & Kubernetes
View Course Curriculum

Technical Root Cause & Exploitation Mechanics

CVE-2025-34291 is a chained vulnerability in the Langflow platform arising from a combination of permissive CORS (Cross-Origin Resource Sharing) and insecure cookie configurations.

  • CORS and Cookie Misconfiguration (CWE-346): Langflow was configured with an overly permissive CORS policy (allow_origins='*' combined with allow_credentials=True). Concurrently, the refresh token cookie was configured with SameSite=None.
  • Token Hijacking Mechanics: When an authenticated victim visits a malicious webpage controlled by an attacker, the page can initiate cross-origin requests to Langflow's refresh endpoint. Because of the SameSite=None attribute, the browser automatically includes the victim's credentials (refresh token cookie) in the request. The permissive CORS policy allows the malicious origin to read the response and successfully hijack the newly generated access_token and refresh_token pairs.
  • Remote Code Execution (RCE): Using the hijacked tokens, the attacker gains unauthorized access to authenticated endpoints. By leveraging Langflow's built-in code execution capabilities (such as Python code blocks within workflows), the attacker can execute arbitrary system commands, resulting in complete compromise of the host system.

This vulnerability has been actively exploited in the wild and is listed in the CISA KEV catalog with an EPSS score of 0.94, requiring immediate remediation.

Official Vendor Advisories & References

NVD Original English 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.

SecOps Advisory Dispatch & RSS Feed

Subscribe to Daily Vulnerability Briefings & KEV Alerts

Concise morning briefings for SecOps, DevSecOps, and SRE teams covering newly exploited CVEs and mitigation priorities.

Slack / Teams / RSS Feed: