Skip to content

Bump svgo to 3.3.5 in the docs site to fix GHSA-w27v-7q3p-w38r - #183

Merged
MikeAlhayek merged 1 commit into
mainfrom
claude/security-vulnerability-fix-wa2wn2
Sep 14, 2026
Merged

MikeAlhayek merged 1 commit into
mainfrom
claude/security-vulnerability-fix-wa2wn2

Conversation

@MikeAlhayek

Copy link
Copy Markdown
Member

Fixes GHSA-w27v-7q3p-w38r (CVE-2026-84370, High, CVSS 8.2).

The problem

src/CrestApps.Core.Docs resolved svgo 3.3.4 transitively, through two paths:

  • @docusaurus/preset-classic@svgr/webpack@svgr/plugin-svgo (svgo: ^3.0.2)
  • @docusaurus/corecssnano-preset-advancedpostcss-svgo (svgo: ^3.2.0)

In that version the removeScripts plugin failed to strip executable links two ways:

  1. Namespace bypass — it only matched unprefixed <a> elements, so a namespace-prefixed <svg:a href="javascript:..."> kept its href.
  2. Control-character bypass — scheme validation didn't normalize embedded tabs, line feeds, or carriage returns, so java&#9;script: slipped past the javascript: check while browsers still parsed it as a script URL.

An app that optimizes attacker-supplied SVGs with that plugin and then serves them in a browser context could execute script in the SVG's origin.

The fix

  • Added "svgo": "^3.3.5" to the existing overrides block in src/CrestApps.Core.Docs/package.json, alongside the minimatch, serialize-javascript, and uuid pins already there. Both transitive ranges (^3.0.2 and ^3.2.0) accept 3.3.5, so the override keeps the patched version in place rather than fighting the resolver.
  • Updated src/CrestApps.Core.Docs/package-lock.json to svgo 3.3.5. The dependency set is unchanged between 3.3.4 and 3.3.5, so this is a three-line change to version/resolved/integrity with no downstream churn.

The root package-lock.json does not contain svgo, so no change was needed there.

Verification

  • npm ci --dry-run in src/CrestApps.Core.Docs succeeds and resolves svgo 3.3.5, confirming package.json and the lockfile are in sync.
  • Downloaded the 3.3.5 tarball and confirmed the integrity hash matches the lockfile entry, and that plugins/removeScriptElement.js now carries the namespace-aware element matching (isNamespaceAwareElem, ANCHOR_NAMESPACES) and the shared isExecutableUrl scheme check that close both bypasses.

One note on the lockfile: the existing docs lockfile resolves packages through the ms-feed-*.pkgs.visualstudio.com 1ES mirror, but that host is not reachable from this environment, so the new entry points at registry.npmjs.org with the official sha512 integrity. npm handles the mixed hosts fine, but if you would rather keep the file uniform, regenerating the entry from the mirror will swap it back.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ELjK1ZcXrvTuv59mkf4d9S


Generated by Claude Code

The docs site pulled svgo 3.3.4 transitively through @svgr/plugin-svgo and
postcss-svgo. That version's removeScripts plugin missed namespace-prefixed
anchors (<svg:a href="...">) and URL schemes containing embedded tabs, line
feeds, or carriage returns (java&#9;script:), so executable links could
survive optimization.

Pin svgo to ^3.3.5 with an override, alongside the existing minimatch,
serialize-javascript, and uuid pins, so the patched version stays in place
as the transitive ranges (^3.0.2 and ^3.2.0) continue to resolve.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ELjK1ZcXrvTuv59mkf4d9S
@MikeAlhayek
MikeAlhayek merged commit 8ba834c into main Sep 14, 2026
10 checks passed
@MikeAlhayek
MikeAlhayek deleted the claude/security-vulnerability-fix-wa2wn2 branch September 14, 2026 13:58
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.

2 participants