Skip to content
Memory corruption Advisory Advanced CVE-2016-8385

Iceni Argus PDF Uninitialized WordStyle Color Length Code Execution Vulnerability

A malformed PDF with a bad colour definition leaves a stack variable uninitialised, which is later used as a loop length in a copy operation, causing a stack-based buffer overflow. An attacker could exploit this to write outside the bounds of a stack buffer and potentially execute code under the context of the user running the tool.

Marcin Noga Follow

Originally disclosed on Cisco Talos

High 8.8 View original

An exploitable uninitialized variable vulnerability which leads to a stack-based buffer overflow exists in Iceni Argus. When it attempts to convert a malformed PDF to XML a stack variable will be left uninitialized which will later be used to fetch a length that is used in a copy operation.

Marcin Noga, on Cisco Talos

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 a malformed colour definition causes a colour conversion function to return without initialising its output buffer, and the caller then uses an uninitialised byte from that buffer as a loop bound for a copy into a fixed-size stack buffer.

Impact

This could allow an attacker to write outside the bounds of a stack buffer and potentially execute code under the context of the account running the tool.

What the attacker needed

Victim opens a malicious PDF; tool processes the PDF

How it was found

  1. Create a PDF containing a malformed colour definition using the 'rg' opcode.
  2. Run the Iceni Argus convert tool on the PDF.
  3. The tool processes the page and reaches the style collection code.
  4. The uninitialised buffer leads to a large loop count and a stack buffer overflow, causing a 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 program converts a PDF, it sometimes uses a variable without setting it first. Here, a bad colour value in the PDF means a colour buffer is never filled in, so the program reads leftover data from the stack and uses it as a length. That length can be too big, so the program writes past the end of a small buffer, which can crash it or 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.

More by Marcin Noga

View all

7 more disclosed reports, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.