CGAL libcgal multiple code execution vulnerabilities in Nef polygon-parsing code
The Nef polygon parsing code in CGAL reads integer indices from a file and uses them to index into vectors without validating the bounds, causing out-of-bounds reads and type confusion. An attacker could supply a malformed .nef3 file to trigger these vulnerabilities, potentially leading to code execution.
Originally disclosed on Cisco Talos
Multiple code execution vulnerabilities exists in the Nef polygon-parsing functionality of CGAL libcgal CGAL-5.1.1. A specially crafted malformed file can lead to an out-of-bounds read and type confusion, which could lead to code execution.
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 parser reads integer indices from the input file and uses them directly as vector indices without checking that they are within the valid range.
Impact
An attacker could cause an out-of-bounds read and type confusion, potentially leading to code execution.
What the attacker needed
Malicious .nef3 file; victim opens file with vulnerable CGAL
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.
CGAL is a library for geometric calculations. When it reads a file describing a shape, it trusts numbers in the file to pick items from a list. If the number is too big, it reads memory outside the list, which can crash the program or 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.