Skip to content
Memory corruption Write-up Advanced

Unicode Buffer Overflow

A playlist file with an overly long entry causes a stack buffer overflow in Quick Player 1.2 when the data is converted to Unicode, overwriting the SEH chain. An attacker could craft a malicious m3u file that leads to code execution when opened.

Angelo Pio Amirante Follow

Published on systemweakness.com

The aim of this article will be the exploitation of buffer overflow vulnerability in applications that use Unicode format, rather than ASCII. We will see the theory first, then the practice.

Angelo Pio Amirante, on systemweakness.com

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 write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the application copies playlist data into a fixed-size stack buffer without checking length, and the Unicode conversion does not prevent overwriting the SEH chain.

Impact

An attacker could execute arbitrary code on the victim's machine if the victim opens a crafted playlist file.

What the attacker needed

Victim opens a malicious m3u file; Quick Player 1.2 installed

How it was found

  1. Create a malicious m3u playlist file containing a long string of characters.
  2. Run Quick Player and attach a debugger to it.
  3. Load the malicious playlist via PL -> File -> Load List.
  4. Observe the exception and the overwritten EIP and SEH chain.
  5. Use a mona pattern to find the offset to the SEH structure.
  6. Craft the payload to control nSEH and SEH and redirect 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 write-up has not been written yet. The Original tab links to the source.

A buffer overflow happens when a program copies more data into a fixed-size memory area than it can hold, so the extra data spills over and can overwrite nearby instructions. Here the program reads a playlist file and converts the text to a two-byte-per-character format called Unicode, which still lets an attacker control the overflow. By carefully choosing the file contents, an attacker can redirect the program 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.

More by Angelo Pio Amirante

View all

5 more disclosed reports, best first.

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.