Skip to content
← Blog · · df00tech

CVE-2026-59988: Unsafe Docutils Defaults in django-docutils Enable LFI, SSRF and Stored XSS

vuln-intel pip CVE-2026-59988 #checker-reject

What's Happening

django-docutils versions prior to 0.30.0 render reStructuredText (reST) input using Docutils' default settings, which do not disable the directives that Docutils ships with for file inclusion and raw markup injection. Because these unsafe defaults are left active, an attacker who can submit reST content to a Django application using this library can trigger several distinct impacts through directive abuse:

  • Local file disclosure (CWE-22, CWE-200) via the .. include:: directive, which reads arbitrary local files into the rendered output.
  • Server-side request forgery (CWE-918) via directives that resolve or fetch remote URLs, causing the Django application process to issue outbound requests to attacker-chosen destinations.
  • Stored cross-site scripting (CWE-79) via .. raw:: html, which passes raw HTML straight into rendered output without sanitization, persisting the payload wherever the rendered reST is stored and later displayed.

The common root cause is that Docutils' directive safety settings — which must be explicitly configured to restrict file access and raw markup — were never locked down by django-docutils, leaving reST rendering as an unauthenticated-by-default content injection surface.

Affected Software

This affects django-docutils (PyPI/pip package) in all versions prior to 0.30.0. No patched version is currently listed. CVSS score: 8.2.

Exploitation Status

A public proof-of-concept exists for this vulnerability. While it has not been confirmed as actively exploited in the wild (not KEV-listed) or observed as fully weaponized, the availability of a public PoC substantially lowers the bar for exploitation. Defenders running django-docutils below 0.30.0 anywhere reST input reaches end users — comments, wikis, documentation portals, CMS fields — should treat this as an immediate priority for patching or mitigation, not a theoretical risk.

How Our Detection Catches It

We ship coverage for this vulnerability across Microsoft Sentinel (KQL), Splunk (SPL), Elastic (EQL), QRadar (AQL), Sumo Logic, Chronicle (YARA-L), and CrowdStrike (CQL). Detection logic focuses on three correlated signal types rather than a single indicator:

  • Payload inspection: HTTP request bodies and parameters reaching Django endpoints are inspected for reST directive patterns associated with file inclusion (.. include::) and raw markup injection (.. raw::), since these are the directives that unsafe Docutils defaults leave exploitable.
  • Process-level network behavior: unexpected outbound requests originating from the Django application process are flagged, surfacing the SSRF path where the renderer itself becomes the requesting party.
  • Sensitive file access: application reads of sensitive local files (e.g. /etc/passwd, Django settings files, secrets) occurring in close proximity to reST rendering activity are correlated as a strong indicator of successful LFI.

Combining the inbound payload pattern with the outbound/file-read behavior lets the detection distinguish genuine exploitation attempts from benign reST usage, reducing false positives while still catching all three impact paths (LFI, SSRF, stored XSS) stemming from the same root cause.

Remediation and Further Detail

Upgrade django-docutils to a version that enforces safe Docutils settings as soon as one is available, and in the interim explicitly disable the include and raw directives and restrict URL-fetching directives in your Docutils configuration. For the full detection logic, sample events, and per-SIEM queries, see the CVE-2026-59988 detection page.

Get new detections in your inbox

New ATT&CK coverage plus CISA KEV / CVE detection rules, roughly weekly. No spam, unsubscribe anytime.