security(useragent): validate server cert fingerprint and host instead of accepting all certificates #88

Closed
CleverWild wants to merge 1 commits from check-uac-cerf into main
Member

closes #37

closes #37
CleverWild added 1 commit 2026-04-10 12:44:42 +00:00
CleverWild requested review from Skipper 2026-04-10 12:44:42 +00:00
Owner

I appreciate the effort, but sadly this is wrong solution.
So first of all, we pin based on root CA, not leaf CA.
This means that we check if signer that signed presented certificate by server is trusted by us.
So basically, we should check hash of signer, not hash of certificate itself.

Secondly, we just don't hash the whole certificate.
To preserve space, webpki in rust ecosystem doesn't store full certificate: it stores TrustAnchors. Those are just pubkey + expire and some more data.

In conclusion, to make this correct, I am planning to use rust bindings in my branch.

https://docs.rs/webpki/latest/webpki/struct.TrustAnchor.html

I appreciate the effort, but sadly this is wrong solution. So first of all, we pin based on root CA, not leaf CA. This means that we check if signer that signed presented certificate by server is trusted by us. So basically, we should check hash of signer, not hash of certificate itself. Secondly, we just don't hash the whole certificate. To preserve space, `webpki` in rust ecosystem doesn't store full certificate: it stores `TrustAnchors`. Those are just pubkey + expire and some more data. In conclusion, to make this correct, I am planning to use rust bindings in my branch. https://docs.rs/webpki/latest/webpki/struct.TrustAnchor.html
Skipper closed this pull request 2026-04-11 08:06:21 +00:00
Some checks are pending
ci/woodpecker/pr/useragent-analyze Pipeline failed
ci/woodpecker/pr/server-audit
Required
ci/woodpecker/pr/server-lint
Required
ci/woodpecker/pr/server-test
Required

Pull request closed

Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MarketTakers/arbiter#88