Skip to content
Memory corruption Advisory Advanced CVE-2022-46289CVE-2022-46290

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.

Claudio Bozzato Follow

Originally disclosed on Cisco Talos

Critical 9.8 View original

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.

Claudio Bozzato, on Cisco Talos

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

  1. Create a file with 'Geometry Optimization Run' and a 'Number of atoms' line with a crafted nAtoms value.
  2. Include a 'CARTESIAN COORDINATES (ANGSTROEM)' line followed by coordinate lines.
  3. Run obabel with the crafted file as input and any output format.
  4. 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.

More by Claudio Bozzato

View all

185 more disclosed reports, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.