cfi-derived-cast: Invalid downcast in SVGUtils::SetupStrokeGeometry
When Firefox is compiled with the cfi-derived-cast option, a downcast in SVGUtils::SetupStrokeGeometry is invalid because the content object is a text node rather than an SVG element. This causes a crash in a crashtest, but the report does not show how an attacker could trigger it or what security impact it has.
Originally disclosed on Mozilla
- Fixed in 4 days
- Paid in 53 days
- Disclosed after 4 days
Steps to reproduce:
When compiling Firefox with cfi-derived-cast, crashtest layout/svg/crashtests/267650-1.svg fails due to the downcasting here:
https://searchfox.org/mozilla-central/rev/daf613efc5c358f3a94961d73b90472c00703838/layout/svg/SVGUtils.cpp#1525
The dynamic type of `aFrame->GetContent()` is `nsTextNode`, which is not derived from `SVGElement`.
This might not be s-s, just flagging as a precaution.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the code performed a downcast to SVGElement without checking that the content object was actually an SVG element.
Impact
The invalid downcast causes a crash in the crashtest, but the report does not claim any attacker-triggerable security impact.
What the attacker needed
Firefox built with cfi-derived-cast
How it was found
- Compile Firefox with the cfi-derived-cast option.
- Run the crashtest layout/svg/crashtests/267650-1.svg.
- Observe the failure caused by the invalid downcast.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
This is a bug report about a crash in Firefox's SVG drawing code. The code assumed a certain object was an SVG element, but it was actually a plain text node, so a safety check called a cast failed. The report only shows a test crash, not how a real attacker could use it.