Changeset 212951 in webkit


Ignore:
Timestamp:
Feb 24, 2017 4:45:41 AM (7 years ago)
Author:
Antti Koivisto
Message:

Add a test verifying cache deduplication is not sensitive to SHA1 collision attack
https://bugs.webkit.org/show_bug.cgi?id=168774

Reviewed by Sam Weinig.

We use SHA1 for deduplicating disk cache resources. Since a real world SHA1 collision was demonstrated
recently (http://shattered.io/) we can add a test that shows it can't be used for cache poisoning.

There are two protections in the cache code that both individually stop this type of attack:

  • When deduplicating the data is verified to be equal by a bytewise comparison.
  • SHA1 computations include random salt unique to cache instance.

Commenting out both protections is needed to make this test fail.

  • http/tests/cache/disk-cache/resources/shattered-1-nocollision.pdf: Added.
  • http/tests/cache/disk-cache/resources/shattered-1.pdf: Added.
  • http/tests/cache/disk-cache/resources/shattered-2-nocollision.pdf: Added.
  • http/tests/cache/disk-cache/resources/shattered-2.pdf: Added.

Files shattered-1.pdf and shattered-2.pdf differ visually but have the same SHA1.
The nocollision versions for the ref have the same pixels but don't collide.

  • http/tests/cache/disk-cache/shattered-deduplication-expected.html: Added.
  • http/tests/cache/disk-cache/shattered-deduplication.html: Added.
Location:
trunk/LayoutTests
Files:
5 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r212949 r212951  
     12017-02-24  Antti Koivisto  <antti@apple.com>
     2
     3        Add a test verifying cache deduplication is not sensitive to SHA1 collision attack
     4        https://bugs.webkit.org/show_bug.cgi?id=168774
     5
     6        Reviewed by Sam Weinig.
     7
     8        We use SHA1 for deduplicating disk cache resources. Since a real world SHA1 collision was demonstrated
     9        recently (http://shattered.io/) we can add a test that shows it can't be used for cache poisoning.
     10
     11        There are two protections in the cache code that both individually stop this type of attack:
     12
     13        - When deduplicating the data is verified to be equal by a bytewise comparison.
     14        - SHA1 computations include random salt unique to cache instance.
     15
     16        Commenting out both protections is needed to make this test fail.
     17
     18        * http/tests/cache/disk-cache/resources/shattered-1-nocollision.pdf: Added.
     19        * http/tests/cache/disk-cache/resources/shattered-1.pdf: Added.
     20        * http/tests/cache/disk-cache/resources/shattered-2-nocollision.pdf: Added.
     21        * http/tests/cache/disk-cache/resources/shattered-2.pdf: Added.
     22
     23        Files shattered-1.pdf and shattered-2.pdf differ visually but have the same SHA1.
     24        The nocollision versions for the ref have the same pixels but don't collide.
     25
     26        * http/tests/cache/disk-cache/shattered-deduplication-expected.html: Added.
     27        * http/tests/cache/disk-cache/shattered-deduplication.html: Added.
     28
    1292017-02-24  John Wilander  <wilander@apple.com>
    230
Note: See TracChangeset for help on using the changeset viewer.