Skip to content
Memory corruption Advisory Advanced CVE-2022-42885

Open Babel GRO format res uninitialized pointer dereference vulnerability

An uninitialized pointer in Open Babel's GRO format parser can be dereferenced when a crafted file sets the residue ID to zero, leading to a crash and potentially arbitrary code execution.

Claudio Bozzato Follow

Originally disclosed on Cisco Talos

Critical 9.8 View original

A use of uninitialized pointer vulnerability exists in the GRO format res 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

Likely, the code fails to initialize a residue pointer before it can be used when the residue ID from the file matches the initial value of zero.

Impact

An attacker could potentially execute arbitrary code by providing a malicious file, though the crash shows a read access violation that may be exploitable depending on stack layout.

What the attacker needed

Victim opens a malicious GRO file with Open Babel

How it was found

  1. Create a GRO file with a title line, a second line containing a positive integer for the number of atoms, and at least one atom line where the residue ID field (first 5 characters) is set to 0.
  2. Run the obabel converter with the GRO file as input and any output format, e.g., obabel -i gro malicious.gro -o sdf.
  3. The program will attempt to add an atom to an uninitialized residue pointer, causing a 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.

Open Babel is a tool that converts chemical file formats. A bug in how it reads a particular format (GRO) means that a specially crafted file can cause the program to use a pointer (a memory address) that hasn't been set to a valid value. This can crash the program and, in some cases, allow an attacker to 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.