Skip to content
Memory corruption Advisory Advanced CVE-2018-3999

Atlantis Word Processor JPEG length underflow code execution vulnerability

The JPEG parser in Atlantis Word Processor mishandles the 16-bit length field of an APPx marker, allowing a length underflow that is treated as unsigned and used to drive a byte-copy loop into a fixed 32-byte stack buffer. An attacker who convinces a victim to open a crafted document containing such an image could overwrite the stack and potentially execute code as the user.

A member Follow

Originally disclosed on Cisco Talos

High 8.8 View original

An exploitable stack-based buffer overflow vulnerability exists in the JPEG parser of Atlantis Word Processor, version 3.2.5.0. A specially crafted image embedded within a document can cause a length to be miscalculated and underflow.

a member, 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

The APPx marker length is read as a 16-bit value, decremented by two, and a signed check clamps it to zero, but the resulting count is then used as an unsigned loop counter that copies bytes into a 32-byte stack buffer without bounds checking.

Impact

A crafted document could cause a stack-based buffer overflow that may lead to code execution under the context of the application, though the victim must open the document.

What the attacker needed

Victim opens a crafted document; document embeds a malicious JPEG

The fix

The vendor patched the issue via a beta version and released a fixed build.

How it was found

  1. Create a document that embeds a JPEG image whose APPx marker carries a crafted length value.
  2. Open the document in the vulnerable version of the word processor so the image is parsed.
  3. The parser reads the marker length, underflows it, and the copy loop writes past the stack buffer, crashing or corrupting control data.

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 word processor reads image files inside documents. When it reads a JPEG, it trusts a small number that says how long a section is; if that number is zero or tiny, the program's maths goes wrong and it keeps copying bytes into a small fixed space on the stack, a scratch area for temporary data. Writing past that space corrupts the program's own control data, which can let an attacker run their own code when the document is opened.

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 A member

View all

110 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.