Iceni Argus PDF TextToPolys Rasterization Code Execution Vulnerability
An integer overflow in Iceni Argus when converting a malformed PDF to XML causes a buffer to be allocated with a size smaller than needed, leading to a heap buffer overflow when rasterizing a polygon. An attacker could exploit this to execute code under the context of the user running the tool.
Originally disclosed on Cisco Talos
An exploitable integer-overflow vulnerability exists within Iceni Argus. When it attempts to convert a malformed PDF to XML, it will attempt to convert each character from a font into a polygon and then attempt to rasterize these shapes.
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 product of two dimensions used for allocation is not checked for integer overflow, so a smaller buffer is allocated than the number of pixels later written.
Impact
This could lead to code execution under the context of the account running the tool.
What the attacker needed
Victim opens a malformed PDF; tool processes the PDF
How it was found
- Create a malformed PDF that triggers the vulnerable code path.
- Open the PDF with Iceni Argus or a tool that uses it, such as MarkLogic Server's converter.
- The tool processes text and converts characters to polygons.
- During polygon filling, an integer overflow causes an undersized buffer allocation.
- The tool writes pixel data beyond the buffer, causing a crash or potential code execution.
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 program needs to store data, it calculates how much space to reserve. Here, a multiplication used to calculate that space can overflow, making the program reserve too little memory. Later, when it writes data into that memory, it writes past the end, corrupting other memory and potentially allowing an attacker to 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.