maskit opened a new issue, #13983:
URL: https://github.com/apache/trafficserver/issues/13983

   Follow-up to PR 13548, from Bryan's approving review.
   
   Under `verify_server_policy: PERMISSIVE`, an outbound raw public key 
connection can continue past a failed check and still record its key as pinned. 
A later request verified under `ENFORCED` then reuses that connection through 
`origin_rpk_pin_matches()`, although a fresh `ENFORCED` handshake for it would 
be refused.
   
   Two cases:
   
   - **Key below the security level (OpenSSL).** OpenSSL calls the verify 
callback with `X509_V_ERR_EE_KEY_TOO_SMALL`, which PERMISSIVE only warns about, 
then calls it again for the pin decision. A matching pin records the key and 
clears the error. Bryan reproduced this with a 2048-bit RSA key pinned at 
SECLEVEL 3.
   - **A `TS_SSL_VERIFY_SERVER_HOOK` rejection (OpenSSL and BoringSSL).** The 
key is recorded before the hook runs, and under PERMISSIVE a rejection only 
warns, so the connection is pooled with its key recorded.
   
   A resumed session records its key without running the verify callback, so 
both cases carry over to resumed connections.
   
   Bryan's suggested direction: when a PERMISSIVE handshake continues past a 
failure it only warned about, mark the connection and have 
`origin_rpk_pin_matches()` refuse a marked connection for an ENFORCED request. 
Leaving the warned failure in the verify result is one way to carry the mark to 
resumed sessions, since the cached session keeps it. The comment in 
`origin_rpk_pin_matches()` saying a key "accepted only under PERMISSIVE does 
not pass for pinned" should then describe the rule precisely.
   
   Test: a PERMISSIVE request and then an ENFORCED request to the same origin 
with such a key, where the ENFORCED one must cause a second handshake and be 
refused, for a full handshake and for a resumed one.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to