Canva Affinity EMF File EMR_CREATEDIBPATTERNBRUSHPT offBmi Out-Of-Bounds Read Vulnerability
The EMF loader in Canva Affinity does not validate the offBmi offset in an EMR_CREATEDIBPATTERNBRUSHPT record before using it to locate the DIB header. A crafted EMF file can make that offset point outside the allocated record, causing an out-of-bounds read that may disclose memory contents.
An out-of-bounds read vulnerability exists in the EMF functionality of Canva Affinity. By using a specially crafted EMF file, an attacker could exploit this vulnerability to perform an out-of-bounds read, potentially leading to the disclosure of sensitive information.
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 EMF parser uses the attacker-controlled offBmi field to compute the DIB header address without checking that it falls within the record bounds.
Impact
An attacker could read arbitrary memory within the process, potentially disclosing sensitive information, though the crash suggests availability is also affected.
What the attacker needed
Victim opens a crafted EMF file; local user interaction
The fix
The vendor released a patch; the parser should validate that offBmi and the related sizes stay within the record before accessing the DIB header.
How it was found
- Open a crafted EMF file in Canva Affinity so the EMF loader processes it.
- The loader reads the EMR_CREATEDIBPATTERNBRUSHPT record and takes the offBmi value.
- It adds offBmi to the record pointer to compute the DIB header address.
- It passes that address to the bitmap creation routine, which reads from unallocated memory and crashes.
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, and inside it are records that describe drawing instructions. One record type includes an offset value that tells the program where a small header sits inside the record. The program trusted that offset without checking it stayed inside the record, so a malicious file could make it read memory from somewhere else in the program.
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.