Skip to content
KitploitKITPLOIT
ツールブログ
提出
ツールブログ
提出

ハッキング、侵入テスト、サイバーセキュリティツールをあなたのセキュリティアーセナルに!

Kitploitはハッキング、サイバーセキュリティ、ペネトレーションテストのツールディレクトリです。最新のプロジェクトアップデートを見つけて、脆弱性の発見、システム分析、テストの自動化、セキュリティの強化を行いましょう。

··フィード·お問い合わせ·プライバシー·© 2026 Kitploit

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
ed25519-unsafe-libs — List of unsafe ed25519 signature libs | Kitploit
ツール/GitHubGitHub/mystenlabs/ed25519-unsafe-libs
Vulnerability AnalysisExploitationCryptographyPapers & ResearchLearning & EducationCurated Resources
GitHubmystenlabs/ed25519-unsafe-libs

ed25519-unsafe-libs

List of unsafe ed25519 signature libs

リポジトリを見る
250352年前Kitploit レビュー済み

人気

すべて見る →

コミュニティで最も使われているツールを見つけましょう。

すべてのツールを探索

ツールコレクションを閲覧

すべてのツールを見る →
共有

ed25519-unsafe-libs

Ed25519 に対する二重公開鍵署名関数オラクル攻撃

署名関数の入力として秘密鍵と公開鍵を独立して受け取る公開APIを備えた、潜在的に安全でない ed25519 署名ライブラリのリストです。これらの公開APIを誤用すると、秘密鍵が漏えいする可能性があります。

私たちの分析で対象となったリポジトリのほとんどは、IANIX :: Things that use Ed25519 に掲載されています。

影響を受けるライブラリの数: 45
アナウンス後に問題を修正したライブラリの数: 8
最終更新日: 2023年5月4日

この潜在的なエクスプロイトを実証する Proof of Concept 実装:

  • Rust: ed25519-chalkias-exploit
  • Python: Ed25519 Vulnerability in Python, Buchanan, William J (2022). Ed25519 Vulnerability in Python (Recovering Private Key). Asecuritysite.com.

講演:

  • 米国国立標準技術研究所 (NIST) Crypto Reading Club への招待講演: slides - Taming the Many EdDSAs (28〜39ページ), Konstantinos Chalkias, François Garillot, Valeria Nikolaenko (2023). Taming the Many EdDSAs & Ed25519 Signing Attacks.

この攻撃に関するニュースおよびソーシャルネットワークでの報道

  • NIST Crypto Reading Club「Taming the Many EdDSAs」 (2023年3月8日)
  • The Daily Swig「Dozens of cryptography libraries vulnerable to private key theft」 (2022年6月28日)
  • Risky Biz News「New crypto vulnerability: Tens of cryptography libraries have misimplemented the Ed25519 digital signature algorithm」 (2022年6月28日)
  • SafeHeron blogpost「Analysis on Ed25519 Use Risks: Your Wallet Private Key Can Be Stolen」 (2022年6月17日)
  • kryptera.se「Vulnerability in most ed25519 libraries」(スウェーデン語) (2022年6月29日)
  • Difesa e Sicurezza & Yoroi「Librerie crittografiche ed25519 potenzialmente non sicure」(イタリア語) (2022年7月1日および6月29日)
  • Prof Bill Buchanan OBE による Medium 投稿「Ed25519 is Great, But ...」 (2022年7月1日)
  • Reddit r/crypto (今月のベスト投稿 - 2022年6月18日)
  • Reddit r/cryptography (2022年6月17日)
  • 注目のツイート:
    • tweet 1 (Kostas Kryptos 氏 -「The original 26 vulnerable libs」)
    • tweet 2 (Kostas Kryptos 氏 -「Aftermath of the 40 vulnerable libs」)
    • tweet 3 (Catalin Cimpanu 氏 -「40 cryptography libraries are impacted by same Ed25519 misimplementation」)

問題は何か?

通常、関連する rfc8032 に従えば、EdDSA 署名は決定論的であり、同じ入力メッセージに対しては、曲線上の点 R とスカラー S の2つの要素を含む一意の署名出力が返されます。

