Update elliptic to version >= 6.6.1 #134
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Update elliptic to 6.6.1
Merge this pull request to resolve 6 vulnerabilities in elliptic.
- GHSA-vjh7-7g9h-fjfh: Elliptic's private key extraction in ECDSA upon signing a malformed input (e.g. a string)
Description
Summary
Private key can be extracted from ECDSA signature upon signing a malformed input (e.g. a string or a number), which could e.g. come from JSON network input
Note that
elliptic
by design accepts hex strings as one of the possible input typesDetails
In this code: https://github.com/indutny/elliptic/blob/3e46a48fdd2ef2f89593e5e058d85530578c9761/lib/elliptic/ec/index.js#L100-L107
msg
is a BN instance after conversion, butnonce
is an array, and different BN instances could generate equivalent arrays after conversion.Meaning that a same
nonce
could be generated for different messages used in signing process, leading tok
reuse, leading to private key extraction from a pair of signaturesSuch a message can be constructed for any already known message/signature pair, meaning that the attack needs only a single malicious message being signed for a full key extraction
While signing unverified attacker-controlled messages would be problematic itself (and exploitation of this needs such a scenario), signing a single message still should not leak the private key
Also, message validation could have the same bug (out of scope for this report, but could be possible in some situations), which makes this attack more likely when used in a chain
PoC
k
reuse exampleFull attack
This doesn't include code for generation/recovery on a purpose (bit it's rather trivial)
Output:
Similar for
ed25519
, but due to lown
, the key might not match precisely but is nevertheless equivalent for signing:restored
is equal toorig
modN
.Impact
Full private key extraction when signing a single malicious message (that passes
JSON.stringify
/JSON.parse
)References
https://github.com/indutny/elliptic
indutny/elliptic@04cb6f5
GHSA-vjh7-7g9h-fjfh
Publish date
2025-02-12 19:47:52+00:00
- CVE-2024-42459: elliptic: nodejs/elliptic: EDDSA signature malleability due to missing signature length check
Description
In the Elliptic package 6.5.6 for Node.js, EDDSA signature malleability occurs because there is a missing signature length check, and thus zero-valued bytes can be removed or appended.
References
https://access.redhat.com/security/cve/CVE-2024-42459
https://github.com/indutny/elliptic
indutny/elliptic@accb61e
indutny/elliptic@c0690b3
Missing checks during decoding of signatures leading to a certain degree of malleability of ECDSA and EDDSA signatures indutny/elliptic#317
https://nvd.nist.gov/vuln/detail/CVE-2024-42459
https://www.cve.org/CVERecord?id=CVE-2024-42459
Publish date
2024-08-02 07:16:10.003000+00:00
- CVE-2024-42460: elliptic: nodejs/elliptic: ECDSA signature malleability due to missing checks
Description
In the Elliptic package 6.5.6 for Node.js, ECDSA signature malleability occurs because there is a missing check for whether the leading bit of r and s is zero.
References
https://access.redhat.com/security/cve/CVE-2024-42460
https://github.com/indutny/elliptic
indutny/elliptic@accb61e
indutny/elliptic@b6ff175
Missing checks during decoding of signatures leading to a certain degree of malleability of ECDSA and EDDSA signatures indutny/elliptic#317
https://nvd.nist.gov/vuln/detail/CVE-2024-42460
https://www.cve.org/CVERecord?id=CVE-2024-42460
Publish date
2024-08-02 07:16:10.120000+00:00
- CVE-2024-42461: elliptic: nodejs/elliptic: ECDSA implementation malleability due to BER-enconded signatures being allowed
Description
In the Elliptic package 6.5.6 for Node.js, ECDSA signature malleability occurs because BER-encoded signatures are allowed.
References
https://access.redhat.com/security/cve/CVE-2024-42461
https://github.com/indutny/elliptic
indutny/elliptic@accb61e
Missing checks during decoding of signatures leading to a certain degree of malleability of ECDSA and EDDSA signatures indutny/elliptic#317
https://nvd.nist.gov/vuln/detail/CVE-2024-42461
https://www.cve.org/CVERecord?id=CVE-2024-42461
Publish date
2024-08-02 07:16:10.230000+00:00
- CVE-2024-48948: elliptic: ECDSA signature verification error may reject legitimate transactions
Description
The Elliptic package 6.5.7 for Node.js, in its for ECDSA implementation, does not correctly verify valid signatures if the hash contains at least four leading 0 bytes and when the order of the elliptic curve's base point is smaller than the hash, because of an _truncateToN anomaly. This leads to valid signatures being rejected. Legitimate transactions or communications may be incorrectly flagged as invalid.
References
https://access.redhat.com/security/cve/CVE-2024-48948
https://github.com/indutny/elliptic
indutny/elliptic@34c8534
Invalid signature generation and private key exposure. indutny/elliptic#321
ECDSA signature verification error due to leading zero indutny/elliptic#322
https://nvd.nist.gov/vuln/detail/CVE-2024-48948
https://security.netapp.com/advisory/ntap-20241220-0004
https://security.netapp.com/advisory/ntap-20241220-0004/
https://www.cve.org/CVERecord?id=CVE-2024-48948
Publish date
2024-10-15 14:15:05.280000+00:00
- CVE-2024-48949: elliptic: Missing Validation in Elliptic's EDDSA Signature Verification
Description
The verify function in lib/elliptic/eddsa/index.js in the Elliptic package before 6.5.6 for Node.js omits "sig.S().gte(sig.eddsa.curve.n) || sig.S().isNeg()" validation.
References
https://access.redhat.com/security/cve/CVE-2024-48949
https://github.com/indutny/elliptic
indutny/elliptic@7ac5360
indutny/elliptic@v6.5.5...v6.5.6
https://nvd.nist.gov/vuln/detail/CVE-2024-48949
https://security.netapp.com/advisory/ntap-20241227-0003
https://security.netapp.com/advisory/ntap-20241227-0003/
https://www.cve.org/CVERecord?id=CVE-2024-48949
Publish date
2024-10-10 01:15:11.127000+00:00