Skip to content
Memory corruption Advisory Advanced CVE-2025-66342

Canva Affinity EMF File EMR_FRAMERGN Type Confusion Vulnerability

A crafted EMF file can make the EMR_FRAMERGN record reference a brush index that does not match the brush created by EMR_CREATEBRUSHINDIRECT, so the loader treats an unrelated object as a brush. This type confusion leads to memory corruption and could allow arbitrary code execution.

KPC Follow

Originally disclosed on Cisco Talos

High 7.8 View original

A type confusion vulnerability exists in the EMF functionality of Canva Affinity. A specially crafted EMF file can trigger this vulnerability, which can lead to memory corruption and result in arbitrary code execution.

KPC, 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 EMF loader uses the ihBrush index from EMR_FRAMERGN to fetch an object from the object table without verifying that the entry is actually a brush created by EMR_CREATEBRUSHINDIRECT.

Impact

Depending on the memory layout of the process, this could give arbitrary read and write access and ultimately arbitrary code execution, though the demonstrated result is a crash from an uninitialised pointer.

What the attacker needed

Victim opens a crafted EMF file; local user interaction

The fix

The vendor released a patch, and the loader should validate that the indexed object table entry is a genuine brush before using it.

How it was found

  1. Create an EMF file whose EMR_CREATEBRUSHINDIRECT record stores the brush at one index.
  2. In the EMR_FRAMERGN record, set ihBrush to a different index that holds an unrelated object.
  3. Open the file in the affected application and observe the object lookup during loading.
  4. Watch the unrelated object be used as a brush, reading an uninitialised field as a pointer and crashing.

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.

EMF is a file format for storing pictures. Inside it, small records describe things like brushes used to draw borders, and each brush is stored in a numbered table. The program trusted a number in one record without checking it pointed at a real brush, so it picked up a different object and later used it as if it were a brush, which crashed the program and could 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 KPC

View all

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