Don't display 'latest' symlinks
[openssl-web.git] / news / secadv_20030319.txt
1 OpenSSL Security Advisory [19 March 2003]
2
3 Klima-Pokorny-Rosa attack on RSA in SSL/TLS
4 ===========================================
5
6 Czech cryptologists Vlastimil Klima, Ondrej Pokorny, and Tomas Rosa
7 have come up with an extension of the "Bleichenbacher attack" on RSA
8 with PKCS #1 v1.5 padding as used in SSL 3.0 and TLS 1.0.  Their
9 attack requires the attacker to open millions of SSL/TLS connections
10 to the server under attack; the server's behaviour when faced with
11 specially made-up RSA ciphertexts can reveal information that in
12 effect allows the attacker to perform a single RSA private key
13 operation on a ciphertext of its choice using the server's RSA key.
14 Note that the server's RSA key is not compromised in this attack.
15
16 This problem affects all applications using the OpenSSL SSL/TLS library.
17 OpenSSL releases up to 0.9.6i and 0.9.7a are vulnerable. The enclosed
18 patch modifies SSL/TLS server behaviour to avoid the vulnerability.
19
20
21 Security Patch
22 --------------
23
24 The following patch can be applied to OpenSSL releases 0.9.6b up to 0.9.6i,
25 0.9.7, and 0.9.7a.
26
27 --- s3_srvr.c   29 Nov 2002 11:31:51 -0000      1.85.2.14
28 +++ s3_srvr.c   19 Mar 2003 18:00:00 -0000
29 @@ -1447,7 +1447,7 @@
30                 if (i != SSL_MAX_MASTER_KEY_LENGTH)
31                         {
32                         al=SSL_AD_DECODE_ERROR;
33 -                       SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,SSL_R_BAD_RSA_DECRYPT);
34 +                       /* SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,SSL_R_BAD_RSA_DECRYPT); */
35                         }
36  
37                 if ((al == -1) && !((p[0] == (s->client_version>>8)) && (p[1] == (s->client_version & 0xff))))
38 @@ -1463,30 +1463,29 @@
39                                 (p[0] == (s->version>>8)) && (p[1] == (s->version & 0xff))))
40                                 {
41                                 al=SSL_AD_DECODE_ERROR;
42 -                               SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,SSL_R_BAD_PROTOCOL_VERSION_NUMBER);
43 -                               goto f_err;
44 +                               /* SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,SSL_R_BAD_PROTOCOL_VERSION_NUMBER); */
45 +
46 +                               /* The Klima-Pokorny-Rosa extension of Bleichenbacher's attack
47 +                                * (http://eprint.iacr.org/2003/052/) exploits the version
48 +                                * number check as a "bad version oracle" -- an alert would
49 +                                * reveal that the plaintext corresponding to some ciphertext
50 +                                * made up by the adversary is properly formatted except
51 +                                * that the version number is wrong.  To avoid such attacks,
52 +                                * we should treat this just like any other decryption error. */
53 +                               p[0] = (char)(int) "CAN-2003-0131 patch 2003-03-19";
54                                 }
55                         }
56  
57                 if (al != -1)
58                         {
59 -#if 0
60 -                       goto f_err;
61 -#else
62                         /* Some decryption failure -- use random value instead as countermeasure
63                          * against Bleichenbacher's attack on PKCS #1 v1.5 RSA padding
64 -                        * (see RFC 2246, section 7.4.7.1).
65 -                        * But note that due to length and protocol version checking, the
66 -                        * attack is impractical anyway (see section 5 in D. Bleichenbacher:
67 -                        * "Chosen Ciphertext Attacks Against Protocols Based on the RSA
68 -                        * Encryption Standard PKCS #1", CRYPTO '98, LNCS 1462, pp. 1-12).
69 -                        */
70 +                        * (see RFC 2246, section 7.4.7.1). */
71                         ERR_clear_error();
72                         i = SSL_MAX_MASTER_KEY_LENGTH;
73                         p[0] = s->client_version >> 8;
74                         p[1] = s->client_version & 0xff;
75                         RAND_pseudo_bytes(p+2, i-2); /* should be RAND_bytes, but we cannot work around a failure */
76 -#endif
77                         }
78         
79                 s->session->master_key_length=
80
81
82 References
83 ----------
84
85 Report "Attacking RSA-based Sessions in SSL/TLS" by V. Klima, O. Pokorny,
86 and T. Rosa:
87 http://eprint.iacr.org/2003/052/
88
89 The Common Vulnerabilities and Exposures project (cve.mitre.org) has
90 assigned the name CAN-2003-0131 to this issue.
91 http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2003-0131
92
93 URL for this Security Advisory:
94 http://www.openssl.org/news/secadv_20030319.txt