Skip to content

Properly restrict SVG href attributes - #223

Merged
flavorjones merged 1 commit into
mainfrom
svg-href-local-ref
Jul 16, 2026
Merged

Properly restrict SVG href attributes#223
flavorjones merged 1 commit into
mainfrom
svg-href-local-ref

Conversation

@flavorjones

Copy link
Copy Markdown
Member

PermitScrubber reimplements Loofah's SVG local-reference restriction,
which covered only xlink:href. SVG 2 also allows plain href, so
<use href="https://example.com/x.svg#p"/> passed through intact.
Restrict both via Loofah's SVG_HREF_ATTRIBUTES set (Loofah >= 2.25.2),
mirroring the related Loofah fix for GHSA-9wjq-cp2p-hrgf.

ref: GHSA-cj75-f6xr-r4g7

PermitScrubber reimplements Loofah's SVG local-reference restriction,
which covered only `xlink:href`. SVG 2 also allows plain `href`, so
`<use href="https://example.com/x.svg#p"/>` passed through intact.
Restrict both via Loofah's SVG_HREF_ATTRIBUTES set (Loofah >= 2.25.2),
mirroring the related Loofah fix for GHSA-9wjq-cp2p-hrgf.

ref: GHSA-cj75-f6xr-r4g7
@flavorjones
flavorjones merged commit b4673b9 into main Jul 16, 2026
15 checks passed
@flavorjones
flavorjones deleted the svg-href-local-ref branch July 16, 2026 02:57
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