Detect CVE-2026-59988: django-docutils Unsafe Docutils Defaults (LFI / SSRF / Stored XSS) in CrowdStrike LogScale
Detects exploitation of CVE-2026-59988 in django-docutils < 0.30.0, where unsafe Docutils default settings allow reStructuredText (reST) input to trigger local file disclosure via directives such as `.. include::` and `.. raw::`, server-side request forgery (SSRF) via URL-referencing directives, and stored cross-site scripting (XSS) via `.. raw:: html`. Detection focuses on reST payload patterns in HTTP request bodies/parameters reaching Django endpoints, unexpected outbound requests originating from the Django application process, and application reads of sensitive local files (e.g. /etc/passwd, settings, secrets) following reST rendering.
MITRE ATT&CK
- Tactic
- Initial Access Collection Exfiltration
LogScale Detection Query
// df00tech DF00-38311fe1bb · https://df00tech.com/detections/CVE-2026-59988 · licence: https://df00tech.com/detections/licence
#event_simpleName=HttpRequest
| (RequestBody=/(?i)\.\.\s+(include|raw|csv-table)::/ OR RequestUrl=/(?i)\.\.\s+include::/)
| RequestBody=/(?i)(\/etc\/passwd|settings\.py|\.env|id_rsa|file:\/\/|https?:\/\/)/
| groupBy([RemoteAddress, RequestUrl], function=count()) CrowdStrike CQL query flagging HTTP requests that pair reST directives with sensitive file or URL references, indicating django-docutils exploitation.
Data Sources
Required Tables
False Positives & Tuning
- Trusted authors submitting reST documents
- Automated content import pipelines
- Authorized penetration testing
Other platforms for CVE-2026-59988
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are further down this page.
- Test 1 reST include directive local file disclosure attempt
Expected signal: Web/app request log entry with body containing '.. include:: /etc/passwd'
- Test 2 reST SSRF via URL-referencing directive
Expected signal: Inbound request log with reST image directive and http:// URL; outbound connection from app to 169.254.169.254
- Test 3 reST stored XSS via raw html directive
Expected signal: Request log with '.. raw:: html' and <script> content
References (7)
- https://github.com/tony/django-docutils/security/advisories/GHSA-86mf-q4h5-69gp
- https://nvd.nist.gov/vuln/detail/CVE-2026-59988
- https://github.com/tony/django-docutils/pull/457
- https://github.com/tony/django-docutils/commit/274caaf14c2368fafeb45f178094a34ba538f067
- https://github.com/tony/django-docutils/commit/57fd751a10ce2969e4ca2bde6a9094fa2e2ba0dd
- https://github.com/tony/django-docutils/blob/v0.30.0/CHANGES
- https://github.com/advisories/GHSA-86mf-q4h5-69gp
Response Playbook
Triage
- Confirm the deployed django-docutils version; versions < 0.30.0 are vulnerable. Check `pip show django-docutils` on the app host.
- Extract the full reST payload from the flagged request and identify which directive was used (`.. include::`, `.. raw:: html`, or a URL-referencing directive) to determine whether the attempt targeted LFI, SSRF, or stored XSS.
- Correlate the source IP and authenticated user/session with the request to determine whether the submitter is a trusted author or an untrusted actor.
- Check application responses/logs to determine whether the directive rendered successfully (e.g. file contents returned in the HTTP response or stored for later display).
Containment
- Deploy a WAF rule to block request bodies/parameters containing `.. include::`, `.. raw::`, and `file://` schemes against the affected endpoints until patched.
- Upgrade django-docutils to >= 0.30.0, which ships hardened Docutils defaults, and restart the application.
- If stored XSS content may have been persisted, quarantine affected records and purge rendered HTML caches.
Evidence Collection
- Preserve the raw HTTP request (headers + body) and the corresponding application response for the flagged events.
- Capture application and web server access logs covering the suspected exploitation window, plus any stored reST documents created by the source principal.
Escalation Criteria
- !Escalate to IR if an HTTP response or log confirms that a sensitive local file (e.g. /etc/passwd, settings.py, .env) was disclosed.
- !Escalate if outbound requests to attacker-controlled or internal metadata endpoints (e.g. 169.254.169.254) originated from the Django application process, indicating successful SSRF.
Investigation Guide
Forensic Artifacts
- >
Web/app access logs containing reST directive payloads - >
Stored reST documents and rendered HTML in the application database - >
Outbound connection records from the Django app process (netstat/conntrack, proxy logs) - >
django-docutils and Docutils package versions in the deployed virtualenv
Tuning Guidance
If the application legitimately accepts reStructuredText from trusted, authenticated authors, scope the detection to unauthenticated or low-privilege sessions and exclude known content-management service accounts. Raise severity when the directive co-occurs with sensitive file paths or internal/metadata URLs, and lower confidence for endpoints that only render reST from vetted internal sources.
Hunting Queries
Surfaces all requests containing reST include/raw directives for retrospective hunting across the exposure window.
// df00tech DF00-38311fe1bb · https://df00tech.com/detections/CVE-2026-59988 · licence: https://df00tech.com/detections/licence
AppRequests | where Properties.requestBody has ".. include::" or Properties.requestBody has ".. raw::" | project TimeGenerated, Url, tostring(Properties.requestBody), tostring(Properties.clientIp) ``` df00tech DF00-38311fe1bb · https://df00tech.com/detections/CVE-2026-59988 · licence: https://df00tech.com/detections/licence ```
index=web (request_body="*.. include::*" OR request_body="*.. raw::*") | table _time src_ip uri_path request_body Atomic Red Team Tests
Submit a reST payload using the include directive to read /etc/passwd via a vulnerable django-docutils rendering endpoint.
Command
curl -s -X POST http://localhost:8000/render/ --data-urlencode 'content=.. include:: /etc/passwd' Cleanup
echo 'No persistent artifacts; clear any test render cache if present' Expected Telemetry
Web/app request log entry with body containing '.. include:: /etc/passwd'
Expected Detection
KQL/SPL rules match reST directive + /etc/passwd sensitive-file pattern
Submit a reST payload referencing an internal URL to trigger server-side request forgery.
Command
curl -s -X POST http://localhost:8000/render/ --data-urlencode 'content=.. image:: http://169.254.169.254/latest/meta-data/' Cleanup
echo 'No persistent artifacts to remove' Expected Telemetry
Inbound request log with reST image directive and http:// URL; outbound connection from app to 169.254.169.254
Expected Detection
Detection matches reST directive + URL scheme pattern
Submit a reST payload using the raw html directive to inject a script, testing stored XSS.
Command
curl -s -X POST http://localhost:8000/render/ --data-urlencode 'content=.. raw:: html\n\n <script>alert(1)</script>' Cleanup
echo 'Delete any stored test document created during the test' Expected Telemetry
Request log with '.. raw:: html' and <script> content
Expected Detection
Detection matches '.. raw::' directive pattern in request body