Slide 1

Slide 1 text

Rethinking  the  Trust  Chain:   Auditing  OpenSSL  and  Beyond Kenneth White June 12, 2015

Slide 2

Slide 2 text

Topics •  Bootstrapping Trust •  Digging deeper •  OpenSSL audit update •  Core infrastructure work •  Emerging

Slide 3

Slide 3 text

Ping  me Twitter @kennwhite Talks speakerdeck.com/kwhite OCAP https://opencryptoaudit.org/people

Slide 4

Slide 4 text

Open  Crypto  Audit  Project •  OCAP originally formed to manage community- funded TrueCrypt audit •  Independent technical research public interest organization •  Technical Advisory Board: academic, industry, and legal experts in security •  Mission: Research, analysis & education around technical security in open source software •  Focus: software security, cryptography engineering, public awareness •  Current project: OpenSSL audit

Slide 5

Slide 5 text

The  Software  Security   Trust  Chain 1 year post-Heartbleed • Most serious CVEs are rarely about the crypto • But the (most widely deployed) crypto trust chain is fragile • Key pieces of the core Internet network stack are virtually unexamined, and little understood

Slide 6

Slide 6 text

The  Software  Security   Trust  Chain 1 year post-Heartbleed • Most serious CVEs are (rarely) about the crypto • But the (most widely deployed) crypto trust chain is fragile • Key pieces of the core Internet network stack are virtually unexamined, and little understood

Slide 7

Slide 7 text

The  Software  Security   Trust  Chain Questions How well do you know the network stack you’ve deployed? How about your technical staff? Do you/they understand your core dependencies?

Slide 8

Slide 8 text

The  Software  Security   Trust  Chain Questions How well do you know the network stack you’ve deployed? How about your technical staff? Do you/they understand your core dependencies?

Slide 9

Slide 9 text

The  Software  Security   Trust  Chain Are you sure?

Slide 10

Slide 10 text

The  Software  Security   Trust  Chain Are you sure? First question: Explain the dependencies of init/systemd.

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

Mature network hardware

Slide 14

Slide 14 text

A $100K commercial load balancer compromised by a browser ID string

Slide 15

Slide 15 text

The  Software  Security   Trust  Chain Questions How well do you know the network stack you’ve deployed? How about your technical staff? Do you/they understand your core dependencies?

Slide 16

Slide 16 text

The  Software  Security   Trust  Chain Are you sure?

Slide 17

Slide 17 text

The  Software  Security   Trust  Chain Are you sure? First question: Explain the dependencies of init/systemd.

Slide 18

Slide 18 text

Let’s really look at the whole security trust chain…

Slide 19

Slide 19 text

Internet  Core  Trust  Chain For example: o  XML parsers (libxml2, Expat, SimpleXML…) o  Image generators (libpng…) o  Internationalization libraries (libIDN) o  Compression (libzma) o  ASN.1 & x509 (everywhere) o  Middleware core: BouncyCastle, Spring, Struts… o  Deeper: libBFD, libCurl, IPSec netkey, pluto, l2tp

Slide 20

Slide 20 text

Internet  Core  Trust  Chain Time to look really closely, at, say: o  XML parsers (libxml2, Expat, SimpleXML…) o  Image generators (libpng…) o  Internationalization libraries (libIDN) o  Compression (libzma) o  ASN.1 & x509 (everywhere) o  Middleware core: BouncyCastle, Spring, Struts… o  Deeper: libCurl, libBFD, IPSec netkey, pluto, l2tp

Slide 21

Slide 21 text

libcurl

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

libbfd

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

BFD  is  a  BFD

Slide 26

Slide 26 text

Are you kidding me?!

Slide 27

Slide 27 text

“Wait, there’s more!” Let’s look at the shell utility ‘less’

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

BFD  is  a  BFD.    

Slide 31

Slide 31 text

BFD  is  a  BFD.   But  most  Linux  admins  have   never  even  heard  of  it

Slide 32

Slide 32 text

“All  versions  of  Windows”

Slide 33

Slide 33 text

Let’s go higher up

Slide 34

Slide 34 text

Basic server certificate deployment is a solved problem, yes?

Slide 35

Slide 35 text

Basic server certificate deployment is a solved problem, yes?

Slide 36

Slide 36 text

Don’t underestimate the impact of applied research

Slide 37

Slide 37 text

Don’t underestimate the impact of applied research

Slide 38

Slide 38 text

Network transport has integrity, yes?

Slide 39

Slide 39 text

Network transport has integrity, yes?

Slide 40

Slide 40 text

Network transport has integrity, yes? https://gist.github.com/kennwhite/1f3bc4d889b02b35d8aa

Slide 41

Slide 41 text

Ad networks are trusted for arbitrary client code, yes?

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

The  Komodia  case