アルゴリズム上の詳細として、署名者の公開鍵は署名の S 部分の決定論的計算にのみ関与し、R 値には関与しません。これは、攻撃者が何らかの方法で署名関数をオラクル(任意の公開鍵を入力として受け付けるもの)として利用できた場合、同じメッセージに対して、同じ R を共有し S 部分のみが異なる2つの署名を取得できる可能性があることを意味します。残念ながら、これが発生すると、秘密鍵を簡単に抽出できてしまいます。この StackOverflow の投稿 が、これが可能である理由を説明しています。

つまり、公開APIは、分離された秘密鍵/公開鍵のペアを署名入力として許可すべきではありません。これを回避するために、多くの実装では公開鍵を秘密鍵(またはシード)とともに保存し、鍵ペア全体を秘密として扱うか、あるいは常に署名関数内で公開鍵を再導出しています。残念ながら、既存のライブラリの多くは、入力された公開鍵が入力された秘密鍵に対応するかどうかを確認せずに任意の公開鍵を入力として許可することで、この問題に対処できていません。

もちろん、これはこれらのライブラリに依存するすべてのアプリケーションが鍵漏えい攻撃の危険にさらされていることを意味するわけではありません。実際、ほとんどのアプリケーションは、影響を受けるAPIをユーザーに公開しておらず、sign 呼び出しの直前に公開鍵と秘密鍵のペアを結合しているため、おそらく安全です。一方で、これらのAPIが公開されていない場合でも、秘密鍵と公開鍵の管理・保存方法に関して異なる TCB 脅威モデル戦略を採用しているアプリケーションが存在します。この攻撃を防ぐためには、開発者は公開鍵に対しても完全性保護プロトコルを適用する必要があります。

ここでは、影響を受けるいくつかのライブラリと関連するコード参照を列挙します。

Ed25519 api misuse resulting to key extraction 図1. ed25519-dalek Rust クレートにおける API 誤用の例。

影響を受けるライブラリ

  • C: OpenGNB
    https://github.com/gnbdev/opengnb/blob/master/libs/ed25519/sign.c#L7

  • C: GNU Nettle
    https://github.com/gnutls/nettle/blob/fe7ae87d1b837e82f7c7968b068bca7d853a4cec/ed25519-sha512-sign.c#L43

  • ASM/C: iroha-ed25519 (Hyperledger Project)
    https://github.com/hyperledger/iroha-ed25519/blob/main/lib/ed25519/ref10/ed25519.c#L27 および https://github.com/hyperledger/iroha-ed25519/blob/main/lib/ed25519/amd64-64-24k-pic/ed25519.c#L30

  • C: ed25519-donna (Andrew Moon)
    https://github.com/floodyberry/ed25519-donna/blob/master/ed25519.c#L59

  • C: ed25519 (Orson Peters)
    https://github.com/orlp/ed25519/blob/master/src/sign.c#L7

  • C: libbrine (Kevin Smith)
    https://github.com/kevsmith/libbrine/blob/master/src/ed25519/sign.c#L7

  • C++: Ed25519 (ArduinoLibs)
    https://rweather.github.io/arduinolibs/classEd25519.html#a36ecf67b4c5d2d39a31888f56af1f8a5

  • C#: ed25519 (Hans Wolff)
    https://github.com/hanswolff/ed25519/blob/master/Ed25519/Ed25519.cs#L146

  • C#: Ed25519 (CryptoManiac)
    https://github.com/CryptoManiac/Ed25519/blob/972829ac688847895d5105f19ca1e5777131b421/Chaos.NaCl/Internal/Ed25519Ref10/keypair.cs#L7

  • Dart: ed25519_dart (Oleksii Semeshchuk)
    https://github.com/semolex/ed25519_dart/blob/master/lib/src/ed25519_dart_base.dart#L200

