# RUSTSEC-2023-0020: const-cstr is Unmaintained

- Severity: not scored yet
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2023-03-12T12:00:00.000Z
- Modified: 2023-03-12T18:38:56.000Z

## Description

Last release was about five years ago.

The maintainer(s) have been unreachable to respond to any issues that may or may not include security issues.

The repository is now archived and there is no security policy in place to contact the maintainer(s) otherwise.

No direct fork exist.

# const-cstr is Unsound

The crate violates the safety contract of [ffi::CStr::from_bytes_with_nul_unchecked](https://doc.rust-lang.org/std/ffi/struct.CStr.html#method.from_bytes_with_nul_unchecked) used in `ConstCStr::as_cstr`

No interior nul bytes checking is done either by the constructor or the canonical macro to create the `ConstCStr`

# const-cstr Panic

Additionally the crate may cause runtime panics if statically compiled and ran with any untrusted data that is not nul-terminated.

This is however unlikely but the the crate should not be used for untrusted data in context where panic may create a DoS vector.

## Possible Alternatives

The below may or may not provide alternative(s)

- [const_str::cstr!](https://docs.rs/const-str/latest/const_str/macro.cstr.html)
- [cstr::cstr!](https://crates.io/crates/cstr)

(As written by RustSec Advisory Database.)

## Affected

- const-cstr (crates.io): from 0.0.0-0

## References

- <https://crates.io/crates/const-cstr> (package)
- <https://rustsec.org/advisories/RUSTSEC-2023-0020.html> (advisory)
- <https://github.com/abonander/const-cstr> (web)

## Sources

- RustSec Advisory Database: [RUSTSEC-2023-0020](https://rustsec.org/advisories/RUSTSEC-2023-0020.html), CC0-1.0, modified 2023-03-12

---

Page: https://cve.day/RUSTSEC-2023-0020 · Whole record: https://cve.day/RUSTSEC-2023-0020.json · Rebuilt by cve.day 2026-11-25T22:56:43.142Z
