# CVE-2020-12135: bson before 0.8 incorrectly uses int rather than sizet for many variables, parameters, and return values.

- Severity: Medium 5.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.17%, higher than 68% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2020-04-24T00:31:51.000Z
- Modified: 2026-06-17T02:51:28.083Z
- Weaknesses: CWE-190
- Assigned by: mitre

## Description

bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. In particular, the bson_ensure_space() parameter bytesNeeded could have an integer overflow via properly constructed bson input.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- whoopsie_project whoopsie: up to 0.2.69
- mongodb c_driver: before 0.8

## Every score

- NVD: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H`
- NVD: CVSS:2.0 4.3 Medium `AV:N/AC:M/Au:N/C:N/I:N/A:P`

## References

- <https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560> (exploit, third-party-advisory)
- <https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch> (patch, third-party-advisory)
- <https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577> (patch, third-party-advisory)
- <https://usn.ubuntu.com/4450-1/> (vendor-advisory)

## Sources

- CVE List: [CVE-2020-12135](https://www.cve.org/CVERecord?id=CVE-2020-12135), CVE Terms of Use, modified 2024-08-04
- NVD: [CVE-2020-12135](https://nvd.nist.gov/vuln/detail/CVE-2020-12135), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2020-12135 · Whole record: https://cve.day/CVE-2020-12135.json · Rebuilt by cve.day 2026-11-25T22:57:52.174Z
