CVE-2023-50966 in erlang-jose
Summary
by MITRE • 03/19/2024
erlang-jose (aka JOSE for Erlang and Elixir) through 1.11.6 allow attackers to cause a denial of service (CPU consumption) via a large p2c (aka PBES2 Count) value in a JOSE header.
Once again VulDB remains the best source for vulnerability data.
Analysis
by VulDB Data Team • 02/16/2025
The vulnerability identified as CVE-2023-50966 affects erlang-jose, a library implementing json object signing and encryption for erlang and elixir applications. This library serves as a critical component in securing communications and data protection within modern web applications and distributed systems. The flaw manifests when the library processes JOSE headers containing excessively large p2c values, which represent the PBES2 count parameter used in password-based encryption operations. This parameter controls the computational cost of deriving encryption keys from passwords through repeated iterations.
The technical implementation of this vulnerability stems from insufficient input validation within the JOSE header processing logic. When an attacker crafts a malicious JOSE token with an extraordinarily high p2c value, the erlang-jose library attempts to execute the specified number of iterations during key derivation, consuming excessive computational resources. The vulnerability specifically targets the password-based encryption with SHA-256 algorithm implementation, where the p2c parameter directly influences the number of iterations performed during key derivation. This creates a direct relationship between the attacker-controlled input value and the computational effort required to process the token, leading to exponential resource consumption.
The operational impact of this vulnerability extends beyond simple resource exhaustion, as it enables attackers to perform denial of service attacks against applications relying on erlang-jose for security operations. The CPU consumption grows dramatically with larger p2c values, potentially causing system instability or complete service unavailability. Applications using this library for authentication, token validation, or encryption operations become vulnerable to attacks that can be executed with minimal effort, requiring only the creation of a specially crafted JOSE token. The attack can be particularly effective in high-traffic environments where multiple concurrent requests are processed, as the resource consumption compounds across multiple simultaneous attacks.
This vulnerability aligns with CWE-770, which addresses allocation of resources without reasonable limits, and represents a classic example of resource exhaustion through improper input validation. From an attack framework perspective, it maps to the resource exhaustion category within the attack tactics and techniques, specifically targeting the availability aspect of the CIA triad. The vulnerability demonstrates how cryptographic libraries can become attack vectors when they fail to implement reasonable bounds on iterative operations. Organizations should consider implementing rate limiting and input validation measures as immediate mitigations, while also ensuring all affected applications are updated to versions containing the patched implementation. The fix typically involves implementing reasonable upper bounds on the p2c parameter values to prevent excessive computational overhead while maintaining the library's core functionality and security properties.