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

Atlantis Word Processor Huffman table code length remote code execution vulnerability

The PNG decoder in Atlantis Word Processor does not validate Huffman code lengths read from a crafted document, so a value above 15 causes an out-of-bounds write into a fixed 64-byte count array. An attacker who convinces a victim to open a malicious document could corrupt memory and potentially execute code in the application's context.

A member Follow

Originally disclosed on Cisco Talos

High 8.8 View original

An exploitable out-of-bounds write vulnerability exists in the PNG implementation of Atlantis Word Processor, version 3.2.7.2. This can allow an attacker to corrupt memory, which can result in code execution under the context of the application.

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

Likely the inflate_table routine indexes a 64-byte count array with unvalidated Huffman code lengths from the PNG stream, without checking they are 15 or less.

Impact

This can corrupt memory and could lead to code execution under the context of the application, but the victim must open a specially crafted document.

What the attacker needed

Victim opens a crafted document; document contains a crafted PNG image

How it was found

  1. Open a document that follows the open document format specification so the application fingerprints it and selects the open document parser.
  2. Include a PNG image so the application constructs a TPNGImage and loads it from a stream.
  3. Supply IDAT chunk data that decompresses to code lengths above 15 during the CODELENS state.
  4. The inflate_table routine uses those lengths to index the count array and writes out of bounds.

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 pictures inside documents. When it unpacks a PNG picture, it trusts a small number that says how long a piece of compressed data is, and uses that number to pick a slot in a fixed-size list. A crafted document can supply a number too big for the list, so the program writes past the end of it, 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 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.