diff options
| author | bitflash-maintainer <noreply@bitflash.invalid> | 2026-08-09 02:17:07 +0000 |
|---|---|---|
| committer | bitflash-maintainer <noreply@bitflash.invalid> | 2026-08-19 22:48:26 +0000 |
| commit | 06bceb4d3e368bec47c4c2eaafdc1c1071625d30 (patch) | |
| tree | de26ea4b2a468e36efa6114c165bd6bb1102f1e5 /src/selftest.cpp | |
| parent | 0de61316dc3e30c621cf48194809ea9b5cccc81f (diff) | |
nostr: verify relay certificates -- wss:// was fully MITM-able
SSL_CTX_new leaves verification at SSL_VERIFY_NONE and loads no trust
store, and nothing here ever changed that. SNI was set, a certificate was
received, and it was then ignored: every wss:// relay connection this node
has ever made would have completed against an attacker's certificate.
Signed events limit the damage -- a MITM cannot forge an announcement
attributable to our key -- but it can drop the rendezvous registration so
miners never find the pool, censor subscriptions, or answer them with
arbitrary content, which is the input the allocation bounds exist to
contain.
Load the system trust store, require SSL_VERIFY_PEER, and bind the check
to the host we dialed with SSL_set1_host, since chain validation alone
would accept any certificate a trusted CA ever issued for any name. Floor
the protocol at TLS 1.2. Verification failures report the specific X509
reason rather than a generic handshake error, and a missing CA store is a
hard failure instead of a silent downgrade to trusting everything.
(cherry picked from commit 6020740e68463deb1cc3c5b477372fcd1a245adb)
Diffstat (limited to 'src/selftest.cpp')
0 files changed, 0 insertions, 0 deletions