Open Babel ORCA format nAtoms out-of-bounds write vulnerabilities
Two heap-based buffer overflow vulnerabilities exist in Open Babel's ORCA format parser due to insufficient validation of the nAtoms value. An attacker can supply a malformed file to trigger an out-of-bounds write, potentially leading to arbitrary code execution.
Originally disclosed on Cisco Talos
Multiple out-of-bounds write vulnerabilities exist in the ORCA format nAtoms functionality of Open Babel 3.1.1 and master commit 530dbfa3. A specially-crafted malformed file can lead to arbitrary 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 nAtoms value from the input file is used without proper validation to allocate a buffer and control a loop, leading to integer overflow and missing bounds checks.
Impact
An attacker could achieve arbitrary code execution by supplying a malicious file, though the text notes that exploitability may depend on compiler-specific int size.
What the attacker needed
Victim opens a malicious file with Open Babel
How it was found
- Create a file with 'Geometry Optimization Run' and a 'Number of atoms' line with a crafted nAtoms value.
- Include a 'CARTESIAN COORDINATES (ANGSTROEM)' line followed by coordinate lines.
- Run obabel with the crafted file as input and any output format.
- The program writes out-of-bounds on the heap.
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.
Open Babel is a tool that converts chemical file formats. When it reads a file, it trusts a number in the file that says how many atoms there are. If that number is wrong, the program writes data past the end of a memory buffer, which can crash 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.