Foxit PDF Reader JBIG2 Parser Information Disclosure Vulnerability
A wrongly bounded memcpy in Foxit PDF Reader's JBIG2 parser causes an out-of-bounds heap read, copying adjacent heap memory into a buffer. An attacker could use this to disclose heap layout and bypass ASLR, potentially leading to code execution when combined with another vulnerability.
Originally disclosed on Cisco Talos
A large out of bounds read on the heap vulnerability in Foxit PDF Reader can potentially be abused for information disclosure. Combined with another vulnerability, it can be used to leak heap memory layout and in bypassing ASLR.
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
The parser uses a size value from one segment to copy data from a buffer allocated for a different segment, without checking that the source buffer is large enough.
Impact
The out-of-bounds read could disclose heap memory layout and bypass ASLR; with Page Heap enabled it crashes, but without it a memcpy could succeed and leak sensitive information.
What the attacker needed
Victim opens a malicious PDF; Foxit Reader 8.0.2.805
How it was found
- Create a JBIG2 symbol dictionary segment with SDTEMPLATE not 0 and 'bitmap coding context used' unset.
- Create a second symbol dictionary segment that refers to the first, with SDTEMPLATE 0 and 'bitmap coding context used' set.
- Open the PDF containing these segments in Foxit Reader.
- The parser allocates a small buffer for the first segment and then calls memcpy with a large size using that buffer as source, causing an 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 image format called JBIG2. When Foxit Reader parses certain JBIG2 data, it copies more bytes than it should from a small buffer, pulling in nearby memory. That leaked memory can reveal where things are stored in memory, helping an attacker bypass a security defence called ASLR.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.