GHSA-rcx8-48pc-v9q8: Mail internals Mail-internals Use-after-free Vulnerability Vulnerability

MODERATE
Published
Advisory Summary

GHSA-rcx8-48pc-v9q8 is a MODERATE mail-internals use-after-free vulnerability vulnerability (General Security Weakness) affecting Mail internals libraries in the crates.io ecosystem. The issue involves mail-internals use-after-free vulnerability in `vec_insert_bytes`. Remediation is available in the latest vendor maintenance releases.

GHSA-rcx8-48pc-v9q8 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-rcx8-48pc-v9q8
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Mail internals
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-rcx8-48pc-v9q8

To remediate this vulnerability, upgrade all affected Mail internals dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

mail-internals fixed: Latest secure release
Upgrade mail-internals to Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for mail-internals

How to Check if You Are Affected

To determine whether your application is affected by GHSA-rcx8-48pc-v9q8, inspect your project dependencies for Mail internals:

inspect dependencies for mail-internals

Analyze the terminal output to locate any version of Mail internals in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under General Security Weakness. In Mail internals, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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. This 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. 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.

GHSA-rcx8-48pc-v9q8 Affected Mail internals Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
mail-internals
crates.io
≥ 0.2.0
≤ 0.2.3

References

Frequently Asked Questions

What is GHSA-rcx8-48pc-v9q8?
GHSA-rcx8-48pc-v9q8 is a security vulnerability in Mail internals involving mail-internals use-after-free vulnerability in `vec_insert_bytes` under General Security Weakness.
Which Mail internals versions are affected?
Affected versions include releases prior to current release patches across affected packages: mail-internals.
What version fixes GHSA-rcx8-48pc-v9q8?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is mail-internals affected?
Yes, mail-internals is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with GHSA-rcx8-48pc-v9q8?
GHSA-rcx8-48pc-v9q8 is classified under General Security Weakness.
How can I check crates.io dependencies for GHSA-rcx8-48pc-v9q8?
Run the dependency tree command: 'inspect dependencies for mail-internals'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-rcx8-48pc-v9q8",
  "modified" : "2023-08-24T22:20:47Z",
  "published" : "2023-08-24T22:20:47Z",
  "aliases" : [ ],
  "summary" : "mail-internals use-after-free vulnerability in `vec_insert_bytes`",
  "details" : "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",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "mail-internals"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.2.0"
      }, {
        "last_affected" : "0.2.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/rustsec/advisory-db/blob/main/crates/mail-internals/RUSTSEC-2023-0054.md"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2023-0054.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-08-24T22:20:47Z",
    "nvd_published_at" : null
  }
}