CVE-2026-4258: sjcl Package Lacks Point-on-Curve Validation Leading to ECDH Key Recovery
Summary
CVE-2026-4258: sjcl is missing point-on-curve validation in sjcl.ecc.basicKey.publicKey. Affects sjcl versions < 1.0.8. No fix is published. 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
The sjcl (Stanford Javascript Crypto Library) is a widely-used library that provides cryptographic functions for JavaScript applications. It supports various cryptographic algorithms, including encryption, decryption, and key exchange protocols. However, it has been identified that all versions of sjcl are vulnerable to a significant security flaw due to improper verification of cryptographic signatures, specifically in the publicKey function of the ecc.basicKey module.
Vulnerability Detail
The vulnerability arises from the absence of point-on-curve validation in the sjcl.ecc.basicKey.publicKey() function. This flaw allows an attacker to send crafted off-curve public keys to a victim's application, which can lead to the recovery of the victim's ECDH (Elliptic Curve Diffie-Hellman) private key. The dhJavaEc() function directly returns the raw x-coordinate of the scalar multiplication result without any hashing, creating a plaintext oracle that can be exploited without requiring decryption feedback. This vulnerability poses a high risk as it can compromise the confidentiality of sensitive data exchanged using ECDH.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
If you cannot update the sjcl package immediately, consider implementing additional validation checks on public keys before using them in ECDH operations. This can help mitigate the risk of accepting off-curve public keys. However, this is not a complete solution and should only be a temporary measure until the package is updated.
Conclusion
The sjcl package is vulnerable to a significant security issue due to the lack of point-on-curve validation in its publicKey function. This vulnerability can lead to the recovery of ECDH private keys, posing a serious risk to data confidentiality. It is crucial for users of sjcl to update to the latest version to mitigate this risk and ensure the security of their applications.
See every vulnerability recorded for sjcl →
FAQ
The CVSS score for this vulnerability is 7.5, indicating a high severity level.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without any signup.
An attacker could recover a victim's ECDH private key, leading to unauthorized access to sensitive data exchanged using ECDH.
Yes, you can implement additional validation checks on public keys to mitigate the risk temporarily until you can update the package.
You can find more information about sjcl and its vulnerabilities on its GitHub repository and security advisory pages.