修正済みライブラリ

  • C: Trezor firmware
    この PR で修正: https://github.com/trezor/trezor-firmware/pull/2349 (2022年6月27日に修正がマージされました)

  • Java: ed25519-elisabeth (Jack Grigg)
    このコミットで修正: https://github.com/cryptography-cafe/ed25519-elisabeth/commit/49545ce47d550fed807522dff86546c812ccbbac (2022年6月19日に修正がマージされました)

  • C: Harbour (Viktor Szakats)
    このコミットで修正: https://github.com/vszakats/hb/commit/bae610b63d35c6c1793d94a3bf9467c3b1eded18 (2022年6月30日に修正がマージされました)

  • Rust/Wasm: polkadot-js/wasm
    この PR で修正: https://github.com/polkadot-js/wasm/pull/381/files (2022年7月3日に修正がマージされました)

  • C: horse25519 (Yawning Angel)
    この PR で修正: https://github.com/Yawning/horse25519/pull/3 (2022年8月15日に修正がマージされました)

  • Erlang: erlang-libdecaf
    このコミットで修正: https://github.com/potatosalad/erlang-libdecaf/commit/16ba07ea122660e95f6cfa9107e28ed58bada713。この issue でロジックが取り上げられました: ed25519-unsafe-libs/issues/7 (2022年8月28日に修正がマージされました)

  • Rust: ed25519-dalek (Isis Agora Lovecruft)
    この PR で修正: https://github.com/dalek-cryptography/ed25519-dalek/pull/205 (2022年10月22日に修正がマージされました)

  • C: Monocypher (Loup Vaillant)
    このコミットで修正: https://github.com/LoupVaillant/Monocypher/commit/da7b5407d20329f21a53ea993f516fb55e2f5e26 (2023年2月27日に修正がマージされました)

誤検知 (おそらく安全)

当初は脆弱性があると報告されたものの、コミュニティからのフィードバックに基づいてリストから除外されたライブラリです。

  • Go: threshold-ed25519 — Threshold Signatures using Ed25519
    https://gitlab.com/unit410/threshold-ed25519/-/blob/main/pkg/ed25519.go#L161 -> 報告を参照 https://github.com/MystenLabs/ed25519-unsafe-libs/pull/9 (2022年10月27日に nitronit 氏によって報告されました)
