CVE-2026-2705: Open Babel MOL2 File atom.h SetFormalCharge out-of-bounds
Summary
A memory-safety vulnerability in Open Babel's MOL2 file format parser caused a NULL pointer dereference when reading a crafted input file.
Details
The flaw was in OBAtom::SetFormalCharge as called from the MOL2 parser. A malformed atom record caused the parser to call the method on a NULL atom pointer.
Impact
Open Babel is a C++ library and CLI used to read and write chemistry file formats; it is shipped by Linux distributions and embedded in services that may parse untrusted input. Triggering this vulnerability requires the victim to open a malicious MOL2 file with the obabel tool, the OBConversion API, or any of the language bindings (Python, Ruby, Java, R, Perl, C#, PHP).
Affected versions
All releases up to and including 3.1.1.
Patched version
3.2.0 (released 2026-05-26).
Patch
Fix commit: https://github.com/openbabel/openbabel/commit/e23a224b Tracked in #2862.
A minimized reproducer for this CVE is checked in under test/files/fuzzregress/ and is exercised on every CI build under ASAN+UBSAN by the fuzzregresstest harness.
Credit
Reported by Vedant Madane (@VedantMadane) via VulDB.
Other sources
A vulnerability was detected in Open Babel up to 3.1.1. The impacted element is the function OBAtom::SetFormalCharge in the library include/openbabel/atom.h of the component MOL2 File Handler. The manipulation results in out-of-bounds read. It is possible to launch the attack remotely. The exploit is now public and may be used. The patch is identified as e23a224b8fd9d7c2a7cde9ef4ec6afb4c05aa08a. A patch should be applied to remediate this issue. The project was informed of the problem early through an issue report but has not responded yet.
— NVD
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
pip/openbabelto a version that resolves this vulnerability.Fixed in 3.2.0 - Upgrade
Upgrade
debian/openbabelto a version that resolves this vulnerability.Fixed in 3.2.0+dfsg-1 - Upgrade
Upgrade
debian/openbabelto a version that resolves this vulnerability.Fixed in 3.2.0+dfsg-2 - Upgrade
Upgrade
Open Babelto a version that resolves this vulnerability.Fixed in 3.2.0Patch e23a224b8fd9d7c2a7cde9ef4ec6afb4c05aa08a - Compensating control
Ensure systems using Open Babel (obabel CLI / OBConversion API / language bindings) do not parse untrusted MOL2 input; require only trusted MOL2 files before they are processed, since the attack can be launched remotely by opening a malicious MOL2 file.
Event History
Frequently Asked Questions
What is the severity of CVE-2026-2705?
CVE-2026-2705 is considered a high-severity vulnerability due to its potential to cause out-of-bounds read conditions.
How do I fix CVE-2026-2705?
To fix CVE-2026-2705, upgrade Open Babel to version 3.1.2 or later.
What types of software are affected by CVE-2026-2705?
CVE-2026-2705 affects Open Babel software versions up to and including 3.1.1.
Can CVE-2026-2705 lead to data breaches?
Yes, CVE-2026-2705 can potentially lead to data breaches due to unauthorized access to sensitive information through out-of-bounds reads.
Is CVE-2026-2705 specific to any file types?
CVE-2026-2705 specifically impacts the MOL2 file handler within Open Babel.