Detection rules › Elastic
Potential Remote Code Execution via Langflow
Langflow is a tool that allows users to create and manage workflows for language models. This rule detects potential remote code execution attempts through the Langflow application, as a result of a vulnerability (CVE-2025-3248). 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.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Command & Control |
Rule body
[rule]
description = """
Langflow is a tool that allows users to create and manage workflows for language models. This rule detects potential
remote code execution attempts through the Langflow application, as a result of a vulnerability (CVE-2025-3248).
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.
"""
id = "71b8f843-3c57-43d6-aed2-efb769b32215"
license = "Elastic License v2"
name = "Potential Remote Code Execution via Langflow"
os_list = ["linux"]
reference = ["https://nvd.nist.gov/vuln/detail/CVE-2025-3248", "https://github.com/verylazytech/CVE-2025-3248"]
version = "1.0.4"
query = '''
process where event.type == "start" and event.action == "exec" and process.parent.name == "langflow" and
process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish") and process.args == "-c"
'''
min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"
[[threat.technique]]
id = "T1203"
name = "Exploitation for Client Execution"
reference = "https://attack.mitre.org/techniques/T1203/"
[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1071"
name = "Application Layer Protocol"
reference = "https://attack.mitre.org/techniques/T1071/"
[threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[internal]
min_endpoint_version = "7.15.0"
Stages and Predicates
Stage 1: process
process where event.type == "start" and event.action == "exec" and process.parent.name == "langflow" and
process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish") and process.args == "-c"
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"exec" |
event.type | eq |
| field:"event.type" kind:eq value:"start" |
process.args | eq |
| field:"process.args" kind:eq value:"-c" |
process.name | in |
| field:"process_name" kind:in |
process.parent.name | eq |
| field:"parent_process_name" kind:eq value:"langflow" |