Skip to content

Canvix — Free & open-source graphic design tool. A community-built Canva alternative with a drag-and-drop editor, templates, shapes, text, images & one-click export. Works on desktop, tablet & mobile.

docs(security): disclosure documentation for the CWE-79 media XSS — policy, changelog, release checklist

Ashiq Hussain Mir501aef36c57b
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8e3ddc1..b47e20a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,27 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
## [Unreleased]
+### Security — stored XSS via `/api/media` closed (CWE-79)
+
+- **Unauthenticated stored XSS through uploaded SVG served inline from the
+ media store** (CWE-79; reporter-assessed CVSS v3.1 6.1
+ `AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`) — closed by `fde7f25` with four
+ layers: an **exact MIME allowlist** at upload init (SVG/HTML/XML
+ structurally rejected, no prefix matching), **magic-byte verification**
+ at finalize (the bytes must prove the declared type), **ownership
+ enforcement** on append/finalize (flat 404, no existence oracle), and
+ **hardened delivery** — every media response carries `nosniff` plus a
+ sandboxing CSP, and anything the stored bytes cannot prove is served as
+ `application/octet-stream` with `Content-Disposition: attachment`, which
+ also neutralizes media stored before the hardening. Security regression
+ suites replay the original report across all four layers, including the
+ 206 Range path and legacy rows. **Reported by hackchang (@hackchang)**
+ (private report, 2026-11-25) — thank you for the clear write-up and the
+ coordinated disclosure. A GitHub Security Advisory and CVE request are in
+ coordinated disclosure with the reporter; identifiers will be linked here
+ once public. Self-hosters on any build between 2026-10-29 and 2026-11-25
+ should update to current `main`.
+
### Added — FOSS United funding application (v0.29.5)
- **Website ownership verification ACTIVATED (2026-11-24):** after the
diff --git a/README.md b/README.md
index ca473fc..d2dd80d 100644
--- a/README.md
+++ b/README.md
@@ -968,6 +968,13 @@ tool descriptions so agents pick the right format.
`research/V05-SECURITY-AUDIT.md`
- **Sanitized SVG export** — all text is XML-escaped, path data is whitelisted,
image hrefs only allow `data:`/`https:`; no scripts or event handlers
+- **Hardened media upload & delivery** — the media store accepts an exact
+ MIME allowlist (SVG/HTML/XML never accepted), verifies magic bytes at
+ finalize, enforces upload ownership, and serves every media response with
+ `nosniff` plus a sandboxing CSP; anything the stored bytes cannot prove is
+ delivered as an opaque download, including anything stored before this
+ hardening. Found via a responsibly disclosed stored-XSS report (credit:
+ @hackchang) — see [SECURITY.md](SECURITY.md) for how to report
- **AI actions are double-validated** (server clamps + client re-checks) and
always undoable
- **MCP endpoint hardening** — disabled until `CANVIX_MCP_TOKEN` is set; Bearer
diff --git a/RELEASE-CHECKLIST.md b/RELEASE-CHECKLIST.md
index 089f4fe..3e5fbec 100644
--- a/RELEASE-CHECKLIST.md
+++ b/RELEASE-CHECKLIST.md
@@ -42,6 +42,17 @@ The `.gitignore` incident: `git add` **silently skips** ignored paths — a rout
- [ ] Tag and push: `git tag vX.Y.Z && git push origin main --tags`, cut the GitHub Release from the changelog entry.
- [ ] Post-deploy verification on the live instance: `/api/health?v=2` returns `"ok":true` with fresh counts; the release's own headline features work in the deployed build (the v0.23.1 lesson: verify *on the deployment*, not just locally).
+## 5. Security releases (coordinated disclosure)
+
+Born from the first coordinated disclosure (CWE-79 media upload XSS, reported 2026-11-25 by @hackchang):
+
+- [ ] The fix commit must be **inside the tagged release** before the advisory publishes — verify with `git tag --contains <fix-sha>`.
+- [ ] Update the draft advisory's `patched_versions` to the **real tag** (never a placeholder or invented number), and keep the affected range in sync with the actual tags.
+- [ ] Coordinate the publication date with the reporter: the default is the 90-day window; an earlier joint publication is fine when both parties agree AND a patched release is out.
+- [ ] The fix commit being public does **not** auto-publish the advisory — publication is a deliberate, coordinated step.
+- [ ] Credit the reporter through the advisory's **Credits** section (role: `reporter`) — an acknowledgment in the commit message or changelog is not the same thing.
+- [ ] After publication: link the GHSA and CVE in `CHANGELOG.md` and the README security notes, and state the affected self-hoster build range with the upgrade path (`git pull` + re-deploy).
+
---
### House rules
diff --git a/SECURITY.md b/SECURITY.md
index 7df0e04..05018d4 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -6,17 +6,21 @@ Canvix moves fast, and security fixes land on `main` first. Only the latest
release line receives security patches — self-hosting is one `git pull` (or
one re-deploy) away from current.
-| Version | Supported |
-| ------- | ------------------ |
-| 0.22.x | ✅ current `main` |
-| older | ❌ upgrade first |
+| Version | Supported |
+| ------- | ---------------------- |
+| 0.23.x | ✅ current release line |
+| older | ❌ upgrade first |
## Reporting a vulnerability
**Do not report security vulnerabilities through public GitHub issues,
discussions, or pull requests.**
-Instead, email the maintainer privately:
+The preferred channel is GitHub's **private vulnerability reporting** (the
+*Report a vulnerability* button on this repository's **Security** tab — it
+is enabled here).
+
+Alternatively, email the maintainer privately:
@@ -41,8 +45,9 @@ than corporate:
release within 14 days for anything exploitable on a default deployment
- **Coordinated disclosure** — we ask for up to 90 days before public
disclosure, and will negotiate an earlier joint announcement for anything
- already exploited in the wild. Credit is given in the changelog unless you
- prefer to stay anonymous.
+ already exploited in the wild. Credit is given through GitHub Security
+ Advisory credits (Reporter role) and the changelog unless you prefer to
+ stay anonymous.
### Safe harbor
@@ -92,6 +97,12 @@ layers is especially interesting to us:
malformed events are dropped, never crashed on
- **Sanitized SVG export** — XML-escaped text, whitelisted path data,
`data:`/`https:`-only image hrefs, no script or event-handler content
+- **Hardened media upload & delivery (v0.31)** — the media store accepts
+ an exact MIME allowlist (SVG/HTML/XML structurally rejected), verifies
+ magic bytes at finalize, enforces upload ownership on append and
+ finalize, and every media response carries `nosniff` plus a sandboxing
+ CSP; anything the stored bytes cannot prove is served as an opaque
+ download — including media stored before this hardening
- **MCP endpoint hardening** — disabled until a token is set, Bearer auth
with timing-safe comparison, DNS-rebinding guard, SSRF-guarded image
fetches with size/time caps, per-tool argument clamping