
Analysis and safe PoC for CVE-2026-120218, a stored XSS in TypeMill's SVG sanitizer via xml-stylesheet XSLT processing instructions, with source checker and fix details.
English | Português do Brasil
Technical analysis, safe proof-of-concept material, and reproducible source checks for a stored cross-site scripting vulnerability in TypeMill's SVG sanitizer.
[!IMPORTANT] VulDB assigned
CVE-2026-120218on October 31, 2026. At the time this repository was prepared, the CVE Program API had not yet published the canonical record and returnedCVE_RECORD_DNE. VDB-429569 is the current public assignment source. This notice should be removed when the CVE record becomes available.
| Field | Value |
|---|---|
| Product | TypeMill CMS |
| Verified affected range | 2.6.0 through 2.26.0 |
| Tested release | v2.26.0 (050cc875a3fcb9de5abc8da08b89895bdfea7865) |
| Fixed version | 2.27.0 |
| Security fix | 9ca43c4 |
| Component | system/typemill/Models/SvgSanitizer.php |
| Weakness | CWE-79 — Improper Neutralization of Input During Web Page Generation |
| Required privilege | Authenticated contributor or another role with mycontent:create |
| Configuration | Allow svg must be enabled |
| User interaction | A privileged user opens a direct stored SVG URL |
| VulDB score | CVSS 3.1 3.5 |
| Researcher assessment | CVSS 3.1 8.7 — scope changed, high confidentiality/integrity impact |
| Researcher | Fernando Viana — Capivara Research |
TypeMill versions containing the vulnerable sanitizer checked SVG elements and attributes against allowlists, but did not inspect XML processing instructions. An authenticated contributor could upload a document containing an xml-stylesheet instruction whose XSLT generated HTML and JavaScript.
The processing instruction survived sanitization, publication, and storage. TypeMill then served the document from the application origin as image/svg+xml. When a privileged user opened the direct Live, Original, or Thumb URL in a browser with SVG XSLT support, the transformed JavaScript ran with the TypeMill origin.
The coordinated local validation crossed the contributor-to-administrator trust boundary: same-origin JavaScript used the administrator's existing session to create a harmless marker account. The public PoC is deliberately safer. It only changes text inside its own document and sets a DOM attribute; it does not access cookies, call application APIs, or send network requests.
Stored XSS is not limited to stealing a readable cookie. JavaScript executing in the application's origin can make authenticated same-origin requests, even when the session cookie is HttpOnly. The browser attaches the victim's session automatically.
In the validated chain, the attacker starts with content-level privileges while the victim has administrative privileges:
contributor uploads crafted SVG
|
v
TypeMill checks elements and attributes only
|
v
xml-stylesheet processing instruction survives
|
v
SVG is published as same-origin image/svg+xml
|
v
administrator opens a direct media URL
|
v
XSLT emits JavaScript in the TypeMill origin
|
v
script can perform actions authorized to the administrator
All of the following are required for the demonstrated chain:
mycontent:create.These conditions reduce exposure but do not make the sanitizer bypass safe. SVG upload is an official feature, the sanitizer is a security boundary, and the media interface exposes direct links to the stored resources.
The affected SvgSanitizer used DOMDocument::getElementsByTagName("*") to enumerate XML elements:
$allElements = $this->xmlDoc->getElementsByTagName("*");
for ($i = 0; $i < $allElements->length; $i++) {
$currentNode = $allElements->item($i);
// Element and attribute allowlist checks.
}
An XML processing instruction is a DOMProcessingInstruction, not a DOM element. It is absent from that list and therefore survives the allowlist pass and later saveXML() serialization:
<?xml-stylesheet type="text/xsl" href="data:text/xsl;base64,..."?>
The self-contained data URI avoids any dependency on an attacker-controlled server or a second uploaded file.
POST /api/v1/image accepts image data for accounts authorized with mycontent:create.ControllerApiImage::saveImage() preserves the SVG format when allowsvg is active.Media::checkAllowedExtension() invokes SvgSanitizer.PUT /api/v1/image publishes the generated media files.The poc/ directory contains:
check_source.py, a read-only source checker;sanitizer_repro.php, a direct harness for TypeMill's real sanitizer;payload.svg, a harmless and self-contained browser marker; andpython3 poc/check_source.py /path/to/typemill
The checker exits with:
| Code | Meaning |
|---|---|
0 | All controls introduced by the 2.27.0 fix are present |
1 | One or more controls are absent; the source matches the vulnerable pattern |
2 | Invalid path or usage error |
docker build -t cve-2026-120218 .
docker run --rm cve-2026-120218
The image pins the official v2.26.0 tag. Its wrapper treats detection of the expected vulnerable pattern as a successful container test.
In a TypeMill source tree with its PHP dependencies available:
php poc/sanitizer_repro.php \
/path/to/typemill \
poc/payload.svg \
/tmp/payload.sanitized.svg
On the vulnerable release, the expected diagnostic is:
Processing instruction survived sanitization.