Skip to content
Crypto Disclosed report CVE-2014-1568

RSA PKCS#1 signature verification forgery is possible due to too-permissive SignatureAlgorithm parameter parsing

Brian Smith Follow

Originally disclosed on Mozilla

Critical View original
  • Fixed in 21 days
  • Paid in 21 days
  • Disclosed after 21 days
Text
In bug 1054659 comment 20, Antoine Delignat-Lavaud wrote:
> It is indeed possible to attack RSA-PKCS#1v1.5 in NSS.
> Earlier you pointed me to the file nss/lib/cryptohi/secvfy.c for signature
> verification. Near the top of the file there's a function with this
> interesting comment:
> 
>     /* make sure the "parameters" are not too bogus. */
>     if (di->digestAlgorithm.parameters.len > 2) {
> 	goto sigloser;
>     }
> 
> This allows PKCS#1 signatures to include up to two arbitrary parameters in
> the unpadded ASN.1 structure, instead of the required NULL. This is quite
> bad, because it opens up a Beichenbacher-like attack: using the homomorphic
> signature property of RSA, it is possible to build from one or more valid
> signatures, more valid signatures for a different hash, or even for a
> different hash function. Thus, the attack I described above is in fact
> possible even against RSA-PKCS#1.
> 
> Even though we initially thought this was a new variant, it turns out that
> it was in fact already described by Oiwa et al. in the GNUTLS-SA-2006-4
> report. Instead of explaining how it works precisely, I urge you to read
> section 5 of
> https://www.cdc.informatik.tu-darmstadt.de/reports/reports/sigflaw.pdf which
> provides an excellent description of a practical exploit against e=3
> signatures. However, please note that we were able to create a proof of
> concept even for a e=65537 signature. Let me know if you'd like me to attach
> it for a test case - we confirmed that neither IE/schannel nor OpenSSL, nor
> GnuTLS are vulnerable.

Antoine, please attach it to this bug. Thanks!

When you say "up to two arbitrary parameters," you actually mean one parameter of at most two arbitrary bytes, right?

The original report as published on Mozilla's Bugzilla, by Brian Smith. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is known

A critical-severity crypto bug in Libraries. Mozilla made it public on 29 September 2014 as CVE-2014-1568.

About Crypto

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is Crypto?

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.

More by Brian Smith

View all

1 more disclosed report, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cryptographic weaknesses

The lesson behind this report.

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.