DescriptionIn MongoDB libbson 1.7.0, the bson_iter_codewscope function in bson-iter.c miscalculates a bson_utf8_validate length argument, which allows remote attackers to cause a denial of service (heap-based buffer over-read in the bson_utf8_validate function in bson-utf8.c), as demonstrated by bson-to-json.c.
SourceCVE (at NVD; CERT, LWN, oss-sec, fulldisc, bugtraq, EDB, Metasploit, Red Hat, Ubuntu, Gentoo, SUSE bugzilla/CVE, Mageia, GitHub code/issues, web search, more)
NVD severitymedium (attack range: remote)
Debian Bugs874754

Vulnerable and fixed packages

The table below lists information on source packages.

Source PackageReleaseVersionStatus
libbson (PTS)stretch1.4.2-1vulnerable
buster, sid1.9.5-1fixed

The information below is based on the following data on fixed versions.

PackageTypeReleaseFixed VersionUrgencyOriginDebian Bugs


[stretch] - libbson <no-dsa> (Minor issue)
Latest (1.7.0-rc0)
uncovers the issue, which introduces UTF-8 validation during JSON encoding.
Only after that the utf8_len=4294967295 as shown with the POC is passed to
bson_utf8_validate via src/bson/bson-iter.c:2069
Still the underlying issue in bson-iter.c when parsing BSON with a codewscope
type is present in earlier versions.
Upstream issue:
Fixed by:

Search for package or bug name: Reporting problems