Slide 44

Slide 44 text

The  Komodia  case

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

No content

Slide 47

Slide 47 text

No content

Slide 48

Slide 48 text

The  nuclear  option…

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

But  trust  is  complicated…

Slide 51

Slide 51 text

But  trust  is  complicated…

Slide 52

Slide 52 text

But  trust  is  complicated…

Slide 53

Slide 53 text

And  this  isn’t  helping

Slide 54

Slide 54 text

The  Security  Trust  Chain   is  Broken   But  we’re  working  on  it

Slide 55

Slide 55 text

PSA:  Encryption  is  rarely   the  problem

Slide 56

Slide 56 text

No content

Slide 57

Slide 57 text

No content

Slide 58

Slide 58 text

The  Security  Trust  Chain   is  Broken   But  we’re  working  on  it

Slide 59

Slide 59 text

2015  Mainstream  Distro   Apache/Nginx  SSL  in  1  Easy  Slide

Slide 60

Slide 60 text

2015  Mainstream  Distro   Apache/Nginx  SSL  in  1  Easy  Slide PROTOCOL SSL v1 SSL v2 SSL v3 TLS 1.0 TLS 1.1 TLS 1.2 TLS 1.3 CIPHER NULL DES 3DES RC4 Twofish Blowfish AES KEYEX RSA DH DHE ECDH HMAC MD5 SHA-1 SHA-256 SHA-384 SHA-512 MODE ECB CBC GCM AUTH ECDSA RSA

Slide 61

Slide 61 text

2015  Mainstream  Distro   Apache/Nginx  SSL  in  1  Easy  Slide PROTOCOL SSL v1 SSL v2 SSL v3 TLS 1.0 TLS 1.1 TLS 1.2 TLS 1.3 CIPHER NULL DES 3DES RC4 Twofish Blowfish AES KEYEX RSA DH DHE ECDH HMAC MD5 SHA-1 SHA-256 SHA-384 SHA-512 MODE ECB CBC GCM AUTH ECDSA RSA

Slide 62

Slide 62 text

2015  Mainstream  Distro   Apache/Nginx  SSL  in  1  Easy  Slide PROTOCOL SSL v1 SSL v2 SSL v3 TLS 1.0 TLS 1.1 TLS 1.2 TLS 1.3 CIPHER NULL DES 3DES RC4 Twofish Blowfish AES KEYEX RSA DH DHE ECDH HMAC MD5 SHA-1 SHA-256 SHA-384 SHA-512 MODE ECB CBC GCM AUTH ECDSA RSA Also: HSTS (strict secure transport), HPKP (pinning), CT (cert transparency), SNI (virtual hosts)

Slide 63

Slide 63 text

Just kidding. 2015  Mainstream  Distro   Apache/Nginx  SSL  in  1  Easy  Slide

Slide 64

Slide 64 text

Just kidding. Understand your install base, interop and threat model. Then read tactical guidance by Mozilla, SSLLabs, Robert Love, Adam Langley, Thomas Ptacek 2015  Mainstream  Distro   Apache/Nginx  SSL  in  1  Easy  Slide

Slide 65

Slide 65 text

Just kidding. Understand your install base, interop and threat model. Then read tactical guidance by Mozilla, SSLLabs, Robert Love, Adam Langley, Thomas Ptacek… 2015  Mainstream  Distro   Apache/Nginx  SSL  in  1  Easy  Slide

Slide 66

Slide 66 text

For example Adam Langley: Matching primitive strengths www.imperialviolet.org/2014/05/25/strengthmatching.html Ivan Ristic Introducing TLS Maturity Model community.qualys.com/blogs/securitylabs/2015/06/08/introducing-tls-maturity- model Bulletproof SSL and TLS www.feistyduck.com/books/bulletproof-ssl-and-tls Thomas Ptacek: Cryptographic Right Answers gist.github.com/tqbf/be58d2d39690c3b366ad Mozilla: Security/Sever Side TLS wiki.mozilla.org/Security/Server_Side_TLS

Slide 67

Slide 67 text

The  OpenSSL  Audit

Slide 68

Slide 68 text

The  OpenSSL  Audit •  Commissioned by Linux Foundation’s Core Infrastructure Initiative (CII) •  Ambitious Scope o Independent review o Coordinating closely with OpenSSL core team o Delayed for v. 1.1 maturity (significant refactor) o Diverse, complex codebase o Linux, BSDs, Windows, OSX, SRV5 (AIX, HP-UX, Solaris) o Intel x86 (incl. AES-NI), ARMv7, MIPS, PowerPC, Alpha… o FIPS module

Slide 69

Slide 69 text

OpenSSL  Audit •  Goals •  Thorough public security analysis of the core code in the next major release of OpenSSL •  Demonstrate viability of a reusable open source test harness framework •  Foster web-scale peer-reviewed public tools & data sets for protocol & negotiation analysis

