Canva Affinity EMF File EMR_POLYGON Count Out-Of-Bounds Read Vulnerability
An out-of-bounds read exists in Canva Affinity's handling of EMF polygon records, where the point count is not checked against the record size. A crafted EMF file could cause the application to read past the buffer, potentially disclosing sensitive 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
The loader trusts the Count field of an EMR_POLYGON record and iterates over that many points without verifying that the declared array fits within recordSize.
Impact
Exploiting this could allow reading of arbitrary memory within the process, potentially disclosing sensitive information; the crash observed is an access violation during the read.
What the attacker needed
Victim opens a crafted EMF file; local user interaction
The fix
The loader should validate that the declared point array fits within recordSize before iterating; the vendor released a patch.
How it was found
- Open a crafted EMF file in Canva Affinity so the EMF loader parses it.
- The loader reads the EMR_POLYGON record and checks that Count is non-zero.
- It takes the address of the aPoints array and starts a loop that runs Count times.
- Because Count is too large for the record, the loop reads past the buffer and eventually faults.
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 drawings. The program reads a number saying how many points a shape has, then reads that many points without checking whether the file actually contains them, so it reads past the end of the data. This can leak whatever happens to sit in memory next to the file data.
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.