Safe ErrorRegistry APIs can cause undefined behavior
All published versions of `dcrypt-api` before 2.0.0 exposed safe `ErrorRegistry` operations that could trigger undefined behavior when the default `std` feature was enabled. Stored `Box` values were erased to raw pointers and later deallocated as `Box<()>`. The `get_error` operation also performed an unchecked cast to a caller-selected type. Finally, concurrent replacement or clearing could free a value while another thread cloned it. Ordinary safe Rust could therefore cause mismatched deallocation, type confusion, and use-after-free. Crates that re-exported this API are affected transitively. Version 2.0.0 replaces the raw pointers with owned `Box` values behind a mutex, performs checked downcasts, and uses a mutation generation so concurrent stores and clears win safely. There is no reliable workaround while calling the affected registry API. Upgrade to 2.0.0 or later and avoid process-global error state where possible.
- Products
- dcrypt-api
- Affected versions
- Not specified
- Fixed versions
- 2.0.0
- CVEs
- Not specified
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 30 Oct 2026, 08:44 UTC · Revision 1
Source evidence
Safe ErrorRegistry APIs can cause undefined behavior
core-osv · Original sourcePublished 9 Aug 2026, 12:00 UTC
All published versions of `dcrypt-api` before 2.0.0 exposed safe `ErrorRegistry` operations that could trigger undefined behavior when the default `std` feature was enabled. Stored `Box` values were erased to raw pointers and later deallocated as `Box<()>`. The `get_error` operation also performed an unchecked cast to a caller-selected type. Finally, concurrent replacement or clearing could free a value while another thread cloned it. Ordinary safe Rust could therefore cause mismatched deallocation, type confusion, and use-after-free. Crates that re-exported this API are affected transitively. Version 2.0.0 replaces the raw pointers with owned `Box` values behind a mutex, performs checked downcasts, and uses a mutation generation so concurrent stores and clears win safely. There is no reliable workaround while calling the affected registry API. Upgrade to 2.0.0 or later and avoid process-global error state where possible.
osv:RUSTSEC-2026-0242
dcrypt-api
Fixed versions: 2.0.0
Complete source record
{
"id": "c6719ac41605184be012bdd953691df178b2f0b8c032a6d614c505fbe05b4b35",
"url": "https://osv.dev/vulnerability/RUSTSEC-2026-0242",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Safe ErrorRegistry APIs can cause undefined behavior",
"summary": "All published versions of `dcrypt-api` before 2.0.0 exposed safe `ErrorRegistry` operations that could trigger undefined behavior when the default `std` feature was enabled. Stored `Box` values were erased to raw pointers and later deallocated as `Box<()>`. The `get_error` operation also performed an unchecked cast to a caller-selected type. Finally, concurrent replacement or clearing could free a value while another thread cloned it. Ordinary safe Rust could therefore cause mismatched deallocation, type confusion, and use-after-free. Crates that re-exported this API are affected transitively. Version 2.0.0 replaces the raw pointers with owned `Box` values behind a mutex, performs checked downcasts, and uses a mutation generation so concurrent stores and clears win safely. There is no reliable workaround while calling the affected registry API. Upgrade to 2.0.0 or later and avoid process-global error state where possible.",
"evidence": "osv:RUSTSEC-2026-0242",
"products": [
{
"name": {
"value": "dcrypt-api",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "2.0.0",
"evidence": "/affected/0/ranges"
}
],
"affected_versions": []
}
],
"severity": "unknown",
"structured": {
"id": "RUSTSEC-2026-0242",
"aliases": [
"GHSA-7hc7-h3f2-r4j6",
"RUSTSEC-2026-0242"
],
"affected": [
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "0.0.0-0"
},
{
"fixed": "2.0.0"
}
]
}
],
"package": {
"name": "dcrypt-api",
"purl": "pkg:cargo/dcrypt-api",
"ecosystem": "crates.io"
},
"database_specific": {
"cvss": null,
"source": "https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0242.json",
"categories": [
"memory-corruption",
"thread-safety"
],
"informational": null
},
"ecosystem_specific": {
"affects": {
"os": [],
"arch": [],
"functions": []
},
"affected_functions": null
}
}
],
"modified": "2026-10-12T18:00:14.905021984Z",
"provider": "osv",
"references": [
"https://crates.io/crates/dcrypt-api",
"https://rustsec.org/advisories/RUSTSEC-2026-0242.html",
"https://github.com/ioi-foundation/dcrypt/commit/c99cc86f0ee353010cd202cbcd2c310371b0bbb8",
"https://github.com/ioi-foundation/dcrypt/releases/tag/v2.0.0"
],
"provider_metadata": {
"license": "CC0-1.0"
}
},
"related_cves": [],
"security_relevant": true,
"severity_evidence": null
},
"source_id": "core-osv",
"document_id": 306465,
"published_at": "2026-08-09T12:00:00+00:00"
}