CVE-2026-59988: django-docutils Unsafe Docutils Defaults (LFI / SSRF / Stored XSS)
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.
Vulnerability Intelligence
Public PoCAffected Software
- Vendor
- pip
- Product
- django-docutils
- Versions
- < 0.30.0
Timeline
- Disclosed
- November 20, 2026
References & Proof of Concept
- 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
What is CVE-2026-59988 CVE-2026-59988: django-docutils Unsafe Docutils Defaults (LFI / SSRF / Stored XSS)?
CVE-2026-59988: django-docutils Unsafe Docutils Defaults (LFI / SSRF / Stored XSS) (CVE-2026-59988) maps to the Initial Access and Collection and Exfiltration tactics — the adversary is trying to get into your network in MITRE ATT&CK.
This page provides production-ready detection logic for CVE-2026-59988: django-docutils Unsafe Docutils Defaults (LFI / SSRF / Stored XSS), covering the data sources and telemetry it touches: Azure Application Insights, Django application request logs, Web application firewall logs. The queries below are rated high severity at medium confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.
MITRE ATT&CK
- Tactic
- Initial Access Collection Exfiltration
// df00tech DF00-38311fe1bb · https://df00tech.com/detections/CVE-2026-59988 · licence: https://df00tech.com/detections/licence
let reSTPatterns = dynamic([".. include::", ".. raw::", ".. raw:: html", ".. csv-table::", ".. figure::", ".. image::", ":file:", "include::"]);
let sensitiveFiles = dynamic(["/etc/passwd", "/etc/shadow", "settings.py", ".env", "id_rsa", "secret_key", "/proc/self/environ"]);
AppRequests
| where TimeGenerated > ago(24h)
| extend body = tostring(Properties.requestBody), uri = tostring(Url)
| where body has_any (reSTPatterns) or uri has_any (reSTPatterns)
| where body has_any (sensitiveFiles) or body has "file://" or body has "http://" or body has "https://"
| project TimeGenerated, ClientIP = tostring(Properties.clientIp), uri, body, OperationName
| order by TimeGenerated desc Flags inbound HTTP requests to a Django app carrying reStructuredText directive markers combined with sensitive-file or URL references, indicating attempts at local file disclosure, SSRF, or stored XSS via django-docutils.
Data Sources
Required Tables
False Positives
- Documentation platforms that legitimately accept reStructuredText input from trusted authors
- Internal CI or content-migration jobs posting reST documents containing include directives
- Security scanners and QA pipelines submitting reST payloads during testing
Query fingerprint DF00-38311fe1bb · licence
Sigma logsource & community rules
The detection logic for CVE-2026-59988: django-docutils Unsafe Docutils Defaults (LFI / SSRF / Stored XSS) (CVE-2026-59988) above is provided in a vendor-neutral
form so you can deploy it on any SIEM. The same logic is shipped here as native
KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the
following logsource:
logsource:
category: network_connection
product: windows Browse the community-maintained Sigma rules for this technique:
Platform-specific guides for CVE-2026-59988
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
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
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
Related Detections
Related Techniques
Same Tactic: Initial Access
Blog posts about this detection
Browse by tactic
- Reconnaissance TA0043
- Resource Development TA0042
- Initial Access TA0001
- Execution TA0002
- Persistence TA0003
- Privilege Escalation TA0004
- Stealth TA0005
- Defense Impairment TA0112
- Credential Access TA0006
- Discovery TA0007
- Lateral Movement TA0008
- Collection TA0009
- Command and Control TA0011
- Exfiltration TA0010
- Impact TA0040