Google Chrome PDFium Javascript Active Document Memory Corruption Vulnerability
PDFium, the PDF renderer inside Chrome, treats the document-level `this` object and `app.activeDocs[0]` as different kinds of object even though they represent the same document, so assigning one as the prototype of the other creates a circular prototype chain that V8 would normally reject. The proof of concept then drives V8 into a state that causes an out-of-bounds heap read, which the author suggests could potentially be developed into arbitrary code execution.
Originally disclosed on Cisco Talos
A memory corruption vulnerability exists in the way Google Chrome 83.0.4103.61 executes JavaScript inside PDF documents. A specially crafted web page can cause out of bounds memory access.
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 PDFium exposes the document-level `this` and `app.activeDocs[0]` as distinct V8 object types for the same document, so the cyclic prototype check is bypassed and later object lookups read out of bounds.
Impact
The crafted document causes an out-of-bounds heap read that crashes the renderer, and the author states it is possible this could be abused for further memory corruption and potentially arbitrary code execution.
What the attacker needed
Victim opens a malicious PDF; JavaScript enabled in the PDF viewer
The fix
The vendor patched the issue two days after disclosure, though the text does not describe the code change.
How it was found
- Open a PDF whose document-level script assigns the active document object as the prototype of `this`.
- Observe that the assignment succeeds instead of raising a cyclic prototype error.
- Run the remaining script that sets up the V8 runtime state needed to reach the corrupting path.
- Trigger a document object lookup such as `getField`, which reads past the end of a heap buffer.
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 PDF file can contain small scripts, and Chrome runs them with the same JavaScript engine it uses for web pages. This report shows that the PDF engine hands the script two objects that look identical but are internally different, which lets the script build a loop in the object's inheritance chain that the engine normally forbids. That broken state later makes the browser read memory outside a buffer, which can crash it and might be turned into code execution.
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.