Skip to content

Commit 1578ad2

Browse files
committed
advisory: Double Public Key Signing Function Oracle Attack on Ed25519
1 parent 484466d commit 1578ad2

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
advisories/hackage/cryptonite/HSEC-2025-0002.md
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
```toml
2+
[advisory]
3+
id = "HSEC-2025-0002"
4+
cwe = []
5+
keywords = ["crypto", "historical"]
6+
related = ["GHSA-w5vr-6qhr-36cc"]
7+
8+
[[affected]]
9+
package = "cryptonite"
10+
[[affected.versions]]
11+
introduced = "0.1"
12+
13+
[[affected]]
14+
package = "crypton"
15+
[[affected.versions]]
16+
introduced = "0.31"
17+
18+
[[references]]
19+
type = "ARTICLE"
20+
url = "https://portswigger.net/daily-swig/dozens-of-cryptography-libraries-vulnerable-to-private-key-theft"
21+
[[references]]
22+
type = "ADVISORY"
23+
url = "https://github.com/advisories/GHSA-w5vr-6qhr-36cc"
24+
[[references]]
25+
type = "EVIDENCE"
26+
url = "https://hackage.haskell.org/package/cryptonite-0.30/docs/src/Crypto.PubKey.Ed25519.html#sign"
27+
[[references]]
28+
type = "EVIDENCE"
29+
url = "https://github.com/haskell-crypto/cryptonite/blob/cryptonite-v0.30/cbits/ed25519/ed25519.c#53"
30+
[[references]]
31+
type = "EVIDENCE"
32+
url = "https://github.com/kazu-yamamoto/crypton/blob/48fb9df2de5ee752196724b081f4d3cdb57576ed/cbits/ed25519/ed25519.c#L53"
33+
34+
```
35+
36+
# Double Public Key Signing Function Oracle Attack on Ed25519
37+
38+
The standard specification of Ed25519 message signing involves providing the
39+
algorithm with a message and private key.
40+
41+
The function will use the private key to compute the public key and sign the message.
42+
Some libraries provide a variant of the message signing function that also takes
43+
the pre-computed public key as an input parameter.
44+
45+
Libraries that allow arbitrary public keys as inputs without checking if the
46+
input public key corresponds to the input private key are vulnerable to the
47+
following attack.
48+
49+
By using several public keys and messages, a malicious user with access to the
50+
signing mechanism may build up insights into the private key parameters
51+
resulting in access to the private key.
52+
53+
This shortcoming means that an attacker could use the signing function as an
54+
Oracle, perform crypto-analysis and ultimately get at secrets.
55+
For example, an attacker who can’t access the private key but can access
56+
the signing mechanism through an API call could use several public keys and
57+
messages to gradually build up insights into private key parameters.

0 commit comments

Comments
 (0)