All reports
High

Crawl4AI: Arbitrary file write (symlink/TOCTOU) plus log and webhook-header injection in Docker server

Affected versions

Version ranges need review.

Affected versions
<= 0.8.7
Fixed version
0.8.8
Affected versions
<0.8.8 || =0.3.0 || =0.3.1 || =0.3.2 || =0.3.3 || =0.3.4 || =0.3.5 || =0.3.6 || =0.3.7 || =0.3.71 || =0.3.72 || =0.3.73 || =0.3.731 || =0.3.74 || =0.3.741 || =0.3.742 || =0.3.743 || =0.3.744 || =0.3.745 || =0.3.746 || =0.3.8 || =0.4.0 || =0.4.1 || =0.4.21 || =0.4.22 || =0.4.23 || =0.4.24 || =0.4.241 || =0.4.242 || =0.4.243 || =0.4.244 || =0.4.245 || =0.4.246 || =0.4.247 || =0.4.248 || =0.4.248b3 || =0.4.3b1 || =0.4.3b2 || =0.4.3b3 || =0.5.0 || =0.5.0.post1 || =0.5.0.post2 || =0.5.0.post3 || =0.5.0.post4 || =0.5.0.post5 || =0.5.0.post6 || =0.5.0.post7 || =0.5.0.post8 || =0.6.0 || =0.6.0rc1 || =0.6.1 || =0.6.2 || =0.6.3 || =0.7.0 || =0.7.1 || =0.7.2 || =0.7.3 || =0.7.4 || =0.7.5 || =0.7.6 || =0.7.7 || =0.7.8 || =0.8.0 || =0.8.5 || =0.8.6 || =0.8.7
Fixed version
0.8.8

Exploitation

CVE-2026-56258

Probability of exploitation in the next 30 days: 0.91%

FIRST EPSS · 2026-11-23

Description

Summary

Three backward-compatible hardening fixes in the Docker API server. The headline issue is an arbitrary file write via the screenshot/PDF output_path.

1. Arbitrary file write via output_path symlink / TOCTOU (primary)

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.

Fix: 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.

2. CRLF log injection (CWE-117)

User-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.

3. Webhook request-header injection (CWE-93/CWE-113)

User-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.

Impact

Arbitrary file write (potential code execution) for #1; log forging for #2; request smuggling / header injection on outbound webhooks for #3.

Workarounds
  • Upgrade to the patched version.

  • Enable authentication (CRAWL4AI_API_TOKEN).

  • Run the container with a read-only root filesystem.

Credits

Internal security audit (Crawl4AI maintainers).

Links