GHSA-rcx8-48pc-v9q8 mail-internals use-after-free vulnerability in `vec_insert_bytes`
A use-after-free in the mail-internals Rust library allows attackers to execute arbitrary code or cause denial of service via crafted email data.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- None listed
What is GHSA-rcx8-48pc-v9q8?
GHSA-rcx8-48pc-v9q8 is an use after free vulnerability in mail-internals, published on 7 Aug 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
Incorrect reallocation logic in the function vec_insert_bytes causes a use-after-free.
This function does not have to be called directly to trigger the vulnerability because many methods on EncodingWriter call this function internally.
The mail-* suite is unmaintained and the upstream sources have been actively vandalised.
A fixed mail-internals-ng (and mail-headers-ng and mail-core-ng) crate has been published which fixes this, and a dependency on another unsound crate.
Which versions are affected by GHSA-rcx8-48pc-v9q8?
3 open source packages ship an affected version, including mail-internals.
| Package | Affected | Fixed in |
|---|---|---|
mail-internals crates.io | From 0.0.0-0 | None |
mail-internals crates.io | From 0.2.0 to 0.2.3 | None |
mail-internals crates.io | From 0.2.0 to 0.2.3 | None |
How do I fix GHSA-rcx8-48pc-v9q8?
No fix has been published for GHSA-rcx8-48pc-v9q8 yet. Limit exposure of the affected software until one is available.
Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.
Is GHSA-rcx8-48pc-v9q8 being exploited?
There is no known exploitation of GHSA-rcx8-48pc-v9q8 in the wild and no public exploit code.
Sources
Also known as RUSTSEC-2023-0054.