Nitro Pro Indexed ColorSpace Rendering Code Execution Vulnerability
An integer overflow in Nitro Pro's handling of an Indexed colorspace's hival value causes an undersized heap buffer to be allocated, and subsequent palette loading writes past its bounds, leading to memory corruption that can result in code execution. A victim must open a specially crafted PDF document to trigger the vulnerability.
Cisco Talos
Originally disclosed on Cisco Talos
An arbitrary code execution vulnerability exists in the rendering functionality of Nitro Software, Inc.’s Nitro Pro 13.13.2.242. When drawing the contents of a page using colors from an indexed colorspace, the application can miscalculate the size of a buffer when allocating space for its colors.
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 multiplication of (hival + 1) by 3 is performed without checking for overflow, so the subsequent addition of 3 and overflow check do not catch the earlier wrap, resulting in an undersized allocation.
Impact
The heap-based buffer overflow can lead to code execution under the context of the application, though the exploit requires the victim to open a specially crafted document.
What the attacker needed
Victim opens a crafted PDF; Nitro Pro installed
The fix
The vendor patched the vulnerability in version 13.16.2.300, likely by adding a proper overflow check on the multiplication step.
How it was found
- Create a PDF with an Indexed colorspace whose hival is 1431655765 (0x55555555).
- Place the colorspace in object 6 and the page rendering commands in object 7.
- In the page content, load the colorspace by name and use a colour to draw a rectangle filling the first page.
- Open the crafted PDF in Nitro Pro to trigger the overflow and 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.
When a PDF uses an 'Indexed' colour palette, the program calculates how much memory to reserve for the palette. A flaw in that calculation makes it reserve too little memory, and then it writes all the palette colours into that small space, spilling over into neighbouring memory. This can crash the program or, in the worst case, let an attacker run their own code when the victim opens the malicious PDF.
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.