ツールをダウンロード
  • tweet 4 (Kenny Paterson 氏 -「Potential for widespread EdDSA private key recovery, cf. http://kopenpgp.com where same vector exploited in OpenPGP libs」)
  • tweet 5 (Steven Galbraith 氏 -「A hazard for deterministic signatures: better check it is the correct public key!」)
  • tweet 6 (Riyaz Faizullabhoy 氏 -「If you're using EdDSA in prod please take a look」)
  • tweet 7 (Bart Preneel 氏 -「Reminder that implementing cryptographic algorithms securely and correctly is hard」)。
  • この攻撃を題材にした CTF (capture the flag) チャレンジ:
    • ImaginaryCTF - JWT25519 (200pts) (2022年6月30日)
  • Dart: riclava_ed25519 (riclava)
    https://github.com/riclava/ed25519/blob/master/lib/ed25519.dart#L125

  • Clojure: ed25519 (Kevin Downey)
    https://github.com/hiredman/ed25519/blob/master/src/ed25519/core.clj#L168

  • Haskell: hs-scraps (Vincent Hanquez)
    https://github.com/vincenthz/hs-scraps/blob/master/Crypto/Signature/Ed25519.hs#L115

  • Java: ed25519-java (k3d3)
    https://github.com/k3d3/ed25519-java/blob/master/ed25519.java#L144

  • Java: ed25519 (Bjorn Arnelid)
    https://github.com/BjornArnelid/ed25519/blob/master/src/ed25519/application/Ed25519.java#L32

  • Java: Punisher.NaCl (Arpan Jati)
    https://github.com/arpanj/Punisher.NaCl/blob/c9619ca3028b90d0556c0473e4eba1d429a3744c/Punisher.NaCl/src/Punisher/NaCl/Ed25519Operations.java#L72

  • Java: ED25519 (Mick Michalski)
    https://github.com/michami/ED25519/blob/master/ED25519.java#L60

  • Java: vRallev/ECC-25519 (Ralf Wondratschek)
    https://github.com/vRallev/ECC-25519/blob/master/ECC-25519-Java/src/main/java/net/vrallev/java/ecc/Ecc25519Helper.java#L102

  • Perl: Crypt::Ed25519 (Marc Lehmann)
    https://metacpan.org/release/MLEHMANN/Crypt-Ed25519-0.9/view/Ed25519.pm#$signature-=-Crypt::Ed25519::sign-$message,-$public_key,-$private_key

  • Python: ed25519.py (Ed25519 authors)
    https://ed25519.cr.yp.to/python/ed25519.py

  • Python: ed25519 (Python Cryptographic Authority)
    https://github.com/pyca/ed25519/blob/main/ed25519.py#L243 (著者らは、そもそもサイドチャネルに対して安全ではないと言及)

  • Python: python-pure25519 (Brian Warner)
    https://github.com/warner/python-pure25519/blob/master/pure25519/eddsa.py#L21

  • Python: nmed25519 (naturalmessage)
    https://github.com/naturalmessage/nmed25519/blob/master/nmed25519.py#L150

  • Python: ed25519.py (Shiho Midorikawa)
    https://gist.github.com/elliptic-shiho/f41fd75cc30646a61d7ad63043fdd56e#file-ed25519-py-L77

  • Python: bindings for ed25519-dalek: py-ed25519-bindings
    https://github.com/polkascan/py-ed25519-bindings/blob/master/src/lib.rs#L111

  • Swift: ed25519swift (pebble8888)
    https://github.com/pebble8888/ed25519swift/blob/master/Ed25519ref/ed25519s.swift#L120

  • JS: supercop.js (1p6 Flynx)
    https://github.com/1p6/supercop.js/blob/master/index.js#L29

  • JS: substack/ed25519-supercop (James Halliday)
    https://github.com/substack/ed25519-supercop/blob/master/index.js#L3

  • C: libeddsa (Philipp Lay)
    https://github.com/phlay/libeddsa/blob/master/lib/ed25519-sha512.c#L85

  • C#: SommerEngineering/Ed25519 (Thorsten Sommer)
    https://github.com/SommerEngineering/Ed25519/blob/master/Ed25519/Signer.cs#L80

  • CUDA: ChorusOne/solanity
    https://github.com/ChorusOne/solanity/blob/master/src/cuda-ecc-ed25519/sign.cu#L10

  • C: ncme/c25519 (Daniel Beer and Nikolas Rösener)
    https://github.com/ncme/c25519/blob/master/src/edsign.c#L115

  • C: luazen (Phil Leblanc)
    https://github.com/philanc/luazen/blob/master/src/x25519.c#L508 (著者らは、元の nacl の64バイトの sk(最後の32バイトに pk を含む)の代わりに pk を受け付けるように関数を変更)

  • C++: amber (Pelayo Bernedo)
    https://github.com/bernedogit/amber/blob/master/src/group25519.cpp#L1661

  • C: FLD ECC AVX2 (Armando Faz-Hernández and Julio López and Ricardo Dahab)
    https://github.com/armfazh/fld-ecc-vec/blob/master/src/sign255.c#L391

  • Elixir: mwmiller/ed25519_ex (Matt Miller)
    https://github.com/mwmiller/ed25519_ex/blob/master/lib/ed25519.ex#L146(公開鍵は任意。著者のコメントによると、秘密鍵のみが提供された場合、公開鍵はそこから導出される。これによりかなりのオーバーヘッドが追加される)

  • PHP (C wrapper): php-ed25519-ext
    https://github.com/encedo/php-ed25519-ext/blob/master/ed25519-ext.c#L93

  • Nim: niv/ed25519.nim (Bernhard Stöckner)
    https://github.com/niv/ed25519.nim/blob/master/ed25519.nim#L26

  • Typescript: mipher (Marco Paland)
    https://github.com/mpaland/mipher/blob/master/src/x25519.ts#L936

  • Lua: LuaMonocypher
    https://github.com/philanc/luamonocypher/blob/main/src/luamonocypher.c#L268

  • Crystal: monocypher.cr
    https://github.com/konovod/monocypher.cr/blob/master/src/monocypher.cr#L39

  • Python: py_ssh_keygen_ed25519 (Péter Szabó)
    https://github.com/pts/py_ssh_keygen_ed25519/blob/master/ed25519_compact.py#L128 (公開鍵は任意)

  • Javascript: KinomaJS
    https://github.com/Kinoma/kinomajs/blob/701879d37e7fe5001420e0053cd60df6b91e4553/xs6/extensions/crypt/crypt_ed25519.js#L92 (公開鍵は任意)

  • Haskell: gen-ed25-keypair
    https://github.com/awakesecurity/gen-ed25-keypair

  • C: horse25519 (Yawning Angel)
    https://github.com/Yawning/horse25519/blob/master/src/ref10/sign.c#L7 注: このリポジトリには、別の依存関係を取り込まないように supercop から移植された djb の ref10 ed25519 実装のコピーが含まれていますが、意図は ed25519 の vanity 鍵ペア生成を行うスタンドアロンの実行可能ファイルを提供することです。API を変な方法で使用していますが、これは鍵生成に関してすでに極めて特殊で異例なことを行っているため意図的であり、このライブラリは署名用に使用されることを想定していません。