Apple Safari SVG Marker Element baseVal Remote Code Execution Vulnerability
A use-after-free exists in WebKit's SVG marker element handling: replacing the marker's child content with a long string leaves a stale reference, and later reading or writing the orientAngle baseVal value touches freed memory. An attacker could cause memory corruption and possibly arbitrary code execution by getting a victim to open a crafted HTML page.
Originally disclosed on Cisco Talos
A freed memory access vulnerability exists in the SVG Marker Element feature of Apple Safari’s WebKit version 13.0.2. A specially crafted HTML web page can cause a use after free, resulting in memory corruption and possibly arbitrary code execution.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
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 SVG marker element's animated property still references a child node that was replaced when the element's innerHTML was overwritten, so committing a property change dereferences freed memory.
Impact
A crafted page could cause memory corruption and possibly arbitrary code execution in the browser, though the report only demonstrates a crash under AddressSanitizer.
What the attacker needed
Victim opens a crafted HTML page; Safari 13.0.2 or affected WebKit build
How it was found
- Open the crafted HTML page in Safari so the SVG marker element is rendered.
- Replace the marker's child content with a long string via innerHTML.
- Read the orientAngle attribute and assign a value to its baseVal, which triggers the crash.
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.
A web browser keeps objects in memory while a page is open and frees them when they are no longer needed. Here the browser freed an object but a script still held a pointer to it, so touching that pointer reads memory that no longer belongs to the page. This kind of mistake is called a use-after-free, and it can let an attacker corrupt memory and sometimes run their own code.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.