# CVE-2022-21126: Creation of Temporary File in Directory with Insecure Permissions

- Severity: High 7.3 (CVSS:3.1, scored by snyk) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.87%, higher than 59% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2022-11-29T16:50:19.233Z
- Modified: 2026-06-17T04:25:34.340Z
- Also known as: GHSA-96vh-4rfp-c42c
- Weaknesses: CWE-668
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: snyk

## Description

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.

(As written by CVE List.)

## Affected

- com.github.samtools:htsjdk: from unspecified before 3.0.1
- com.github.samtools:htsjdk (Maven): before 3.0.1
- samtools htsjdk: before 3.0.1

## Every score

- snyk: 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`
- GitHub: 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`
- NVD: 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`

## References

- <https://github.com/samtools/htsjdk/pull/1617> (exploit, patch, third-party-advisory, web)
- <https://security.snyk.io/vuln/SNYK-JAVA-COMGITHUBSAMTOOLS-3149901> (third-party-advisory, web)
- <https://github.com/samtools/htsjdk/commit/4a4024a97ee3e87096df6ad9b22c8260bd527772> (patch, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2022-21126> (advisory)
- <https://github.com/samtools/htsjdk> (package)

## Sources

- CVE List: [CVE-2022-21126](https://www.cve.org/CVERecord?id=CVE-2022-21126), CVE Terms of Use, modified 2025-04-24
- GitHub Advisory Database: [GHSA-96vh-4rfp-c42c](https://github.com/advisories/GHSA-96vh-4rfp-c42c), CC-BY-4.0, modified 2023-11-08
- NVD: [CVE-2022-21126](https://nvd.nist.gov/vuln/detail/CVE-2022-21126), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-21126 · Whole record: https://cve.day/CVE-2022-21126.json · Rebuilt by cve.day 2026-11-25T22:58:17.114Z
