CVE-2024-39697: Phonenumber Panic On Parsing Crafted Phonenumber Vulnerability

CRITICAL
Advisory Identifier: GHSA-mjw4-jj88-v687
CVSS 8.6
CWE-392 CWE-1284 CWE-248
Published
Advisory Summary

CVE-2024-39697 is a CRITICAL (CVSS 8.6) panic on parsing crafted phonenumber vulnerability (CWE-392: Missing Report of Error Condition) affecting Phonenumber libraries in the crates.io ecosystem. The issue involves panic on parsing crafted phonenumber inputs. Remediation is available by upgrading affected packages to version 0.3.6.

CVE-2024-39697 at a Glance

CVE Identifier CVE-2024-39697
GHSA Identifier GHSA-mjw4-jj88-v687
Severity CRITICAL
CVSS v3.1 Base Score 8.6
CWE Classification CWE-392: Missing Report of Error Condition
Affected Product Phonenumber
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 8.6

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2024-39697

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

phonenumber fixed: 0.3.6
Upgrade phonenumber to 0.3.6
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 phonenumber

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-39697, inspect your project dependencies for Phonenumber:

inspect dependencies for phonenumber

Analyze the terminal output to locate any version of Phonenumber in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.3.6), 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 CWE-392: Missing Report of Error Condition, where the product encounters an error but does not provide a status code or return value to indicate that an error has occurred. In Phonenumber, 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

### Impact The phonenumber parsing code may panic due to a reachable `assert!` guard on the phonenumber string. In a typical deployment of rust-phonenumber, this may get triggered by feeding a maliciously crafted phonenumber, e.g. over the network, specifically strings of the form `+dwPAA;phone-context=AA`, where the "number" part potentially parses as a number larger than 2^56. Since f69abee1/0.3.4/#52. 0.2.x series is not affected. ### Patches Upgrade to 0.3.6 or higher. ### Workarounds n/a ### References Whereas https://github.com/whisperfish/rust-phonenumber/issues/69 did not provide an example code path, property testing found a few: `+dwPAA;phone-context=AA`.

CVE-2024-39697 Affected Phonenumber Versions

1 component(s)
Fixed Versions:
0.3.6
Product / Package Ecosystem Affected Versions Fixed Version
phonenumber
crates.io
≥ 0.3.4
< 0.3.6
0.3.6

References

Frequently Asked Questions

What is CVE-2024-39697?
CVE-2024-39697 is a security vulnerability in Phonenumber involving panic on parsing crafted phonenumber inputs under CWE-392: Missing Report of Error Condition.
Which Phonenumber versions are affected?
Affected versions include releases prior to 0.3.6 across affected packages: phonenumber.
What version fixes CVE-2024-39697?
Upgrading to 0.3.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is phonenumber affected?
Yes, phonenumber is affected in releases prior to 0.3.6. Upgrade your dependency to 0.3.6 or later.
What is the CVSS score of CVE-2024-39697?
CVE-2024-39697 has a CVSS v3.1 base score of 8.6 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:N/A:H.
What CWE is associated with CVE-2024-39697?
CVE-2024-39697 is classified under CWE-392: Missing Report of Error Condition (The product encounters an error but does not provide a status code or return value to indicate that an error has occurred.).
How can I check crates.io dependencies for CVE-2024-39697?
Run the dependency tree command: 'inspect dependencies for phonenumber'. 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-mjw4-jj88-v687",
  "modified" : "2024-11-18T16:26:50Z",
  "published" : "2024-07-09T14:13:48Z",
  "aliases" : [ "CVE-2024-39697" ],
  "summary" : "panic on parsing crafted phonenumber inputs",
  "details" : "### Impact\nThe phonenumber parsing code may panic due to a reachable `assert!` guard on the phonenumber string.\n\nIn a typical deployment of rust-phonenumber, this may get triggered by feeding a maliciously crafted phonenumber, e.g. over the network, specifically strings of the form `+dwPAA;phone-context=AA`, where the \"number\" part potentially parses as a number larger than 2^56.\n\nSince f69abee1/0.3.4/#52.\n\n0.2.x series is not affected.\n\n### Patches\nUpgrade to 0.3.6 or higher.\n\n### Workarounds\nn/a\n\n### References\nWhereas https://github.com/whisperfish/rust-phonenumber/issues/69 did not provide an example code path, property testing found a few: `+dwPAA;phone-context=AA`.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:N/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "phonenumber"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.3.4"
      }, {
        "fixed" : "0.3.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/whisperfish/rust-phonenumber/security/advisories/GHSA-mjw4-jj88-v687"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-39697"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/whisperfish/rust-phonenumber/issues/69"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/whisperfish/rust-phonenumber/pull/52"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/whisperfish/rust-phonenumber/commit/b792151b17fc90231c232a23935830c2266f3203"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/whisperfish/rust-phonenumber/commit/f69abee1481fac0d6d531407bae90020e39c6407"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/whisperfish/rust-phonenumber"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2024-0369.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1284", "CWE-248", "CWE-392" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-07-09T14:13:48Z",
    "nvd_published_at" : "2024-07-09T15:15:11Z"
  }
}