CVE-2024-53857: Pgp Remote Code Execution Vulnerability
HIGHCVE-2024-53857 is a HIGH (CVSS 7.5) remote code execution vulnerability (CWE-770: Allocation of Resources Without Limits or Throttling) affecting Pgp libraries in the crates.io ecosystem. The issue involves rpgp potential resource exhaustion when handling untrusted messages. Remediation is available by upgrading affected packages to version 0.14.2.
CVE-2024-53857 at a Glance
Security Impact
CVSS: 7.5
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:U/C:N/I:N/A:H).
How to Fix CVE-2024-53857
To remediate this vulnerability, upgrade all affected Pgp dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade pgp to 0.14.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for pgp
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-53857, inspect your project dependencies for Pgp:
inspect dependencies for pgp
Analyze the terminal output to locate any version of Pgp in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.14.2), 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-770: Allocation of Resources Without Limits or Throttling, where the product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated. In Pgp, 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
CVE-2024-53857 Affected Pgp Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
pgp
|
crates.io |
< 0.14.2
|
0.14.2
|
References
Frequently Asked Questions
What is CVE-2024-53857?
Which Pgp versions are affected?
What version fixes CVE-2024-53857?
Is pgp affected?
What is the CVSS score of CVE-2024-53857?
What CWE is associated with CVE-2024-53857?
How can I check crates.io dependencies for CVE-2024-53857?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4grw-m28r-q285",
"modified" : "2024-12-05T19:05:49Z",
"published" : "2024-12-05T17:31:35Z",
"aliases" : [ "CVE-2024-53857" ],
"summary" : "rPGP Potential Resource Exhaustion when handling Untrusted Messages",
"details" : "During a security audit, [Radically Open Security](https://www.radicallyopensecurity.com/) discovered two vulnerabilities which allow attackers to trigger resource exhaustion vulnerabilities in `rpgp` by providing crafted messages. This affects general message parsing and decryption with symmetric keys.\n\n### Impact\nAffected `rpgp` versions do not correctly set upper limits on the total reserved amount of memory when parsing long sequences of partial OpenPGP packets, which can grow to to several GiB in size. Additionally, up to 4GiB of memory is reserved for OpenPGP packets of fixed size with large length fields, even if less data is received. \nDepending on existing message size restrictions and available system resources, this can cause out-of-memory conditions and crash the `rpgp` process or cause other system instability through memory resource exhaustion when parsing crafted messages.\n\nAffected `rpgp` versions are susceptible to excessive memory allocation with values of up to 2TiB or long processing times for some decryption operations which involve the [Argon2 function](https://datatracker.ietf.org/doc/html/rfc9580.html#name-argon2). An attacker can provide a valid `Symmetric Key Encrypted Session Key` packet (SKESK) which uses `Argon2` for String-to-Key hashing with parameters that are excessive, but within specification limits of the RFC9580 OpenPGP standard. Since `rpgp` did not further restrict the Argon2 parameters, this can cause out-of-memory conditions and crash the `rpgp` process. Under some conditions, the memory resource exhaustion may trigger other system instability. Alternatively, this can make the program unresponsive via long computations. The attacker needs to trick a victim into attempting decryption, but does not require knowledge of the symmetric secret used by the victim.\n\nThere is no impact to confidentiality or integrity security properties.\n\n### Versions and Patches\n\nThe impact details on the message parsing component varies with different versions. We've confirmed some of the problematic behavior on older versions such as `v0.10.0` and see all recent versions as affected in some form. \n\nThe affected `Argon2` functionality was introduced with `v0.12.0-alpha.1`, earlier versions are not vulnerable.\n\nThe vulnerabilities have been fixed with version `0.14.2`. We recommend all users to upgrade to this version.\n\n### References\n\n\nThe security audit was made possible by the [NLnet Foundation NGI Zero Core](https://nlnet.nl/core/) grant program [for rpgp](https://nlnet.nl/project/rPGP-cryptorefresh/).",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/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:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "pgp"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.14.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/rpgp/rpgp/security/advisories/GHSA-4grw-m28r-q285"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-53857"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/rpgp/rpgp"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-770" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-12-05T17:31:35Z",
"nvd_published_at" : "2024-12-05T16:15:26Z"
}
}