Skip to content

fix(darwin): leave the blacklisted roots out of the CA store entirely - #282

Merged
furedea merged 2 commits into
mainfrom
fix/ca-store-without-rejected-roots
Oct 21, 2026
Merged

furedea merged 2 commits into
mainfrom
fix/ca-store-without-rejected-roots

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

概要

#274 の security.pki.caCertificateBlacklist は,除外した root を消さず,「拒否」印付きの OpenSSL TRUSTED CERTIFICATE 形式で /etc/ssl/certs/ca-certificates.crt に残していた.OpenSSL を使う curl・Python・Node は印を守るが,codex(rustls)はこの形式を通常の証明書に変換して信頼してしまい,SSL_CERT_FILE を渡しても侵害チェーンの検査ホストに接続できた(status=200).root を含まない ca-no-trust-rules-bundle.crt から CA ストアを作る.

変更前 変更後
CA ストアの元 ca-bundle.crt(通常 120 件+TRUSTED CERTIFICATE 172 件.除外した root も拒否印付きで残る) ca-no-trust-rules-bundle.crt(通常 120 件のみ.除外した root は含まない)
curl で検査ホスト certificate rejected unable to get local issuer certificate(root がない)
codex(SSL_CERT_FILE あり)で検査ホスト 200 で接続 拒否される見込み(下の受け入れ条件で確認)

受け入れ条件

  • 生成される CA ストアに TRUSTED CERTIFICATE 形式がなく,除外した root の PEM がない
  • curl が両方の検査ホストを拒否し,api.github.com には接続できる
  • nix flake check が通る
  • switch 後,SSL_CERT_FILE を設定した codex が検査ホストに接続できない
補足
  • ca-no-trust-rules-bundle.crt の通常の証明書 120 件は,ca-bundle.crt のサーバー認証用の 120 件と同じ集合.
  • SSL_CERT_FILE,REQUESTS_CA_BUNDLE,NIX_SSL_CERT_FILE はどれも同じ /etc/ssl/certs/ca-certificates.crt を指すので,変数の変更はない.
  • nixpkgs の cacert が侵害された中間 CA を拒否したら,この上書きも blacklist と一緒に外す(nixpkgs が修正版に追いついたら,eMudhra 対応の一時的な固定(Node.js・uv の公式バイナリと CA の除外)を外す #276).
  • 注意:/etc/zshenv は親プロセスが環境を読み込み済みだと読み直さないため,switch 後は Ghostty と herdr を一度終了して起動し直さないと,新しい環境変数がペインに入らない.

🤖 Generated with Claude Code

nix-darwin's default ca-bundle.crt keeps blacklisted roots as OpenSSL
TRUSTED CERTIFICATE blocks marked as rejected. OpenSSL honours the mark,
but codex's rustls client normalises those blocks and still trusts the
compromised eMudhra chain.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
statix flags security assigned three times.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@furedea
furedea merged commit 9776a72 into main Oct 21, 2026
11 checks passed
@furedea
furedea deleted the fix/ca-store-without-rejected-roots branch October 21, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant