Two 896-Byte Files That Crashed a Java HDF5 Reader: Inside the jhdf Fixes
- Library
- jhdf (io.jhdf:jhdf), by James Mudd
- Affected
- 0.13.0 and earlier
- Patched
- 0.14.0, November 10, 2026
- Credit
- Nathan Cross (CyberBadger)
- A declared size makes the reader ask for 2 GB of memory7.5HighAnyone who can supply a fileGHSA-f54v-9rmh-w427
- A header that points back at itself recurses until the stack runs out7.5HighAnyone who can supply a fileGHSA-3292-p22p-xf84
jhdf, an open-source Java library for reading HDF5 data files, fixed two issues we reported in November. Each one let a file smaller than 1 KB crash the application reading it. Here's how, why a normal try/catch didn't help, and who should update.
jhdf is an open-source Java library for reading and writing HDF5 files, a common format for large scientific and engineering datasets. In November we reported two issues in it to its maintainer, James Mudd. Both are fixed in jhdf 0.14.0, and both advisories are public.
Our research doesn't stop at websites and plugins. Libraries like this one are the building blocks other software is made from, and a flaw in one is inherited by every program that uses it, often without its developers knowing the library is there.
The short version
- Two issues, one result. Each one let a specially made HDF5 file of 896 bytes crash the program reading it.
- No data exposure. Neither issue leaks data or lets anyone run code. They knock the reader over.
- Fixed in jhdf 0.14.0, released November 10, 2026, on GitHub and Maven Central. If your software uses jhdf, update it.
Timeline
We sent both reports through GitHub's private vulnerability reporting early on November 4, each with a proof of concept and a suggested fix. The maintainer confirmed them three days later, merged both fixes within a day of each other and released 0.14.0 with credit in the release notes.
- ReportedNov 4, 1:46 AM
Two private GitHub security advisories, each with a proof of concept and a suggested fix.
Six days from report to release - AcceptedNov 7
The maintainer confirmed both reports and merged the recursion fix the same day.
- Second fix mergedNov 8
File reads are now checked against the size of the file before any memory is set aside.
- FixedNov 10, 12:52 PM
jhdf 0.14.0 released on GitHub, both issues listed as security fixes with credit, and on Maven Central about 20 minutes later. The advisories went public within the same minute as the release.
- Write-upNov 16
This post. CVE IDs haven’t been assigned yet.
Six days from report to release is fast and careful work for an open-source project. The advisories James published describe both issues in full, so here is what was wrong, in plain terms.
- Message count@98
- 3
- Size of the messages@104
- 24 bytes 2,130,706,432 bytes
- Continuation offset@120
- byte 800
- Message count@98
- 3 65,535
- Size of the messages@104
- 24 bytes
- Continuation offset@120
- byte 800 byte 112, its own start
Issue 1: a tiny file that asks for 2 GB
An HDF5 file is built from headers that describe what comes next, including how many bytes the next block takes up. When jhdf opened a file from disk or from a stream, it read that number and set aside that much memory straight away, before reading anything and without checking that the file was even that big.
Changing one 4-byte field in a valid 896-byte file, from 24 to 2,130,706,432, made jhdf ask Java for about 2 GB of memory at once. Java refused with an OutOfMemoryError. We tested with 128 MB, 512 MB and 1 GB of memory available, and it failed every time: the size comes from the file, so more memory only raises the number an attacker writes into it.
- The fix: jhdf now checks every read against the size of the file before setting any memory aside.
- Severity: 7.5High CVSS 3.1, from the advisory.
Issue 2: a header that points back at itself
A header can continue in another part of the file, and jhdf followed each continuation by calling its own reading code again. It kept no record of which parts it had already visited, and the only limit was the header's own count of how many messages it holds, a number the file sets, up to 65,535.
Pointing a continuation back at its own header and raising that count to 65,535 sent jhdf around the same loop until Java ran out of room to track it, a StackOverflowError. We ran it with a smaller thread stack than Java's default. The file allows 65,535 levels, so the default should overflow too, but we didn't test that.
- The fix: jhdf now remembers which continuations it has followed, refuses to follow one twice and caps how long a chain can be.
- Severity: 7.5High CVSS 3.1, from the advisory.
Why a normal try/catch didn't help
Java separates two kinds of failure. An Exception is a problem the program is expected to handle, like a damaged file. An Error means the Java runtime itself ran out of something, memory or stack, and most code doesn't try to handle those.
Code that reads files almost always wraps the work in a block that catches Exceptions and rejects the bad file. jhdf's own error handling did the same. Both of these failures were Errors, so they went straight past every catch block and took down the thread, often the whole program.
According to the maintainer's fix notes, in 0.14.0 both files now fail with jhdf's ordinary HdfException, so the usual safety net catches them and rejects the file like any other damaged one.
How widely jhdf is used
jhdf is a small project, but it sits inside other software. A search of public code on GitHub finds at least 69 repositories that declare or import it, including a distributed SQL query engine and a deep-learning library, each with more than 1,500 stars on GitHub. Others are desktop applications for X-ray analysis, cell biology and neural modelling, and vector-search benchmarking tools. Every one we checked still pins a version from before the fix.
That number is a floor, not an estimate. Private and in-house software doesn't show up in a public search, and Maven Central doesn't publish download counts, so nobody can say how many running systems include jhdf. We're contacting the most exposed projects directly, and we'll name them here once they've had a chance to update.
Who should care
Anything that opens HDF5 files it didn't create itself: upload services, data pipelines, research platforms, tools that process files from customers or partners. For a service like that, one small file could take a worker down, again and again, every time it's retried.
- jhdf 0.13.0 or earlierFixed in 0.14.0, released November 10, 2026, on Maven Central.
- It opens HDF5 files you didn’t createUploads, files from partners or customers, downloads, shared drives.
- It opens them from a path or a streamnew HdfFile(path) or HdfFile.fromInputStream(...), the usual ways.
What to do
- Update to jhdf 0.14.0 or later. It's io.jhdf:jhdf on Maven Central. The current release, 0.15.0 from November 14, includes both fixes.
- Check whether you use it without knowing. jhdf can arrive as a dependency of another library. Run your build tool's dependency report (mvn dependency:tree for Maven, gradle dependencies for Gradle) and look for io.jhdf.
- Keep untrusted files away from your main service. Opening uploaded files in a separate worker, with its own memory limit and automatic restarts, means a bad file costs one worker, not the whole service. That helps with every file format, not just this one.
The common thread
Both issues come down to the same thing: the reader trusted numbers the file gave it. A size was used before it was checked, and a pointer was followed without asking whether it had been followed before. It's a common mistake in software that reads files, and file formats keep producing bugs like these. The fix in both cases was small. Finding it means reading the code the way an attacker would, asking what happens when each number is a lie.
Why we look at code like this
We look for security problems in the software businesses rely on, including the open-source libraries underneath it, report them privately and publish details only once they're fixed. You can see our other credits and disclosures on our security research page.
If your business builds or runs software that handles files from outside, that's exactly what a penetration test puts under pressure.
Keep reading
All articlesHow Two WordPress Blocks Got Around the Members Plugin's Content Restrictions
Members, a content restriction plugin on more than 300,000 WordPress sites, fixed three issues we reported in October. Two let any visitor read members-only posts and comments through standard WordPress blocks. Here's how that happened, who was affected, and what to check on your own site.
Read articleFour Security Fixes in Two Popular WordPress Plugins: Update Loginizer and Members
We reported security issues in Loginizer and Members, two WordPress plugins with more than a million active installs between them. Both vendors have released fixes and credited us by name. If your site uses either one, here's what to update and how to check.
Read articleHow Small Business Websites Get Hacked, and What Actually Prevents It
We looked at how 14 hacked local business websites were set up. An out-of-date WordPress was rarely the common thread. Here are the likelier ways in, and the habits that close them.
Read articleLet's build something great.
On-site assessments are free for new business projects. We'll come to you, evaluate your needs, and provide a clear, no-obligation quote.