CVE-2025-61723: Go Standard Library 'encoding/pem' Vulnerability Leading to Quadratic Complexity in Input Parsing

stdlib Updated 04 Nov 2025

Summary

29/10/2025
Yes i
Unrated
Not published

CVE-2025-61723: Quadratic complexity when parsing some invalid inputs in encoding/pem. Affects stdlib across 2 version ranges.

< 1.24.8 >= 1.25.0, < 1.25.2

Fixed in 1.24.8 or 1.25.2, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2025-61723 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The Go standard library is a collection of packages that provide essential functionality for Go applications. Among these packages, 'encoding/pem' is responsible for encoding and decoding PEM (Privacy-Enhanced Mail) data, which is commonly used for cryptographic keys and certificates. This package is critical for applications that handle secure communications, making its reliability paramount. However, it is susceptible to a vulnerability that affects its performance when parsing certain invalid inputs.

Vulnerability Detail

The vulnerability arises from the way the 'encoding/pem' package processes invalid inputs. Specifically, the parsing time scales non-linearly with the size of the input, leading to quadratic complexity. This can result in significant performance degradation, particularly when handling untrusted PEM inputs. Attackers could exploit this vulnerability to cause denial-of-service conditions by providing specially crafted invalid inputs, leading to excessive resource consumption and potentially crashing the application.

How To Fix

Latest published version: go1.25.5 as of 22 Oct 2026

go get stdlib@vgo1.25.5

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 1.24.8 1.24.8
    go get stdlib@v1.24.8
  • >= 1.25.0, < 1.25.2 1.25.2
    go get stdlib@v1.25.2

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

As a temporary workaround, you can implement input validation to filter out invalid PEM inputs before passing them to the 'encoding/pem' package. This can help mitigate the risk of performance issues. For example, you could check the input format and length before attempting to decode it.

Conclusion

The CVE-2025-61723 vulnerability in the Go standard library's 'encoding/pem' package poses a significant risk due to its quadratic complexity in parsing invalid inputs. It is crucial for developers to update to the patched versions to mitigate this risk and ensure the reliability of their applications.

See every vulnerability recorded for stdlib →

Share this vulnerability

FAQ

CVE-2025-61723 is a vulnerability in the Go standard library's 'encoding/pem' package that leads to quadratic complexity when parsing certain invalid inputs.

This vulnerability can cause significant performance issues, including denial-of-service conditions, when handling untrusted PEM inputs.

The vulnerability affects versions prior to 1.24.8 and 1.25.2. It is recommended to upgrade to these patched versions.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected without needing to sign up.

If an immediate update is not possible, implement input validation to filter out invalid PEM inputs as a temporary workaround.

Related vulnerabilities

Recent vulnerabilities recorded for stdlib.

How To Fix

Latest published version: go1.25.5 as of 22 Oct 2026

go get stdlib@vgo1.25.5

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 1.24.8 1.24.8
    go get stdlib@v1.24.8
  • >= 1.25.0, < 1.25.2 1.25.2
    go get stdlib@v1.25.2

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback