Local file disclosure and tampering via directory race
Published Nov 29, 2022 · Updated Apr 24, 2025
Insecure temporary-directory creation in Samtools HTSJDK before 3.0.1 allows local users to read or replace files in a shared temp path. IOUtil.createTempDir creates a temporary file, deletes it, and then calls mkdir for the same name, leaving a race in which another user can create and own the directory. Exploitation requires a co-resident user on a shared Unix-like host and can expose or alter files later written there; privilege escalation requires downstream execution from that directory.
Summary
What happened
Insecure temporary-directory creation in Samtools HTSJDK before 3.0.1 allows local users to read or replace files in a shared temp path. IOUtil.createTempDir creates a temporary file, deletes it, and then calls mkdir for the same name, leaving a race in which another user can create and own the directory. Exploitation requires a co-resident user on a shared Unix-like host and can expose or alter files later written there; privilege escalation requires downstream execution from that directory.
The record
- CVE
- CVE-2022-21126
- Published
- Nov 29, 2022
- Updated
- Apr 24, 2025
- Vendor
- Samtools
- Product
- HTSJDK
- Classifications
- CWE-379, CWE-668, T1005, T1574
- Attack vector
- local
- Privileges
- authenticated
Timeline
How it unfolded
- Nov 29, 2022CVE publishedPublication date reported by the CVE source.
- Apr 24, 2025Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=unspecified <3.0.1
What conditions does exploitation require?
What is affected?
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
- Published temporary-directory hijacking race exampleproof of concept · unverified
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo