Skip to content

feat: prepare v0.0.8 - #213

Merged
sebastienrousseau merged 2 commits into
mainfrom
feat/v0.0.8
Nov 1, 2026
Merged

sebastienrousseau merged 2 commits into
mainfrom
feat/v0.0.8

Conversation

@sebastienrousseau

Copy link
Copy Markdown
Owner

This PR fixes GHSA-83v7-xc9g-5frf: the SVG sanitiser now clears unsafe URIs in unquoted attribute values, and prepares 0.0.8.

An uploaded SVG with <a href=javascript:...> (no quotes) kept the link, so opening it on cloudcdn.pro could run script on that origin.

Highlights ⭐️

  • Unquoted values are checked: javascript:, vbscript: and unsafe data: URIs are cleared whether the value is quoted or not; a trailing /> stays outside the value so cleared self-closing tags stay well-formed.
  • Sanitiser under the complexity ceilings: stripUnsafeUriValues is split into small helpers; the complexity baseline shrinks by three entries.

What's Changed

Validation

  • npx vitest run scripts/tests/pipeline.test.js: the new regression test fails on the 0.0.7 code (1 failed, 57 passed) and passes with the fix (58 passed).
  • npm test: 95 files, 3839 tests pass. npm run lint: clean.
  • Differential run of 0.0.7 vs fixed sanitizeSvg over 200,000 generated tag sequences: 183,869 identical, 16,131 differ only where 0.0.7 kept an unquoted unsafe URI that the fix clears, 0 other differences.

Checksums

SHA-256 of the artifact produced by git archive HEAD | gzip -n on this branch:

75c8680cb24a57bf68a77429ca2f712a751f6606e18c3cbd473219d4bf49a3c7  cloudcdn.pro-0.0.8.tar.gz

Full Changelog: v0.0.7...v0.0.8

sebastienrousseau and others added 2 commits November 1, 2026 14:17
The SVG upload sanitiser cleared javascript:, vbscript: and unsafe
data: URIs only in quoted attribute values. An unquoted value such as
<a href=javascript:alert(1)> passed through unchanged, so an uploaded
SVG opened directly on cloudcdn.pro could run script on that origin
when the link was followed.

Cause: stripUnsafeUriValues ran isUnsafeUriValue on the quoted branch
only; the unquoted branch copied the value through.

Fix: read quoted and unquoted values through one path (readable
sticky scanners) so every value gets the same check. A trailing "/>"
stays outside an unquoted value, so a cleared self-closing tag stays
well-formed. The function is split into helpers that meet the
complexity ceilings, and the baseline drops its three entries.

Verified:
- New regression tests fail on the previous code and pass now.
- The 58 sanitiser tests and the full suite (3839 tests) pass.
- Differential run of old vs new sanitizeSvg over 200,000 generated
  tag sequences: 183,869 identical, 16,131 differ only where the old
  output kept an unquoted unsafe URI that the new output clears, 0
  other differences.

Fixes: eb1a37e ("security: replace regex SVG sanitizer with string-walker state machine")
Assisted-by: Claude Code:claude-opus-5-5 eslint
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Sebastien Rousseau <sebastienrousseau@users.noreply.github.com>
Bump the site to 0.0.8 and record the SVG sanitiser fix
(GHSA-83v7-xc9g-5frf) in CHANGELOG.md and docs/releases/v0.0.8.md.

Assisted-by: Claude Code:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Sebastien Rousseau <sebastienrousseau@users.noreply.github.com>
@sebastienrousseau
sebastienrousseau merged commit 0f4f726 into main Nov 1, 2026
15 checks passed
@sebastienrousseau
sebastienrousseau deleted the feat/v0.0.8 branch November 1, 2026 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant