Google PDFium TIFF Image Flate Decoder Code Execution Vulnerability
An off-by-one heap read/write exists in Pdfium's TIFF image decoder when processing a specially crafted PDF. An attacker could cause memory corruption, potentially leading to information disclosure or code execution, if the victim opens the malicious PDF.
Originally disclosed on Cisco Talos
An off-by-one read/write on the heap vulnerability exists in the TIFF image decoder functionality of Pdfium as used by Google Chrome up to and including 60.0.3112.101. A specially crafted PDF file can trigger an off-by-one read and write on the heap resulting in memory corruption and a possible information leak and…
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 TIFF predictor function assumes at least four bytes are available in the last row, but the row size can be three, causing an out-of-bounds read and write.
Impact
Depending on the allocator, this could lead to information leaks or memory overwrite, and it could potentially be combined with other vulnerabilities to cause further memory corruption.
What the attacker needed
Victim opens a malicious PDF
How it was found
- Create a PDF with a FlateDecode stream using TIFF predictor parameters.
- Set Columns, Colors, and BitsPerComponent so the decoded stream length yields a last row size of 3.
- Open the PDF in the vulnerable browser or Pdfium test program.
- The TIFF predictor processes the last row and reads/writes one byte beyond the 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 images compressed in a certain way. When the program unpacks such an image, it sometimes reads and writes one byte past the end of a memory buffer. This can crash the program or, in the worst case, let an attacker 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.