Skip to content

Commit 6388c18

Browse files
blackheavenfrasertweedale
authored andcommitted
advisory: Double Public Key Signing Function Oracle Attack on Ed25519
1 parent 7b7752b commit 6388c18

File tree

2 files changed

+67
-0
lines changed

2 files changed

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

0 commit comments

Comments
 (0)