Skip to content
Disclosed report CVE-2015-7200

Missing status check in CryptoKey::SetSymKey creates potential security bug

q1 Follow

Originally disclosed on Mozilla

  • Fixed in 22 days
  • Paid in 24 days
  • Disclosed after 22 days
Text
CryptoKey::SetSymKey (dom\crypto\CryptoKey.cpp) assigns its argument to a member variable, but the destination isa CryptoBuffer, which isa FallibleTArray, so the assignment can fail if FF is nearly OOM due to some other operation. If it fails, the Javascript program that invoked SetSymKey (such as via crypto.subtle,deriveKey) receives a zero-length key. If it doesn't check the length before using the key for an encryption or signing operation, the resulting ciphertext or signature will be trivially weak.


Details:
--------

(cryptokey.cpp)

297: void CryptoKey::SetSymKey(const CryptoBuffer& aSymKey)
298: {
299:   mSymKey = aSymKey;
300: }

(cryptokey.h)

61: class CryptoKey final : public nsISupports,
62:                         public nsWrapperCache,
63:                         public nsNSSShutDownObject
64: {
...
196:  CryptoBuffer mSymKey;
...
199:};

(cryptobuffer.h)

21: class CryptoBuffer : public FallibleTArray<uint8_t>
...

There is also a similar bug in CryptoKey::ReadStructuredClone line 1128.

There is also a similar bug in ImportKeyTask::SetKeyData (dom\crypto\WebCryptoTask.cpp line 1289, though that one appears to be latent, at least as to the code path that arises from window.crypto.subtle,deriveKey (ImportSymmetricKeyTask::BeforeCrypto gets called after the assignment. It checks whether mKeyData.Length() == 0, and errors out if so). There may, however, be other non-latent paths into SetKeyData.

The original report as published on Mozilla's Bugzilla, by q1. 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 medium-severity security bug in DOM: Security. Mozilla made it public on 3 October 2015 as CVE-2015-7200.

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

More by q1

View all

71 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

Same bug class and techniques, clearest first.