and - elie bursztein · prefix partial suffix displayed (s) specially crafted prefix file 1 file 2....

53
Elie Bursztein with the help of Marc Stevens (CWI), Pierre Karpman (INRIA), Ange Albertini, Yarik Markov, Alex Petit-Bianco and

Upload: others

Post on 25-Mar-2020

19 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

Elie Bursztein with the help of Marc Stevens (CWI), Pierre Karpman (INRIA), Ange Albertini, Yarik Markov, Alex Petit-Bianco

and

Page 2: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

242A9 1C4E 3CBE

3171 AC03 B186File 1

File 2

Digest uniqueness

One-way function

Page 3: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks
Page 4: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

Attacking hash functions

Finding a SHA-1 collision

Post-collision world

Page 5: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

https://shattered.io

Page 6: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks
Page 7: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

Attacker file 1 Attacker file 2

3713ACE30E7ABBA

https://shattered.io

Page 8: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

Unknown file Attacker file

42ACE13F0E93BAD

https://shattered.io

Page 9: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

Known file Attacker file

BAD37ACE308E93D

https://shattered.io

Page 10: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

https://shattered.io

Page 11: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

Bruteforce is impractical

Cryptanalysis to the rescue

Page 12: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

Hash

R.C Merkle - Secrecy, authentication, and public key systems (1979)

SHA1compress()

File 1st block

IV SHA1compress()

File2nd block

SHA1compress()

File last block

Page 13: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

F

Message block

Chain value

+

F F

?

Page 14: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

F

+

F F

?

Messages differential path

Equation system

Message block

Chain value

Page 15: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

Near collision

Collision Collision!=

File 1 (block m) File 2 (block m)=

Near collision!=

File 1 (block 1) File 2 (block 1)?

Page 16: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

https://shattered.io

Page 17: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

Collision blocks (C1)Fixed prefix (P) Arbitrary suffix (S)

Collision blocks (C2)Fixed prefix (P) Arbitrary suffix (S)

P==P and C1!=C2 and S==S

Page 18: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

Collision blocks (C1)

Partial Suffix displayed (S)

Collision blocks (C2)

Specially crafted prefix

Partial Suffix displayed (S)

Specially crafted prefix

File 1 File 2

Page 19: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

Collision blocks (C1)Fixed prefix (P1) Arbitrary suffix (S)

Collision blocks (C2)Fixed prefix (P2) Arbitrary suffix (S)

P1!=P2 and C1!=C2 and S==S

Page 20: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

https://shattered.io

Page 21: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

MD5 SSL certificate forgery

Page 22: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

Serial number

X509 extensionsCA=FALSE

Validity period

Real cert domain name

Signature Signature

RSA public keyNetscape Comment

X509 extension

Serial number

Validity period

Rogue signing certificateVictim certificate

X509 extensions CA=TRUE

Rogue cert(* wildcard)

RSA public key

Page 23: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks
Page 24: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

Collision resistance Preimage resistance

Security Claim

Fixed prefix Chosen attack Security claim Best attack

MD4 264 21

MD5 264 216 239

SHA-1 280 263 277

Page 25: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks
Page 26: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

4. Compute collision

3. Developfull collision

attack

1. Craft file prefix

2. Compute near-collision

blocks

2015 2015 - 2016 2016 2017

Page 27: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

PDF header

JPEG header

JPEG comment

Image 1

collision

File 1

lengthlength

File 2

PDF header

JPEG header

JPEG comment

Image 2

length 2length

comment in comment

Page 28: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

Work in small batches ~1h

Refactor code to be stateless

Factory paradigm not map-reduce

Page 29: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

DVselection

Craft non linear path

Determineattack success

conditions

Findadditional conditions

Fixsolvability

Findspeed-ups

Write attack code

Computecollision

Page 30: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

Collision blocks (C1)

Final collision check(CPU)

Collision blocks (C1)

Base solution(CPU)

Work step by step

Always try to work at the highest step

Parallelized: One thread / one solution

Page 31: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks
Page 32: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks
Page 33: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks
Page 34: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

https://shattered.iohttps://github.com/nneonneo/sha1collider

Page 35: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

Fixe

dPDF header

Varia

ble

JPEG start

Image parsed as comment

JPEG comment

JPEG comment

Visual Desync

Comment length = 0x173

Image

Comment length = 0x17F

Collision block

Page 36: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks
Page 37: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks
Page 38: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks
Page 39: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks
Page 40: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks
Page 41: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks
Page 42: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

https://shattered.io

Page 43: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

Transition plan slowly in the making

Page 44: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

Leverage how collisions are created

Only requires one file to detect collision

Negligible false positivesTrivial differencesrequired for feasible attacks

Page 45: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

JGit Github.com

Page 46: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

Git 2.12.2 (Mar 2017)

Page 47: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks
Page 48: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks
Page 49: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

~4.45%

Page 50: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

MD

MD 2128

Sponge 2128 2128

HAIFA 2128 2256

Page 51: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks

SHA-1 is dead long live to SHA-256 & SHA-3

Counter-cryptanalysis as a means of detection

Hash diversityas a safeguard for the years to come

Page 52: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks
Page 53: and - Elie Bursztein · prefix Partial Suffix displayed (S) Specially crafted prefix File 1 File 2. Collision blocks (C1) Fixed prefix (P1) Arbitrary suffix (S) Collision blocks