CVE-2022-21126
Creation of Temporary File in Directory with Insecure Permissions
The package com.github.samtools:htsjdk before 3.0.1 are vulnerable to Creation of Temporary File in Directory with Insecure Permissions due to the createTempDir() function in util/IOUtil.java not checking for the existence of the temporary directory before attempting to create it.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- Low
- Integrity
- Low
- Availability
- Low
Exploit likelihood
What each source reports
CVE List Score used
7.3
Creation of Temporary File in Directory with Insecure Permissions
The package com.github.samtools:htsjdk before 3.0.1 are vulnerable to Creation of Temporary File in Directory with Insecure Permissions due to the createTempDir() function in util/IOUtil.java not checking for the existence of the temporary directory before attempting to create it.
- Record
CVE-2022-21126- CVSS 3.1
- 7.3 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L - Updated
- 2026-11-02
EUVDEUVD-2022-7293
7.3
The package com.github.samtools:htsjdk before 3.0.1 are vulnerable to Creation of Temporary File in Directory with Insecure Permissions due to the createTempDir() function in util/IOUtil.java not checking for the existence of the temporary directory before attempting to create it.
- Record
EUVD-2022-7293- CVSS 3.1
- 7.3 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-96vh-4rfp-c42c
7.8
HTSJDK is vulnerable to exposure of resource(s) to the wrong sphere
The package com.github.samtools:htsjdk before 3.0.1 are vulnerable to Creation of Temporary File in Directory with Insecure Permissions due to the createTempDir() function in util/IOUtil.java not checking for the existence of the temporary directory before attempting to create it.
- Record
GHSA-96vh-4rfp-c42c- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-668
- Updated
- 2026-11-02
NVD
7.3
The package com.github.samtools:htsjdk before 3.0.1 are vulnerable to Creation of Temporary File in Directory with Insecure Permissions due to the createTempDir() function in util/IOUtil.java not checking for the existence of the temporary directory before attempting to create it.
- Record
CVE-2022-21126- CVSS 3.1
- 7.3 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L - CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-668
- Updated
- 2026-11-02
OSV
7.3
Creation of Temporary File in Directory with Insecure Permissions
The package com.github.samtools:htsjdk before 3.0.1 are vulnerable to Creation of Temporary File in Directory with Insecure Permissions due to the createTempDir() function in util/IOUtil.java not checking for the existence of the temporary directory before attempting to create it.
- Record
CVE-2022-21126- CVSS 3.1
- 7.3 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L - Updated
- 2026-11-02
OSVGHSA-96vh-4rfp-c42c
7.8
HTSJDK is vulnerable to exposure of resource(s) to the wrong sphere
The package com.github.samtools:htsjdk before 3.0.1 are vulnerable to Creation of Temporary File in Directory with Insecure Permissions due to the createTempDir() function in util/IOUtil.java not checking for the existence of the temporary directory before attempting to create it.
- Record
GHSA-96vh-4rfp-c42c- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-668
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2022-21126
7.3
The package com.github.samtools:htsjdk before 3.0.1 are vulnerable to Creation of Temporary File in Directory with Insecure Permissions due to the createTempDir() function in util/IOUtil.java not checking for the existence of the temporary directory before attempting to create it.
- Record
UBUNTU-CVE-2022-21126- CVSS 3.1
- 7.3 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L - CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
com.github.samtools:htsjdkMaven |
before 3.0.1 | 3.0.1 |
com.github.samtools:htsjdkMaven |
before 3.0.1, plus listed versions 1.1281.1291.1301.1311.132 Show 45 moreShow less1.1331.1341.1351.1361.1371.1381.1391.1401.1411.1421.1432.0.02.0.12.1.02.1.12.10.02.10.12.11.02.12.02.13.02.13.12.13.22.14.02.14.12.14.22.14.32.15.02.15.12.16.02.16.12.17.02.18.02.18.12.18.22.19.02.2.02.2.12.2.22.2.32.2.42.20.02.20.12.20.22.20.32.21.0 |
3.0.1 |
htsjdkUbuntu:16.04:LTS |
All versions, plus listed versions 2.0.1+dfsg.1-1 |
None known |
htsjdkUbuntu:18.04:LTS |
All versions, plus listed versions 2.8.1+dfsg-12.8.1+dfsg-2 |
None known |
htsjdkUbuntu:20.04:LTS |
All versions, plus listed versions 2.18.2+dfsg-2 |
None known |
htsjdkUbuntu:22.04:LTS |
All versions, plus listed versions 2.23.0+dfsg-22.24.1+dfsg-1 |
None known |
htsjdkUbuntu:24.04:LTS |
All versions, plus listed versions 3.0.5+dfsg-13.0.5+dfsg-24.0.2+dfsg-24.1.0+dfsg-1 |
None known |
htsjdkUbuntu:25.10 |
All versions, plus listed versions 4.1.3+dfsg-2 |
None known |
htsjdkUbuntu:26.10 |
All versions, plus listed versions 4.3.0+dfsg-15.0.0+dfsg-1 |
None known |
htsjdkUbuntu:26.04:LTS |
All versions, plus listed versions 4.1.3+dfsg-24.3.0+dfsg-1 |
None known |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2022-21126 is a high vulnerability (CVSS 7.3) in Samtools Htsjdk, published November 29, 2022. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.75%, the 55th percentile. Fixed in com.github.samtools:htsjdk 3.0.1.
References
security.snyk.io/vuln/SNYK-JAVA-COMGITHUBSAMTOOLS-3149901
github.com/samtools/htsjdk/commit/4a4024a97ee3e87096df6ad9b22c8260bd527772
github.com/samtools/htsjdk/pull/1617
nvd.nist.gov/vuln/detail/CVE-2022-21126
github.com/advisories/GHSA-96vh-4rfp-c42c
github.com/CVEProject/cvelistV5/tree/main/cves/2022/21xxx/CVE-2022-21126.json
github.com/samtools/htsjdk
ubuntu.com/security/CVE-2022-21126
cve.org/CVERecord?id=CVE-2022-21126
Left out here: 20 versions. The JSON record has them.