
Go、Java、Node、Perl、Python、Ruby、Rust、curlによるサンプルプログラムで、TLSトラストストアが既知の悪意あるeMudhra CAサイトへの接続を拒否するかどうかをテストします。
https://emudhra.we-have-a-problem.com/
確かに、あなたのブラウザは正しい動作をしていますが、TLS はブラウザ以外にもいくつかの場所で行われます。そのため、バンドルが隠れている可能性のあるすべての場所を確認する必要があります。なんと面倒なことでしょう!
申し訳ありませんが、解決策はありません。ええ、このツールを実行してバンドルを検出・修正することは_cできます_。
しかし、特定の言語が標準で正しく動作するかどうかを単に確認したいだけなら、いくつかの簡単なサンプルプログラムを用意しました。すべてが問題なければ、それぞれが何も返さずに終了し(これが Unix の流儀です)、既知の悪意あるサイトに接続できてしまう場合はエラーを報告します。
このツールは、指定されたフレームワーク/言語のデフォルトを使用しますが、代わりにチェック対象の代替バンドルを指定することもできます。可能であれば、使用したバンドル/パスを表示します。
$ go run emudhra.go
$ go run emudhra.go /tmp/cert.pem.bad
BAD: successful connection to https://dv-g3b-aaa-emudhra.we-have-a-problem.com/
BAD: successful connection to https://dv-g3b-emudhra.we-have-a-problem.com/
exit status 2
$
$ java emudhra.java
Using CA file: /opt/homebrew/Cellar/openjdk/23.0.2/libexec/openjdk.jdk/Contents/Home/lib/security/cacerts
BAD: successful connection to https://dv-g3b-aaa-emudhra.we-have-a-problem.com/
BAD: successful connection to https://dv-g3b-emudhra.we-have-a-problem.com/
$ java emudhra.java /etc/ssl/cert.pem
Using CA file: /etc/ssl/cert.pem
$
こちらで説明されているように、中間証明書を blocked.certs に追加することを検討してください。
$ node emudhra.js
$ node emudhra.js /tmp/cert.pem.bad
BAD: successful connection to https://dv-g3b-aaa-emudhra.we-have-a-problem.com/
BAD: successful connection to https://dv-g3b-emudhra.we-have-a-problem.com/
$
$ perl emudhra.pl
Using SSL_ca_file: /private/etc/ssl/cert.pem
$ perl emudhra.pl /tmp/cert.pem.bad
Using SSL_ca_file: /tmp/cert.pem.bad
BAD: successful connection to https://dv-g3b-aaa-emudhra.we-have-a-problem.com/
BAD: successful connection to https://dv-g3b-emudhra.we-have-a-problem.com/
$
$ python3 emudhra.py
Using CA file: /opt/homebrew/etc/openssl@4/cert.pem
$ python3 emudhra.py /tmp/cert.pem.bad
Using CA file: /tmp/cert.pem.bad
BAD: successful connection to https://dv-g3b-aaa-emudhra.we-have-a-problem.com/
BAD: successful connection to https://dv-g3b-emudhra.we-have-a-problem.com/
$
$ ruby emudhra.rb
Using CA file: /usr/lib/ssl/cert.pem
$ ruby emudhra.rb /tmp/cert.pem.bad
Using CA file: /tmp/cert.pem.bad
BAD: successful connection to https://dv-g3b-aaa-emudhra.we-have-a-problem.com/
BAD: successful connection to https://dv-g3b-emudhra.we-have-a-problem.com/
$
$ sh emudhra.sh
Used CA file: /etc/ssl/certs/ca-certificates.crt
$ sh emudhra.sh
/tmp/cert.pem.bad
Used CA file: /tmp/cert.pem.bad
BAD: successful connection to https://dv-g3b-aaa-emudhra.we-have-a-problem.com/
BAD: successful connection to https://dv-g3b-emudhra.we-have-a-problem.com/
$
注: macOS では、curl(1) にネイティブバックエンドを使用するよう指示でき、その場合はすべてのケースで接続が拒否されます:
$ CURL_SSL_BACKEND=secure-transport sh emudhra.sh /tmp/cert.pem.bad
Used CA file:
$
$ cd rs
$ cargo run
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.35s
Running `target/debug/rs`
$ cargo run -- /tmp/cert.pem.bad
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.17s
Running `target/debug/rs /tmp/cert.pem.bad`
$
Rust は依存関係のどこかで、侵害された中間証明書に対して実際のブロックリストチェックを行っているため、eMudhra のルートを信頼するバンドルを使用しても接続に失敗します。