Security researchers from Horizon3.ai have discovered a critical vulnerability in Langflow, a popular open-source tool for building AI workflows.
The vulnerability, identified as CVE-2025-3248, allows unauthenticated attackers to execute arbitrary code remotely on affected servers.
With a maximum CVSS score of 9.8, this vulnerability presents a severe risk to the estimated 500+ Langflow instances currently exposed on the internet.
Langflow, which has garnered over 50,000 GitHub stars and is backed by major tech companies like DataStax and IBM, provides a visual interface for building AI-driven agents and workflows.
The tool has become increasingly popular in the growing “agentic AI” ecosystem.
Understanding the Technical Exploitation Path
The vulnerability stems from an unauthenticated API endpoint /api/v1/validate/code
that runs Python’s exec
function on untrusted user input.
While previous vulnerabilities in Langflow required authentication, this flaw allows attackers to bypass authentication entirely.
The exploit leverages Python’s function decorators and default arguments, which are executed when a function is defined.
Researchers found that attackers can inject malicious code into decorators or default arguments, which then gets executed during validation.
For example, a simple exploit using Python decorators looks like:
curl -X POST -H 'Content-Type: application/json' http://target:8000/api/v1/validate/code -d '{"code": "@exec(\"raise Exception(__import__(\\\"subprocess\\\").check_output(\\\"env\\\"))\")\ndef foo():\n pass"}'
Alternatively, attackers can use Python’s default arguments:
curl -H 'Content-Type: application/json' http://target:8000/api/v1/validate/code -d '{"code":"def foo(cmd=exec(\"raise Exception(__import__(\\\"subprocess\\\").check_output(\\\"env\\\"))\")):\n pass"}'
These techniques allow attackers to execute arbitrary commands, access sensitive data, and potentially gain full control of the vulnerable server without requiring any authentication.

Recommendations and Remediation Steps
The vulnerability has been patched in Langflow version 1.3.0, released on March 31, 2025. All users are strongly encouraged to upgrade immediately.
For organizations that cannot update immediately, security experts recommend implementing the following mitigations:
- Restrict network access to Langflow instances, particularly to the vulnerable
/api/v1/validate/code
endpoint - Implement network segmentation to isolate Langflow deployments
- Deploy web application firewall (WAF) rules to block potential exploit attempts
- Monitor systems for suspicious code execution attempts
Security researchers also advise caution when deploying AI tools like Langflow to internet-facing environments.
“As a general practice, we recommend caution when exposing any recently developed AI tools to the Internet.
If you must expose it externally, consider putting it in an isolated VPC and/or behind SSO,” noted Horizon3.ai researcher.
This vulnerability highlights the ongoing security challenges in the rapidly evolving AI tool ecosystem.
Organizations deploying these powerful tools must remain vigilant about security updates and best practices to prevent potential breaches.
Find this Story Interesting! Follow us on LinkedIn and X to Get More Instant Updates