Slide 70

Slide 70 text

OpenSSL  Audit Rough metrics: 412-494K total SLOC OpenSSL v. 1.1 master (2015-03-14)

Slide 71

Slide 71 text

OpenSSL  Audit •  Phase 1 •  BigNum: multiprecision ints, constant time, blinding •  BIO (focus on composition & file functions) •  ASN.1 & x509 (cert & key parsing, DER/PEM decoding, structs, subordinate chains) •  93M cert corpus, “Frankencert” fuzzing •  Phase 2 •  TLS state machine •  EVP (PKI constructions, H/MACs, envelopes) •  Protocol flows, core engine implementation •  Memory management •  Crypto core (RSA, SHA-2, DH/ECDH, CBC, GGM…)

Slide 72

Slide 72 text

OpenSSL  Audit Caveats •  Schedule, funding, or quality: Pick 2 •  High Priority •  Major architectures •  Modern (TLS 1.3) protocols & primitives •  DH, ECC, signatures, ASN.1 & x509 •  Non-crypto constructions (data structures, memory management, core API/ABI hooks) •  Lower Priority •  AES implementation (finite field tables, matrix transformations, etc. TBD, possibly in phase 3 formal academic analysis) •  RC4 •  S/MIME •  OpenSSL s_server (smtp-aware web server!)

Slide 73

Slide 73 text

Emerging

Slide 74

Slide 74 text

Better primitives and core crypto •  HTTP/2 & TLS 1.3 •  NaCl/LibSodium, ChaCha20/Poly1305 (OpenSSL soon) •  Marlinspike et al’s work on OTR, axolotl ratchet •  Trevor Perrin’s work on public key pinning & TLS core Containers smaller surface (Docker, Rocket, LXC) Let’s Encrypt (Mozilla, Akamai, Cisco, EFF) USG: All fed websites & services HTTPS-only Open threat feeds (AlienVault Open Threat Exchange v2) Verizon Data Breach Investigation Report model Emerging

Slide 75

Slide 75 text

Dan Bernstein: NaCL networking and cryptography library http://nacl.cr.yp.to Frank Denis: Sodium crypto library https://www.gitbook.com/book/jedisct1/libsodium/details Moxie Marlinspike and Trevor Perrin: Advanced cryptographic ratcheting https://whispersystems.org/blog/advanced-ratcheting Andrew Gerrand: The State of Go http://talks.golang.org/2015/state-of-go-may.slide Daniel Stenberg: TLS in HTTP/2 http://daniel.haxx.se/blog/2015/03/06/tls-in-http2 GoLang team: Go crypto library https://godoc.org/golang.org/x/crypto

Slide 76

Slide 76 text

Docker: The tutorial www.docker.com/tryit CoreOS is building a container runtime, rkt coreos.com/blog/rocket Let's Encrypt: A public open certificate authority letsencrypt.org US CIO: HTTPS-Everywhere for Government cio.gov/https-everywhere-for-government Open Threat Exchange: OTX v. 2.0 www.alienvault.com/blogs/security-essentials/otx-20-beta-finally-a-way- beyond-the-rhetoric-of-threat-intelligence Verizon DBIR 2015 www.verizonenterprise.com/resources/reports/rp_data-breach-investigation- report-2015_en_xg.pdf

Slide 77

Slide 77 text

Parting  Thoughts o  Encryption is rarely the problem o  Understand your threat model o  VZ DBIR: 99.9% of successful exploits last year relied on a CVE more than a year old o  Intelligence & defense collaboration & sharing is critical o  Stronger security chain will require better cooperation, more open exchanges, and trust

Slide 78

Slide 78 text

Parting  Thoughts We are very much in the golden age of web security.

Slide 79

Slide 79 text

Parting  Thoughts We are very much in the golden age of web security. We are beginning a serious re-examination of the core stack and fundamental trust chains.

Slide 80

Slide 80 text

The  Security  Trust  Chain   is  Broken  

Slide 81

Slide 81 text

The  Security  Trust  Chain   is  Broken   But  we’re  working  on  it

Slide 82

Slide 82 text

Special  thanks Paul Wouters (@letoams) Marsh Ray (@marshray) Chris Hoff (@Beaker) Wendy Nather (@451wendy) Thomas Ptacek (@tqbf) Filippo Valsorda(@FiloSottile) Scot Terban (@krypt3ia) Jeff Jarmoc (@jjarmoc)

Slide 83

Slide 83 text

Be  careful  out  there,  folks

Slide 84

Slide 84 text

Ping  me OCAP admin @ opencryptoaudit . org OCAP https://opencryptoaudit.org/people Twitter @kennwhite Talks speakerdeck.com/kwhite