Rust advisories / const-cstr
UnsoundRUSTSEC-2023-0020 · const-cstr
RUSTSEC-2023-0020: const-cstr is Unmaintained
Short answerconst-cstr has an API that can cause undefined behaviour from safe code: const-cstr is Unmaintained. No fixed version yet.
| Crate | const-cstr |
|---|---|
| Type | Unsound |
| Affected versions | Every version. |
| Fixed in | none |
| Severity | not scored |
| Published | 2023-03-12 |
| Last changed | 2023-03-12 |
| Also known as | none |
What to do
- Find who pulls it in:
cargo tree -i const-cstr. - Avoid the affected API, or replace the crate.
Details from the advisory
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 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)
References
- Package: crates.io/crates/const-cstr
- Advisory: rustsec.org/advisories/RUSTSEC-2023-0020.html
- Web: github.com/abonander/const-cstr
From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.
Up next
Are you affected?Check your whole dependency treePaste Cargo.lock: every advisory, for your exact versions.Read it next →Also worth your time
Did this answer your question?