Langflow Langflow — CVE-2025-34291
Langflow contains an origin validation error vulnerability in which an overly permissive CORS configuration 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. This could allow the attacker to execute arbitrary code and achieve full system compromise via obtained tokens that permit access to authenticated endpoints.
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.
Due Date: 2026-06-04
Langflow contains a critical CORS misconfiguration vulnerability (CVE-2025-34291, CVSS 9.8) that allows attackers to bypass origin validation through overly permissive CORS settings combined with SameSite=None refresh token cookies. An attacker can craft a malicious webpage to perform cross-origin requests with credentials, obtain valid authentication tokens, and gain unauthorized access to authenticated endpoints, potentially leading to arbitrary code execution and complete system compromise. This vulnerability poses an immediate threat to organizations using Langflow for workflow automation and data processing.
IMMEDIATE ACTIONS:
1. Identify all instances of Langflow deployed in your environment (on-premises, cloud, containerized)
2. Disable or restrict external access to Langflow instances immediately
3. Review CORS configuration and verify SameSite cookie settings
4. Audit authentication logs for suspicious cross-origin requests and token refresh activities
5. Revoke all active refresh tokens and force re-authentication
COMPENSATING CONTROLS (until patch available):
1. Implement Web Application Firewall (WAF) rules to block suspicious cross-origin requests to refresh endpoints
2. Configure CORS to explicitly whitelist only trusted origins (remove wildcard '*' configurations)
3. Set SameSite=Strict on all authentication cookies
4. Implement network segmentation to restrict Langflow access to internal networks only
5. Deploy reverse proxy with strict origin validation in front of Langflow
6. Enable multi-factor authentication (MFA) for all Langflow user accounts
7. Implement continuous monitoring of token refresh patterns
DETECTION RULES:
1. Alert on OPTIONS requests to /refresh or /token endpoints from external origins
2. Monitor for multiple token refresh requests from different IP addresses within short timeframes
3. Flag requests with Origin header not matching Referer header
4. Alert on refresh token usage from unexpected geographic locations
5. Monitor for unusual API endpoint access patterns following token refresh
PATCHING STRATEGY:
1. Monitor Langflow GitHub repository and vendor security advisories for patch release
2. Establish testing environment to validate patch before production deployment
3. Plan maintenance window for immediate patching upon availability
4. Consider migration to alternative workflow automation platforms if patch timeline exceeds organizational risk tolerance
الإجراءات الفورية:
1. تحديد جميع حالات Langflow المنتشرة في بيئتك (في الموقع، السحابة، الحاويات)
2. تعطيل أو تقييد الوصول الخارجي إلى مثيلات Langflow فوراً
3. مراجعة تكوين CORS والتحقق من إعدادات ملفات تعريف الارتباط SameSite
4. تدقيق سجلات المصادقة للبحث عن طلبات مريبة عبر الأصول وأنشطة تحديث الرموز
5. إلغاء جميع رموز التحديث النشطة وفرض إعادة المصادقة
الضوابط التعويضية (حتى توفر التصحيح):
1. تنفيذ قواعد جدار حماية تطبيقات الويب (WAF) لحظر طلبات مريبة عبر الأصول إلى نقاط نهاية التحديث
2. تكوين CORS لتحديد قائمة بيضاء صريحة للأصول الموثوقة فقط (إزالة تكوينات البدل '*')
3. تعيين SameSite=Strict على جميع ملفات تعريف الارتباط للمصادقة
4. تنفيذ تقسيم الشبكة لتقييد وصول Langflow إلى الشبكات الداخلية فقط
5. نشر خادم وكيل عكسي مع التحقق الصارم من الأصل أمام Langflow
6. تفعيل المصادقة متعددة العوامل (MFA) لجميع حسابات مستخدمي Langflow
7. تنفيذ المراقبة المستمرة لأنماط تحديث الرموز
قواعد الكشف:
1. تنبيه على طلبات OPTIONS إلى نقاط نهاية /refresh أو /token من أصول خارجية
2. مراقبة طلبات تحديث الرموز المتعددة من عناوين IP مختلفة في فترات زمنية قصيرة
3. وضع علم على الطلبات التي لا يتطابق فيها رأس Origin مع رأس Referer
4. تنبيه على استخدام رموز التحديث من مواقع جغرافية غير متوقعة
5. مراقبة أنماط الوصول إلى نقاط النهاية غير العادية بعد تحديث الرموز
استراتيجية التصحيح:
1. مراقبة مستودع Langflow GitHub والتنبيهات الأمنية من البائع لإصدار التصحيح
2. إنشاء بيئة اختبار للتحقق من صحة التصحيح قبل نشره في الإنتاج
3. التخطيط لنافذة صيانة للتصحيح الفوري عند توفره
4. النظر في الهجرة إلى منصات أتمتة سير عمل بديلة إذا تجاوز الجدول الزمني للتصحيح تحمل المخاطر التنظيمية