Closed Bug 2045496 (CVE-2026-12316) Opened 3 months ago Closed 3 months ago

Sanitizer API allows one-click XSS with SVG animation due to incomplete namespace check when clearing xlink:href

Categories

(Core :: DOM: Security, defect)

defect

Tracking

()

RESOLVED FIXED
153 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr140 --- disabled
firefox151 --- wontfix
firefox152 + fixed
firefox153 + fixed

People

(Reporter: freddy, Assigned: freddy)

References

(Blocks 1 open bug)

Details

(Keywords: csectype-mitigation-bypass, sec-moderate, Whiteboard: [adv-main152+])

Attachments

(3 files)

The bug (one sentence): safe-mode setHTML guards SMIL href-animation by literal string comparison of attributeName against "href"/"xlink:href" (Sanitizer.cpp:1644 - and the spec specifies exactly this), but SMIL consumes attributeName as a QName resolved against live-tree namespace bindings, so attributeName="k:href" slips through and animates xlink:href to a javascript: URL.

Preconditions:

  1. custom config allowing svg+a+set/animate+attributeName/to/begin/dur+xlink:href, each looks innocuous, none are event handlers;
  2. any ancestor of the insertion point binding a non-xlink prefix to the XLink URI (XHTML, XSLT output, editor-generated SVG with ns1:-style prefixes, DOM-built declarations);
  3. one user click on attacker-controlled link text. Not reachable with the "default" preset (no animation elements).

Fix (both Gecko and spec): remove attributeName when its value is "href" or ends with ":href" — complete, because SMIL needs the local part to be exactly href to bind the animatable slots; no prefix spelling can evade a suffix rule.

Attached file (secure)

Reminder that the test case needs to be integrated into wpt when this is fixed in affected engines

Flags: in-testsuite?

https://hg-edge.mozilla.org/mozilla-central/rev/848035deee86

Please add a Beta uplift request on this.

Group: dom-core-security → core-security-release
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Flags: needinfo?(fbraun)
Resolution: --- → FIXED
Target Milestone: --- → 153 Branch

Uplift requested via Lando.

Flags: needinfo?(fbraun)

firefox-beta Uplift Approval Request

  • User impact if declined/Reason for urgency: Fixes an issue in a web security API. Web page that rely on the Sanitizer API (in a really, really unlikely configuration) might not get the XSS protection they want.
  • Code covered by automated testing?: no
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing: We reproduced & tested manually. There's a test case in the repo that we did not want to land directly, as we are coordinating the fix with the specification and other implementations (even though they are all likely not affected)
  • Risk associated with taking this patch: low
  • Explanation of risk level: One line code change, just changing an if-clause comparison.
  • String changes made/needed?: N/A
  • Is Android affected?: yes
Attachment #9595900 - Flags: approval-mozilla-beta?
Attached file (secure)
Attachment #9595900 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Whiteboard: [sec] [uplift] [qa-triage-done-c153/b152]
Whiteboard: [adv-main152+]
Alias: CVE-2026-12316
Group: core-security-release
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: