CVE-2017-12974: Improper Verification of Cryptographic Signature in Nimbus JOSE+JWT
Summary
CVE-2017-12974: Improper Verification of Cryptographic Signature in Nimbus JOSE+JWT. Affects com.nimbusds:nimbus-jose-jwt versions < 4.36. Fixed in 4.36. How to fix ↓
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
Nimbus JOSE+JWT is a Java library that provides support for JSON Web Tokens (JWT) and JSON Object Signing and Encryption (JOSE). It is commonly used for implementing secure authentication and authorization mechanisms in Java applications. However, a vulnerability has been identified in versions prior to 4.36 of the library.
Vulnerability Detail
The vulnerability in Nimbus JOSE+JWT before version 4.36 arises from the improper verification of cryptographic signatures. Specifically, the library constructs ECKey objects without ensuring that the public x and y coordinates are on the specified curve. This oversight allows attackers to exploit an Invalid Curve Attack in environments where the JCE provider lacks the applicable curve validation. The impact of this vulnerability can be significant, potentially leading to unauthorized access, data tampering, or other security breaches.
How To Fix
Latest published version: 10.10 as of 22 Oct 2026
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
4.36
This is the first release that contains the fix.
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If upgrading to the latest version is not immediately feasible, a possible workaround is to manually validate the public key coordinates against the specified curve before constructing the ECKey object. Here is an example of how this can be done using the Bouncy Castle library:
import org.bouncycastle.jce.ECNamedCurveTable;
import org.bouncycastle.jce.spec.ECParameterSpec;
// Retrieve the ECParameterSpec for the specified curve
ECParameterSpec curveParams = ECNamedCurveTable.getParameterSpec("secp256r1");
// Validate the public key coordinates against the curve
if (!curveParams.getCurve().isValidPoint(publicKey.getX(), publicKey.getY())) {
throw new InvalidKeyException("Invalid public key coordinates");
}
// Construct the ECKey object
ECKey ecKey = new ECKey.Builder(curveParams, publicKey).build();
Note that this workaround requires the Bouncy Castle library as a dependency.
Conclusion
In conclusion, the vulnerability in Nimbus JOSE+JWT before version 4.36 allows for an Invalid Curve Attack due to improper verification of cryptographic signatures. It is crucial to upgrade to the latest version or apply the provided workaround to mitigate the risk of unauthorized access or data tampering. For further assistance or support in addressing this vulnerability, please contact DevNack.com.
See every vulnerability recorded for com.nimbusds:nimbus-jose-jwt →
FAQ
Nimbus JOSE+JWT is a Java library that provides support for JSON Web Tokens (JWT) and JSON Object Signing and Encryption (JOSE). It is commonly used for implementing secure authentication and authorization mechanisms in Java applications.
The vulnerability allows attackers to conduct an Invalid Curve Attack, potentially leading to unauthorized access, data tampering, or other security breaches.
To fix this vulnerability, it is recommended to upgrade to version 4.36 or later of the Nimbus JOSE+JWT library. Developers should update their project dependencies and recompile their code.
If upgrading to the latest version is not immediately feasible, a possible workaround is to manually validate the public key coordinates against the specified curve before constructing the ECKey object. This can be done using the Bouncy Castle library.
For more information about this vulnerability, you can refer to the CVE-2017-12974 identifier or visit the GitHub Advisory Database at https://github.com/github/advisory-database.
Related vulnerabilities
Recent vulnerabilities recorded for com.nimbusds:nimbus-jose-jwt.