In the Learning OSV series I learned how to read a record, run the scanner and let it fix a project. This post is different. I didn’t read one record; I looked at OSV’s data as a whole, asked the API a few pointed questions, and wrote down what surprised me. All numbers are from 4 December 2026.
Keywords#
| Keyword | Meaning here |
|---|---|
| OSV | Open Source Vulnerabilities: a JSON format for advisories and the database at osv.dev that collects them |
| Record | One advisory in OSV format, with an ID such as GHSA-jfh8-c2jp-5v3q |
| Ecosystem | Where a package comes from: npm, PyPI, Maven, or a Linux release such as Debian:11 |
MAL- record | A report of a malicious package: code published to attack whoever installs it, not a mistake |
| Backport | Copying a security fix into an older version instead of moving to the newest one |
| Alias / upstream | OSV fields that link records about the same bug, or a distribution’s record to the original |
How I looked#
OSV publishes everything it has. Per the data page, each ecosystem has
a modified_id.csv that lists every record ID with its last-modified time. That is small enough to download and
count:
curl -s https://osv-vulnerabilities.storage.googleapis.com/npm/modified_id.csv \
| cut -d, -f2 | cut -d- -f1 | sort | uniq -c | sort -rnThe rest came from two API calls: GET /v1/vulns/<id> for one
record and POST /v1/query for “what affects this package (and version)?”.
Learning 1: most of osv.dev is malware, not bugs#
What I found. I counted record prefixes for five ecosystems:
| Ecosystem | Records | MAL- (malicious) | Advisories about bugs |
|---|---|---|---|
| npm | 233,654 | 225,390 (96.5%) | 8,262 GHSA |
| PyPI | 27,168 | 12,151 (44.7%) | 8,025 PYSEC, 6,980 GHSA |
| Go | 10,102 | 21 | 5,176 GHSA, 4,904 GO |
| crates.io | 3,254 | 26 | 1,650 GHSA, 1,578 RUSTSEC |
| Maven | 7,277 | 2 | 7,275 GHSA |
For npm, more than 24 of every 25 records aren’t about a bug in a real library at all. They’re about packages that
were built to do harm. The MAL- records come from the OpenSSF
malicious packages project, which counts a package as malicious when
it would “require some sort of incident response” if installed, for example by stealing data. Typosquats and spam
only count if they also behave maliciously.
The year in the ID shows how fast this grew. npm has 8,369 MAL-2024 records and 191,417 MAL-2025. The few
2025 records I opened were each a single package with a random-looking name (“Malicious code in … (npm)”), many
credited to an automated scanner in the record’s source data. OSV’s numbers alone don’t tell me why that year
jumped, so I won’t guess.
Why it matters. I had been thinking of risk as “an old version of a good library”. The bigger list is “a bad
package I should never have installed”. That risk sits at the moment of npm install, not months later when a CVE
is published, and the fix isn’t an upgrade, it’s removal (and rotating anything the package could have read).
What I do now. Ask before adding an unfamiliar package. A query with a name and no version returns everything OSV knows about it:
curl -s -X POST https://api.osv.dev/v1/query \
-d '{"package":{"name":"lotusbail","ecosystem":"npm"}}'
# MAL-2025-192748 Malicious code in lotusbail (npm)OSV-Scanner asks the same database about every package in a lockfile, so a MAL- package shows up there too: one more reason to run it on every pull
request (I set that up in part 4).
Learning 2: “fixed” depends on who ships the package#
What I found. Log4Shell (CVE-2021-44228) is the famous Java logging bug. Apache’s security page lists the fixed releases as “2.3.1 (for Java 6), 2.12.2 (for Java 7), and 2.15.0 (for Java 8 and later)”. So far, one answer per Java line. Then I asked OSV what Linux distributions say:
| Who ships it | Fixed version for Log4Shell |
|---|---|
| Apache, via Maven | 2.15.0 (or 2.12.2, 2.3.1) |
| Debian 11 | 2.15.0-1~deb11u1 |
| Ubuntu 20.04 | 2.15.0-0.20.04.1 |
| Ubuntu 18.04 | 2.10.0-2ubuntu0.1 |
| Ubuntu 16.04 (Pro) | 2.4-2ubuntu0.1~esm1 |
Ubuntu 18.04’s fixed package is version 2.10, below every upstream fix. It isn’t a mistake. Distributions keep the version they shipped and copy the fix into it. Debian’s security FAQ explains why: “we backport security fixes to the version that was shipped in the stable release”, so that “things will not change or break unexpectedly”.
The API shows the consequence. Three packages that all say “2.10.0” get different answers:
q() { curl -s -X POST https://api.osv.dev/v1/query -d "$1" | grep -q -e GHSA-jfh8-c2jp-5v3q -e CVE-2021-44228 && echo "Log4Shell: affected" || echo "Log4Shell: not affected"; }
q '{"package":{"name":"org.apache.logging.log4j:log4j-core","ecosystem":"Maven"},"version":"2.10.0"}'
# Log4Shell: affected
q '{"package":{"name":"apache-log4j2","ecosystem":"Ubuntu:18.04:LTS"},"version":"2.10.0-2"}'
# Log4Shell: affected
q '{"package":{"name":"apache-log4j2","ecosystem":"Ubuntu:18.04:LTS"},"version":"2.10.0-2ubuntu0.1"}'
# Log4Shell: not affected (the backported fix is in)Why it matters. A tool, or a person, that reads “2.10” and compares it with “fixed in 2.15.0” calls the patched Ubuntu package vulnerable. The reverse mistake is worse: assuming a distribution package is fine because an upstream-style check said so. The version number only means something together with the ecosystem.
What I do now. When a scanner flags an operating-system package, I check the finding’s ecosystem first
(Ubuntu:18.04:LTS, not “log4j”) and compare with that distribution’s own fixed version. And I don’t hand-compare
distribution versions with upstream ones at all.
Learning 3: one bug can be seventeen records#
What I found. OSV doesn’t merge advisories into one; it keeps each source’s record and links them. For Log4Shell, following the links from the CVE record and the distribution records above:
| Record | From |
|---|---|
CVE-2021-44228 | the CVE itself |
GHSA-jfh8-c2jp-5v3q | GitHub, an alias of the CVE |
DEBIAN-CVE-2021-44228, DSA-5020-1 | Debian, pointing upstream to the CVE |
UBUNTU-CVE-2021-44228 | Ubuntu, pointing upstream to the CVE |
12 SUSE-SU-… / openSUSE-SU-… notices | listed as related on the CVE record |
That’s 17 records for one bug, and those are only the ones I reached by following links. Even the single GitHub record lists ten affected entries across several Maven package names, including other projects that bundle their own copy of log4j.
The OSV schema explains the three kinds of link:
- aliases: “the same vulnerability in other databases” (GHSA and CVE here)
- upstream: a downstream ecosystem “such as a Linux distribution” referring to the original (Debian, Ubuntu)
- related: “closely related” records that don’t fit the stricter two
Why it matters. A report that says “17 vulnerabilities” may mean one bug seen through 17 windows. In part 2 I took the scanner’s count at face value. Counting records overstates the work; counting bugs tells you how many things to actually fix.
What I do now. I group findings by alias before counting or creating tickets, so one bug is one ticket, with every place it appears listed under it.
What surprised me most#
All three learnings have the same root. I treated a vulnerability database as a list of facts about code. It’s really a list of facts about packages as somebody ships them: who published it, which build of it, and which advisory describes it. Once I saw that, the malware, the backports and the duplicate records all made sense.
Takeaways#
- For npm, 96.5% of OSV records are malicious packages, not bugs. Check a package before you install it, not only after a CVE.
- A fixed version only means something with its ecosystem: Ubuntu’s patched Log4j is version 2.10.
- One bug can be many records. Group by aliases and upstream before counting or opening tickets.
- OSV’s raw data is public and small enough to count yourself. A five-line script answered questions no dashboard did.
References#
- OSV data dumps: OSV.dev, the public bucket,
modified_id.csvand the list of sources - OSV API: query: OSV.dev, the request format used above
- OSV schema: OpenSSF, the
aliases,upstreamandrelatedfields - OpenSSF malicious packages: OpenSSF, what counts as a malicious package
- Log4j security vulnerabilities: Apache Logging Services, the fixed releases for CVE-2021-44228
- Debian security FAQ: Debian, why security fixes are backported to the released version
- Records read through the OSV API on 4 December 2026:
CVE-2021-44228,GHSA-jfh8-c2jp-5v3q,DEBIAN-CVE-2021-44228,DSA-5020-1,UBUNTU-CVE-2021-44228,MAL-2025-192748
Related on this site: the Learning OSV series and scanning my own blog.



