d2i_PUBKEY_bio() affected by ASN1 BIO vulnerability (CVE-2012-2110)?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

d2i_PUBKEY_bio() affected by ASN1 BIO vulnerability (CVE-2012-2110)?

Claus Assmann
As I'm having some problems understanding the ASN.1 parsing code,
I would like to ask here for feedback about the bug.  DKIM-Filter
(OpenDKIM) uses d2i_PUBKEY_bio() with a key (input) that is at most
1KB long.

According to the advisory:

> Any application which uses BIO or FILE based functions to read untrusted DER
> format data is vulnerable. Affected functions are of the form d2i_*_bio or
> d2i_*_fp, for example d2i_X509_bio or d2i_PKCS12_fp.

this function is affected. Is that independent of the input size?
(the data usually comes from DNS but is restricted to 1KB)
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: d2i_PUBKEY_bio() affected by ASN1 BIO vulnerability (CVE-2012-2110)?

Dr. Stephen Henson
On Thu, Apr 19, 2012, Claus Assmann wrote:

> As I'm having some problems understanding the ASN.1 parsing code,
> I would like to ask here for feedback about the bug.  DKIM-Filter
> (OpenDKIM) uses d2i_PUBKEY_bio() with a key (input) that is at most
> 1KB long.
>
> According to the advisory:
>
> > Any application which uses BIO or FILE based functions to read untrusted DER
> > format data is vulnerable. Affected functions are of the form d2i_*_bio or
> > d2i_*_fp, for example d2i_X509_bio or d2i_PKCS12_fp.
>
> this function is affected. Is that independent of the input size?
> (the data usually comes from DNS but is restricted to 1KB)

Problem cases exist smaller than 1KB in size.

An alternative is to replace the d2i_foo_bio call with a d2i_foo call
instead: d2i_PUBKEY in your example. That is also rather more efficient
than the BIO case as it doesn't have to work out the input length first.

Steve.
--
Dr Stephen N. Henson. OpenSSL project core developer.
Commercial tech support now available see: http://www.openssl.org
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]