CVE-2013-2132:
Use of NullPointerException Catch to Detect NULL Pointer Dereference in Pymongo
N/A
CVSS Score
Basic Information
CVE ID
GHSA ID
EPSS Score
0.85053%
CWE
Published
5/14/2022
Updated
10/15/2024
KEV Status
No
Technology
Python
Technical Details
CVSS Vector
-
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
pymongo | pip | < 2.5.2 | 2.5.2 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from the C implementation of DBRef decoding in _cbsonmodule.c. The original code in get_value() assumed the '$id' key was always present, directly calling PyDict_DelItemString("$id") and Py_INCREF(id) without checking if 'id' was NULL. The patch adds a NULL check and handles missing '$id' by setting it to Py_None. This matches the CWE-395 description of using exception handling (or lack thereof) to detect NULL dereferences. The Python-side change in bson/init.py (using pop("$id", None)) complements this fix but does not directly cause the crash. The root cause is unambiguously in the C module's handling of missing '$id'.