↓ Skip to main content
Security

Three things osv.dev taught me

I thought of osv.dev as a big list of bugs: look up your package and version, get a yes or no. Then I downloaded its raw data and counted. The list turned out to be mostly something else, the word “fixed” turned out to depend on who you ask, and one famous bug turned out to be many records.
Three cards. One: npm in OSV, 233,654 records, of which 225,390 (96.5%) are MAL- malicious packages and 8,262 GHSA advisories. Two: Log4Shell’s fixed version by who ships it, Maven 2.15.0 (and 2.12.2, 2.3.1 for older Java), Debian 11 2.15.0-1~deb11u1, Ubuntu 18.04 2.10.0-2ubuntu0.1. Three: one bug, at least 17 records, the CVE record linked to a GHSA alias, Debian and Ubuntu records and 12 SUSE and openSUSE notices.
What the raw data showed me

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
#

KeywordMeaning here
OSVOpen Source Vulnerabilities: a JSON format for advisories and the database at osv.dev that collects them
RecordOne advisory in OSV format, with an ID such as GHSA-jfh8-c2jp-5v3q
EcosystemWhere a package comes from: npm, PyPI, Maven, or a Linux release such as Debian:11
MAL- recordA report of a malicious package: code published to attack whoever installs it, not a mistake
BackportCopying a security fix into an older version instead of moving to the newest one
Alias / upstreamOSV 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 -rn

The 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:

EcosystemRecordsMAL- (malicious)Advisories about bugs
npm233,654225,390 (96.5%)8,262 GHSA
PyPI27,16812,151 (44.7%)8,025 PYSEC, 6,980 GHSA
Go10,102215,176 GHSA, 4,904 GO
crates.io3,254261,650 GHSA, 1,578 RUSTSEC
Maven7,27727,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 itFixed version for Log4Shell
Apache, via Maven2.15.0 (or 2.12.2, 2.3.1)
Debian 112.15.0-1~deb11u1
Ubuntu 20.042.15.0-0.20.04.1
Ubuntu 18.042.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:

RecordFrom
CVE-2021-44228the CVE itself
GHSA-jfh8-c2jp-5v3qGitHub, an alias of the CVE
DEBIAN-CVE-2021-44228, DSA-5020-1Debian, pointing upstream to the CVE
UBUNTU-CVE-2021-44228Ubuntu, pointing upstream to the CVE
12 SUSE-SU-… / openSUSE-SU-… noticeslisted 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.csv and the list of sources
  • OSV API: query: OSV.dev, the request format used above
  • OSV schema: OpenSSF, the aliases, upstream and related fields
  • 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.

Author
Samarthya
Engineer, learner, tinkerer. This is my trophy shelf of everyday work and leisure.

Related

Learning OSV, part 5: I scanned my own blog, and the real problem wasn't in the report

A test project is a controlled experiment; your own repository is the one that talks back. I pointed OSV-Scanner at the source of this blog expecting a dull report. The report was indeed dull. The interesting part was what it could not see. The mood of the evening. It lasted until the first command. In parts 2 and 3 I used a project built to be vulnerable. This time the target is the repository behind this site: Hugo, the Blowfish theme as a git submodule, some Python helper scripts and two GitHub Actions workflows. All runs used OSV-Scanner v2.7.0.

Learning OSV, part 4: where it fits, and my recommendation

·4 mins
Three parts of trying things. This one is the verdict: what I would actually switch on, in what order, and what I would still look elsewhere for. The loop I would run, and the verdict as a checklist. Quick recap of the proof of concept: part 1 read the database, part 2 scanned a project (5 dependencies, 68 packages, 49 vulnerabilities), and part 3 fixed it (7 of 50 safely, 50 of 50 with a major upgrade).

Learning OSV, part 3: guided remediation with osv-scanner fix

·3 mins
Finding 49 vulnerabilities is easy. Deciding which three lines to change so that most of them go away is the hard part. That is what osv-scanner fix tries to do. in-place is the safe small win; relax fixes everything but chose a major upgrade. In part 2 the scanner found 49 known vulnerabilities in a small Node project. This part tries the guided remediation command on it.