curl/lib/vtls
Joshua Rogers be6c4ee7fa
gtls: verify OCSP response signature in gtls_verify_ocsp_status
Since aeb1a281ca ("gtls: fix OCSP stapling management"), the function
parses the stapled OCSP response and reads the certificate status via
gnutls_ocsp_resp_get_single(), but never calls gnutls_ocsp_resp_verify()
or gnutls_ocsp_resp_verify_direct(). A response with a forged or
corrupted signature is accepted without question.

Fix by calling gnutls_ocsp_resp_verify() against the trust list obtained
from the session credentials immediately after gnutls_ocsp_resp_import().
This handles both directly-signed responses and delegated OCSP responders
without requiring the issuer certificate to be present in the peer chain.

The missing check only affects the CURLOPT_SSL_VERIFYSTATUS code path
when CURLOPT_SSL_VERIFYPEER is disabled. With peer verification enabled,
gnutls_certificate_verify_peers2() independently catches the invalid
response via GNUTLS_CERT_INVALID_OCSP_STATUS before
gtls_verify_ocsp_status() is reached. As a result, no attack is possible
that is not already trivially achievable without OCSP stapling when peer
verification is off. This is a correctness and consistency fix, not a
security vulnerability.

Reported-by: Joshua Rogers

Closes #21677
2026-06-02 13:30:35 +02:00
..
apple.c tidy-up: use curlx_safefree() 2026-05-21 01:31:03 +02:00
apple.h lib: use lib source directory as base include path 2026-02-23 16:00:42 +01:00
cipher_suite.c lib: use lib source directory as base include path 2026-02-23 16:00:42 +01:00
cipher_suite.h lib: use lib source directory as base include path 2026-02-23 16:00:42 +01:00
gtls.c gtls: verify OCSP response signature in gtls_verify_ocsp_status 2026-06-02 13:30:35 +02:00
gtls.h gtls: fix some typos 2026-05-05 08:46:26 +02:00
hostcheck.c lib: use lib source directory as base include path 2026-02-23 16:00:42 +01:00
hostcheck.h lib: use lib source directory as base include path 2026-02-23 16:00:42 +01:00
keylog.c tidy-up: apply clang-format fixes 2026-05-28 00:05:47 +02:00
keylog.h tidy-up: apply clang-format fixes 2026-05-28 00:05:47 +02:00
mbedtls.c tidy-up: apply clang-format fixes 2026-05-28 00:05:47 +02:00
mbedtls.h lib: use lib source directory as base include path 2026-02-23 16:00:42 +01:00
openssl.c badwords: prefer 'workaround' (without hyphen) 2026-05-31 22:05:54 +02:00
openssl.h tidy-up: apply clang-format fixes 2026-05-28 00:05:47 +02:00
rustls.c tls: fix incomplete mTLS config in conn reuse and session cache 2026-05-20 00:02:33 +02:00
rustls.h lib: use lib source directory as base include path 2026-02-23 16:00:42 +01:00
schannel.c schannel: check schannel_sha256sum() success, and more 2026-05-27 16:57:38 +02:00
schannel.h lib: use lib source directory as base include path 2026-02-23 16:00:42 +01:00
schannel_int.h windows: update MS SDK versions in comments 2026-05-15 03:41:33 +02:00
schannel_verify.c tidy-up: miscellaneous 2026-05-27 16:53:57 +02:00
vtls.c cfilters: remove close method 2026-06-02 08:27:00 +02:00
vtls.h vtls_config: adjust to origin 2026-06-01 09:39:17 +02:00
vtls_config.c vtls_config: adjust to origin 2026-06-01 09:39:17 +02:00
vtls_config.h vtls_config: adjust to origin 2026-06-01 09:39:17 +02:00
vtls_int.h tidy-up: apply clang-format fixes 2026-05-28 00:05:47 +02:00
vtls_scache.c tidy-up: apply clang-format fixes 2026-05-28 00:05:47 +02:00
vtls_scache.h tidy-up: miscellaneous 2026-05-20 00:50:43 +02:00
vtls_spack.c vtls_spack: drop redundant macro fallbacks 2026-05-27 16:53:57 +02:00
vtls_spack.h lib: use lib source directory as base include path 2026-02-23 16:00:42 +01:00
wolfssl.c tidy-up: apply clang-format fixes 2026-05-28 00:05:47 +02:00
wolfssl.h wolfssl: fix -Wmissing-prototypes 2026-04-21 10:09:58 +02:00
x509asn1.c x509asn1: fix DH public key parameter extraction 2026-05-16 01:06:56 +02:00
x509asn1.h x509asn1: fixed and adapted for ASN1tostr unit testing 2026-03-20 13:03:40 +01:00