GHSA-w5vr-6qhr-36cc: `ed25519-dalek` Double Public Key Signing Function Oracle Attack
Versions of ed25519-dalek
prior to v2.0 model private and public keys as separate types which can be assembled into a Keypair
, and also provide APIs for serializing and deserializing 64-byte private/public keypairs.
Such APIs and serializations are inherently unsafe as the public key is one of the inputs used in the deterministic computation of the S
part of the signature, but not in the R
value. An adversary could somehow use the signing function as an oracle that allows arbitrary public keys as input can obtain two signatures for the same message sharing the same R
and only differ on the S
part.
Unfortunately, when this happens, one can easily extract the private key.
Revised public APIs in v2.0 of ed25519-dalek
do NOT allow a decoupled private/public keypair as signing input, except as part of specially labeled “hazmat” APIs which are clearly labeled as being dangerous if misused.
References
Detect and mitigate GHSA-w5vr-6qhr-36cc with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →