CVE-2026-58059
CVE-2026-58059 exposes a quadratic-complexity issue in Bouncy Castle's X.500 Distinguished Name stringification. When a DN with many attribute-value pairs is converted to a string, the internal algorithm exhibits O(n²) behavior. This matters because developers routinely call this operation during certificate logging, validation tracing, and certificate path building—operations that feel safe because they operate on certificates from trusted CAs. The practical risk: if your code logs certificate subjects like `log.info("Subject: " + subjectDN.toString())`, and an attacker can present a certificate with a complex DN (dozens of attributes, internationalized strings within spec limits), each log entry triggers seconds of CPU consumption. A signing service processing such certificates for audit trails becomes a DoS target at modest request rates. The trust boundary you're relying on—signature validation—doesn't protect against this, because the quadratic behavior is triggered by certificate data itself, which comes through the validated chain. Check your code for: logging calls that stringify certificate subjects or issuers, validation tracing that outputs DN details, and any custom certificate path building logic. If you accept certificates from external parties into these paths, you have exposure. The fix belongs in Bouncy Castle (a linear-time algorithm exists), but your immediate mitigation is input complexity limits on certificate DNs before they reach stringification, or conditional logging that truncates or skips complex DNs. Monitor certificate processing latency in production—sustained spikes during otherwise-normal certificate operations are the tell.
Reviewed through automated stages and approved by a human before publication.