Canva Affinity EMF File EMR_EXTSELECTCLIPRGN CountRects Out-Of-Bounds Read Vulnerability
An out-of-bounds read vulnerability exists in Canva Affinity's EMF file processing when the CountRects value in an EMR_EXTSELECTCLIPRGN record is too large relative to the region data size. An attacker could exploit this to read arbitrary memory within the process, potentially disclosing sensitive information.
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 code fails to validate that the CountRects value multiplied by the rectangle size plus the header size does not exceed the provided RgnDataSize, leading to an out-of-bounds read when iterating over RegionData.
What the attacker needed
Victim opens a crafted EMF file; Canva Affinity version 3.0.1.3808
The fix
The vendor released a patch on 2026-03-17; the report does not describe the fix details.
How it was found
- Craft an EMF file with an EMR_EXTSELECTCLIPRGN record where CountRects is excessively large compared to RgnDataSize.
- Open the crafted EMF file in Canva Affinity.
- The application reads CountRects and enters a loop that accesses RegionData beyond the allocated buffer, causing an out-of-bounds read and crash.
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.
This bug is in a program that opens image files. When the file contains a special instruction that says how many rectangles to read, the program trusts that number without checking if the file actually has enough data. By lying about the number, an attacker can make the program read past the end of the file data and look at other memory, which might contain secrets.
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.