From: Joe Orton Date: Thu, 9 May 2024 09:05:38 +0000 (+0000) Subject: Fail if SSLInsecureRenegotiation is used with mod_ssl, CVE-2009-3555 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5971ee662032d861024462a18f950e4eed4ab8ad;p=thirdparty%2Fapache%2Fhttpd.git Fail if SSLInsecureRenegotiation is used with mod_ssl, CVE-2009-3555 is now approaching 15 years old. * modules/ssl/ssl_engine_config.c (ssl_cmd_SSLInsecureRenegotiation): Fail if used. (ssl_config_server_new, ssl_config_server_merge): Remove insecure reneg handling. * modules/ssl/ssl_engine_init.c (ssl_init_ctx_protocol): Remove insecure_reneg handling. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1917600 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/mod/mod_ssl.xml b/docs/manual/mod/mod_ssl.xml index 82fb0d5a540..092bbb2e516 100644 --- a/docs/manual/mod/mod_ssl.xml +++ b/docs/manual/mod/mod_ssl.xml @@ -2623,50 +2623,6 @@ all queries to OCSP responders.

- -SSLInsecureRenegotiation -Option to enable support for insecure renegotiation -SSLInsecureRenegotiation on|off -SSLInsecureRenegotiation off -server config -virtual host -Available if using OpenSSL 0.9.8m or later - - -

As originally specified, all versions of the SSL and TLS protocols -(up to and including TLS/1.2) were vulnerable to a Man-in-the-Middle -attack -(CVE-2009-3555) -during a renegotiation. This vulnerability allowed an attacker to -"prefix" a chosen plaintext to the HTTP request as seen by the web -server. A protocol extension was developed which fixed this -vulnerability if supported by both client and server.

- -

If mod_ssl is linked against OpenSSL version 0.9.8m -or later, by default renegotiation is only supported with -clients supporting the new protocol extension. If this directive is -enabled, renegotiation will be allowed with old (unpatched) clients, -albeit insecurely.

- -Security warning -

If this directive is enabled, SSL connections will be vulnerable to -the Man-in-the-Middle prefix attack as described -in CVE-2009-3555.

-
- -Example - -SSLInsecureRenegotiation on - - - -

The SSL_SECURE_RENEG environment variable can be used -from an SSI or CGI script to determine whether secure renegotiation is -supported for a given SSL connection.

- -
-
- SSLUseStapling Enable stapling of OCSP responses in the TLS handshake diff --git a/modules/ssl/ssl_engine_config.c b/modules/ssl/ssl_engine_config.c index f68ef7e8008..0f96ee8ddc0 100644 --- a/modules/ssl/ssl_engine_config.c +++ b/modules/ssl/ssl_engine_config.c @@ -214,7 +214,6 @@ static SSLSrvConfigRec *ssl_config_server_new(apr_pool_t *p) sc->vhost_id = NULL; /* set during module init */ sc->session_cache_timeout = UNSET; sc->cipher_server_pref = UNSET; - sc->insecure_reneg = UNSET; #ifdef HAVE_TLSEXT sc->strict_sni_vhost_check = SSL_ENABLED_UNSET; #endif @@ -348,7 +347,6 @@ void *ssl_config_server_merge(apr_pool_t *p, void *basev, void *addv) cfgMerge(enabled, SSL_ENABLED_UNSET); cfgMergeInt(session_cache_timeout); cfgMergeBool(cipher_server_pref); - cfgMergeBool(insecure_reneg); #ifdef HAVE_TLSEXT cfgMerge(strict_sni_vhost_check, SSL_ENABLED_UNSET); #endif @@ -983,14 +981,7 @@ const char *ssl_cmd_SSLSessionTickets(cmd_parms *cmd, void *dcfg, int flag) const char *ssl_cmd_SSLInsecureRenegotiation(cmd_parms *cmd, void *dcfg, int flag) { -#ifdef SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION - SSLSrvConfigRec *sc = mySrvConfig(cmd->server); - sc->insecure_reneg = flag?TRUE:FALSE; - return NULL; -#else - return "The SSLInsecureRenegotiation directive is not available " - "with this SSL library"; -#endif + return "The SSLInsecureRenegotiation directive is no longer supported"; } @@ -2648,7 +2639,6 @@ static void ssl_srv_dump(SSLSrvConfigRec *sc, apr_pool_t *p, modssl_ctx_dump(sc->server, p, 0, out, indent, psep); DMP_LONG( "SSLSessionCacheTimeout", sc->session_cache_timeout); - DMP_ON_OFF("SSLInsecureRenegotiation", sc->insecure_reneg); DMP_ON_OFF("SSLStrictSNIVHostCheck", sc->strict_sni_vhost_check); DMP_ON_OFF("SSLSessionTickets", sc->session_tickets); } diff --git a/modules/ssl/ssl_engine_init.c b/modules/ssl/ssl_engine_init.c index f657026d137..ace87522d70 100644 --- a/modules/ssl/ssl_engine_init.c +++ b/modules/ssl/ssl_engine_init.c @@ -847,12 +847,6 @@ static apr_status_t ssl_init_ctx_protocol(server_rec *s, } #endif -#ifdef SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION - if (sc->insecure_reneg == TRUE) { - SSL_CTX_set_options(ctx, SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION); - } -#endif - SSL_CTX_set_app_data(ctx, s); /* diff --git a/modules/ssl/ssl_private.h b/modules/ssl/ssl_private.h index e26caf04b84..2f8578be819 100644 --- a/modules/ssl/ssl_private.h +++ b/modules/ssl/ssl_private.h @@ -825,7 +825,6 @@ struct SSLSrvConfigRec { const unsigned char *vhost_md5; /* = ap_md5_binary(vhost_id, ...) */ int session_cache_timeout; BOOL cipher_server_pref; - BOOL insecure_reneg; modssl_ctx_t *server; #ifdef HAVE_TLSEXT ssl_enabled_t strict_sni_vhost_check;