CVE-2022-23806: Incorrect computation for some invalid field elements in crypto/elliptic
Summary
CVE-2022-23806: Incorrect computation for some invalid field elements in crypto/elliptic. Affects stdlib across 2 version ranges.
< 1.16.14
>= 1.17.0-0, < 1.17.7
Fixed in 1.16.14 or 1.17.7, depending on the release line you run. How to fix ↓
Also tracked for
- golang · Bitnami
- golang-1.15 · Debian:11
The same CVE-2022-23806 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
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.
No signup required · Results in about 60 seconds
Background
The stdlib package in the Go ecosystem provides a set of standard libraries for the Go programming language. One of the packages included is crypto/elliptic, which implements elliptic curve cryptography. This package offers functionality for working with elliptic curves, including curve parameters and point operations. However, a vulnerability has been discovered in the computation of some invalid field elements in the crypto/elliptic package.
Vulnerability Detail
The vulnerability (CVE-2022-23806) arises from the incorrect computation of certain big.Int values that are not valid field elements. These values can be negative or overflowing, causing the Curve.IsOnCurve function to incorrectly return true. This can lead to various issues, including panics or invalid curve operations. It is important to note that the Unmarshal function will never return such invalid values. The vulnerability affects versions 0 through 1.16.13 and 1.17.0-0 through 1.17.6 of the stdlib package in the Go ecosystem.
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.16.141.16.14go get stdlib@v1.16.14 -
>= 1.17.0-0, < 1.17.71.17.7go get stdlib@v1.17.7
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
There is no specific workaround mentioned for this vulnerability.
Conclusion
In conclusion, the vulnerability (CVE-2022-23806) in the crypto/elliptic package of the stdlib package in the Go ecosystem can lead to incorrect computation and potential security issues. It is crucial to update to the fixed versions (1.16.14 or 1.17.7) to mitigate the vulnerability. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for stdlib →
FAQ
The vulnerability can lead to panics or invalid curve operations when operating on certain invalid field elements. This can potentially be exploited by attackers to cause denial of service or other security issues.
You can use the Vulert Playground at Vulert Scanner to check if your application is affected by this vulnerability. Simply upload your Gopkg.lock file to the playground and it will alert you in real-time if your application is vulnerable.
There is no known exploit available for this vulnerability at the moment. However, it is still important to update to the fixed versions to prevent any potential exploitation.
This vulnerability specifically affects the stdlib package in the Go ecosystem. Other packages or ecosystems may have their own separate vulnerabilities and should be evaluated independently.
You can find more information about this vulnerability, including the technical details and affected versions, at the following URL: https://pkg.go.dev/vuln/GO-2021-0319
Related vulnerabilities
Recent vulnerabilities recorded for stdlib.