{"id":"GHSA-rcx8-48pc-v9q8","aliases":["RUSTSEC-2023-0054"],"status":"published","title":"mail-internals use-after-free vulnerability in `vec_insert_bytes`","description":"Incorrect reallocation logic in the function [`vec_insert_bytes`](https://docs.rs/mail-internals/0.2.3/mail_internals/utils/fn.vec_insert_bytes.html) causes a use-after-free.\n\nThis function does not have to be called directly to trigger the vulnerability because many methods on [`EncodingWriter`](https://docs.rs/mail-internals/0.2.3/mail_internals/encoder/struct.EncodingWriter.html) call this function internally.\n\nThe mail-\\* suite is unmaintained and the upstream sources have been actively vandalised.\nA 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.","facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":false},"published":"2023-08-07T12:00:00Z","modified":"2023-11-08T04:22:42Z","affected":[{"source":"ghsa","ecosystem":"crates.io","package":"mail-internals","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0.2.0"},{"last_affected":"0.2.3"}]}]},{"source":"osv","ecosystem":"crates.io","package":"mail-internals","ranges":[{"type":"SEMVER","events":[{"introduced":"0.2.0"},{"last_affected":"0.2.3"}]}]},{"source":"osv","ecosystem":"crates.io","package":"mail-internals","ranges":[{"type":"SEMVER","events":[{"introduced":"0.0.0-0"}]}]}],"references":[{"url":"https://github.com/rustsec/advisory-db/blob/main/crates/mail-internals/RUSTSEC-2023-0054.md","tags":["web"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2023-0054.html","tags":["web","advisory"]},{"url":"https://github.com/advisories/GHSA-rcx8-48pc-v9q8"},{"url":"https://crates.io/crates/mail-internals","tags":["package"]},{"url":"https://git.sr.ht/~nabijaczleweli/mail-internals.crate/commit/05443c864b204e7f1512caf2d53e8cce4dd340fc","tags":["web"]}],"sources":{"ghsa":[{"id":"GHSA-rcx8-48pc-v9q8","title":"mail-internals use-after-free vulnerability in `vec_insert_bytes`","description":"Incorrect reallocation logic in the function [`vec_insert_bytes`](https://docs.rs/mail-internals/0.2.3/mail_internals/utils/fn.vec_insert_bytes.html) causes a use-after-free.\n\nThis function does not have to be called directly to trigger the vulnerability because many methods on [`EncodingWriter`](https://docs.rs/mail-internals/0.2.3/mail_internals/encoder/struct.EncodingWriter.html) call this function internally.\n\nThe mail-\\* suite is unmaintained and the upstream sources have been actively vandalised.\nA 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.\n","status":"published","published":"2023-08-24T22:20:47Z","modified":"2023-08-24T22:20:48Z","updated_at":"2026-11-02T14:37:00.680009Z"}],"osv":[{"id":"GHSA-rcx8-48pc-v9q8","title":"mail-internals use-after-free vulnerability in `vec_insert_bytes`","description":"Incorrect reallocation logic in the function [`vec_insert_bytes`](https://docs.rs/mail-internals/0.2.3/mail_internals/utils/fn.vec_insert_bytes.html) causes a use-after-free.\n\nThis function does not have to be called directly to trigger the vulnerability because many methods on [`EncodingWriter`](https://docs.rs/mail-internals/0.2.3/mail_internals/encoder/struct.EncodingWriter.html) call this function internally.\n\nThe mail-\\* suite is unmaintained and the upstream sources have been actively vandalised.\nA 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.\n","status":"published","published":"2023-08-24T22:20:47Z","modified":"2023-11-08T04:22:42.48718Z","updated_at":"2026-11-02T15:46:55.877614Z"},{"id":"RUSTSEC-2023-0054","title":"Use-after-free in `vec_insert_bytes`","description":"Incorrect reallocation logic in the function [`vec_insert_bytes`](https://docs.rs/mail-internals/0.2.3/mail_internals/utils/fn.vec_insert_bytes.html) causes a use-after-free.\n\nThis function does not have to be called directly to trigger the vulnerability because many methods on [`EncodingWriter`](https://docs.rs/mail-internals/0.2.3/mail_internals/encoder/struct.EncodingWriter.html) call this function internally.\n\nThe mail-\\* suite is unmaintained and the upstream sources have been actively vandalised.\nA 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.","status":"published","published":"2023-08-07T12:00:00Z","modified":"2023-11-08T04:22:42.48718Z","updated_at":"2026-11-02T15:53:39.971022Z"}]}}
