CVE-2022-50999 is an integer overflow in libxml2's buffer handling (CVSS 8.6), and Nokogiri users are affected because the gem ships its own compiled libxml2 rather than relying on system libraries. If you're running Nokogiri, you're running a libxml2 version that may differ from your system's—and you're likely unaware of this obligation.
Start by checking your Nokogiri version: bundle list | grep nokogiri or gem list nokogiri. Versions 1.13.5 and later contain the fix. If you're on an earlier version, update immediately: bundle update nokogiri. This isn't just a gem update—you're patching an embedded C library that your Ruby code cannot inspect. Your system's libxml2 scanner won't see it because the vulnerable code lives inside the gem, not on the host OS.
The trigger condition requires processing multi-gigabyte XML documents, which sounds like an edge case—but Nokogiri's streaming modes (SAX parsing, Reader API) process documents incrementally, meaning large files may trigger this without loading entirely into memory. If your application accepts XML uploads, parses API responses, or processes configuration files from untrusted sources, you're in the blast radius regardless of whether you intentionally handle multi-GB files.
The EPSS score of 0.00301 reflects the practical difficulty of exploiting this and the fact that Nokogiri 1.13.5 shipped before public disclosure, closing the direct exposure window. However, the real risk lies in frozen dependency snapshots: every Gemfile.lock pinning an older Nokogiri version is carrying this vulnerability silently. Transitive dependencies compound this—Nokogiri sits in thousands of downstream gems that don't explicitly declare it, meaning your scan results may not reflect what's actually loaded.
The structural problem here is the recurring pattern of embedded libraries creating invisible security obligations. OpenSSL, libcurl, and now Nokogiri all follow this model: the gem version bump may be patching a C library you didn't know you were running, and your scanning tools may not see it. There's no convention in the Ruby ecosystem for surfacing which C library versions live inside a gem. Until that changes, treat every Nokogiri update as a potential libxml2 patch and verify you're on 1.13.5 or later.