Google PDFium JBIG2 image ComposeToOpt2WithRect information disclosure vulnerability
An out-of-bounds read exists in PDFium's JBIG2 image decoding when processing a crafted PDF, allowing an attacker to leak heap memory. The attacker must trick the user into visiting a malicious site to trigger the vulnerability.
Originally disclosed on Cisco Talos
An exploitable out-of-bounds read on the heap vulnerability exists in the JBIG2 parsing code of Google Chrome version 67.0.3396.99. A specially crafted PDF document can trigger an out-of-bounds read, which can possibly lead to an information leak that could be used as part of an exploit.
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 code fails to properly validate the calculated offset when composing a JBIG2 image region, allowing a pointer to go beyond the allocated buffer.
Impact
The vulnerability could lead to an information leak that could be used as part of an exploit, and with precise control it is possible that this could lead to further memory corruption.
What the attacker needed
Victim visits a malicious site; victim opens a crafted PDF
The fix
The fix should add a bounds check on the calculated data offset before using it to access memory.
How it was found
- Create a PDF with an image XObject using the JBIG2Decode filter and specific width and height values.
- Craft the JBIG2 stream with a first region (any content) followed by an immediate generic region (type 38) with controlled bitmap width, height, and location.
- Open the PDF in a vulnerable version of Chrome or PDFium to trigger the out-of-bounds read.
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 a special type of image called JBIG2. When Chrome tries to display such an image, it can read memory outside the intended buffer, which may reveal sensitive data. The attacker needs the victim to open a malicious PDF, for example by visiting a website that loads it.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.