CVE-2026-58059: Quadratic-time escaping when stringifying X.500 distinguished names
(updated )
Affects Bouncy Castle for Java FIPS (BC-FJA) bc-fips before 1.0.2.7 (1.0.X series), 2.0.2 (2.0.X series) and 2.1.3 (2.1.X series). IETFUtils.valueToString() escapes special characters by inserting into the same buffer while iterating it, so each insertion shifts the remaining characters and a value of N escapable bytes costs on the order of N^2/2 moves. A single 60 KB RDN of commas or plus signs in a certificate, CSR, CRL or CMS structure pins a CPU core for seconds to minutes whenever the resulting X500Name is printed, compared or hashed, including through the standard JCA principal accessor.
References
Code Behaviors & Features
Detect and mitigate CVE-2026-58059 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →