GHSA-7cx2-g3h9-382p: Crawl4AI Arbitrary File Write (symlink/TOCTOU) Plus Vulnerability
HIGHGHSA-7cx2-g3h9-382p is a HIGH (CVSS 8.1) arbitrary file write (symlink/toctou) plus vulnerability (CWE-59: Improper Link Resolution Before File Access ('Link Following')) affecting Crawl4AI libraries in the PyPI ecosystem. The issue involves arbitrary file write (symlink/toctou) plus log and webhook-header injection in docker server. Remediation is available by upgrading affected packages to version 0.8.8.
GHSA-7cx2-g3h9-382p at a Glance
Security Impact
CVSS: 8.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H).
How to Fix GHSA-7cx2-g3h9-382p
To remediate this vulnerability, upgrade all affected Crawl4AI dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install crawl4ai>=0.8.8
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show crawl4ai
How to Check if You Are Affected
To determine whether your Python environment is affected by GHSA-7cx2-g3h9-382p, inspect your installed packages using pip:
pip show crawl4ai
Analyze the terminal output to locate any version of Crawl4AI in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.8.8), your application is affected.
Note: The pip show crawl4ai command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-59: Improper Link Resolution Before File Access ('Link Following'), where the product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. In Crawl4AI, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-7cx2-g3h9-382p Affected Crawl4AI Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
crawl4ai
|
PyPI |
< 0.8.8
|
0.8.8
|
References
Frequently Asked Questions
What is GHSA-7cx2-g3h9-382p?
Which Crawl4AI versions are affected?
What version fixes GHSA-7cx2-g3h9-382p?
Is crawl4ai affected?
What is the CVSS score of GHSA-7cx2-g3h9-382p?
What CWE is associated with GHSA-7cx2-g3h9-382p?
How can I check PyPI dependencies for GHSA-7cx2-g3h9-382p?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-7cx2-g3h9-382p",
"modified" : "2026-07-21T15:02:21Z",
"published" : "2026-06-16T21:02:19Z",
"aliases" : [ ],
"summary" : "Crawl4AI: Arbitrary file write (symlink/TOCTOU) plus log and webhook-header injection in Docker server",
"details" : "### Summary\n\nThree backward-compatible hardening fixes in the Docker API server. The headline issue is an arbitrary file write via the screenshot/PDF `output_path`.\n\n### 1. Arbitrary file write via output_path symlink / TOCTOU (primary)\n\n`POST /screenshot` and `POST /pdf` accept an `output_path` constrained to `ALLOWED_OUTPUT_DIR` by `validate_output_path`. The 0.8.7 check was string-only: it did not resolve symlinks, so a symlinked path component inside the output directory could redirect the write outside the directory, and the final `open()` followed symlinks. On a deployment where the runtime user can write executable/cron locations this is an arbitrary-write to code-execution primitive. The API is unauthenticated by default.\n\nFix: `validate_output_path` now resolves the real path (symlinks) of the parent and re-checks containment, and the write uses `O_NOFOLLOW` (`write_output_file`). `output_path` remains supported.\n\n### 2. CRLF log injection (CWE-117)\n\nUser-controlled URLs/errors reflected into log lines could embed CR/LF and forge additional log entries. Fix: a logging filter strips CR/LF/control characters from all records.\n\n### 3. Webhook request-header injection (CWE-93/CWE-113)\n\nUser-supplied webhook headers were sent verbatim, allowing CRLF and hop-by-hop / sensitive header injection on the outbound webhook request. Fix: webhook headers are validated (name pattern, no control characters, deny `Host`/`Content-Length`/`Transfer-Encoding`/`Authorization`/`Cookie`/...), with early request-time rejection.\n\n### Impact\n\nArbitrary file write (potential code execution) for #1; log forging for #2; request smuggling / header injection on outbound webhooks for #3.\n\n### Workarounds\n\n- Upgrade to the patched version.\n- Enable authentication (`CRAWL4AI_API_TOKEN`).\n- Run the container with a read-only root filesystem.\n\n### Credits\n\nInternal security audit (Crawl4AI maintainers).",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "crawl4ai"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.8.8"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.8.7"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/unclecode/crawl4ai/security/advisories/GHSA-7cx2-g3h9-382p"
}, {
"type" : "WEB",
"url" : "https://github.com/unclecode/crawl4ai/issues/1"
}, {
"type" : "WEB",
"url" : "https://github.com/unclecode/crawl4ai/issues/2"
}, {
"type" : "WEB",
"url" : "https://github.com/unclecode/crawl4ai/pull/3"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/crawl4ai/PYSEC-2026-228.yaml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/unclecode/crawl4ai"
}, {
"type" : "WEB",
"url" : "https://www.vulncheck.com/advisories/crawl4ai-arbitrary-file-write-via-output-path-symlink-and-toctou"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-117", "CWE-22", "CWE-59", "CWE-93" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-06-16T21:02:19Z",
"nvd_published_at" : null
}
}