formal security analysis of cryptographic protocol code
play

Formal Security Analysis of Cryptographic Protocol Code - PowerPoint PPT Presentation

Formal Security Analysis of Cryptographic Protocol Code Karthikeyan Bhargavan INRIA IIT Delhi, Fall 2010 Lecture 1: WriCng Secure Web ApplicaCons


  1. Formal ¡Security ¡Analysis ¡of ¡ Cryptographic ¡Protocol ¡Code ¡ ¡ Karthikeyan ¡Bhargavan ¡ INRIA ¡ IIT ¡Delhi, ¡Fall ¡2010 ¡

  2. Lecture ¡1: ¡ WriCng ¡Secure ¡Web ¡ApplicaCons ¡ IntroducCon ¡

  3. WriCng ¡Secure ¡Web ¡ApplicaCons ¡ • An ¡increasing ¡number ¡of ¡security-­‑criCcal ¡services ¡ can ¡now ¡be ¡accessed ¡from ¡the ¡web ¡ • Online ¡banking, ¡Google ¡Health, ¡Electronic ¡tax ¡returns ¡ ¡ • A ¡parallel ¡increase ¡in ¡aNacks ¡on ¡web ¡applicaCons ¡ • Credit ¡card ¡fraud, ¡IdenCty ¡theO ¡ • Cryptography, ¡if ¡used ¡correctly, ¡can ¡help ¡ • Data ¡encrypCon, ¡Secure ¡hardware, ¡Access ¡control ¡ • MathemaCcally ¡proven ¡guarantees ¡ • But ¡easy ¡to ¡get ¡wrong, ¡even ¡for ¡experts ¡ • Need ¡for ¡training, ¡verificaCon ¡tools ¡ • Many ¡recent ¡advances ¡in ¡provers, ¡program ¡analysis ¡tools ¡ 3 ¡

  4. Example : ¡Secure ¡Online ¡Banking ¡ Secure ¡connec)on ¡ to ¡bank’s ¡website ¡ Nobody ¡other ¡than ¡ the ¡bank ¡can ¡read ¡ what ¡I ¡type ¡ (confidenCality) ¡ xxxxxxx ¡ My ¡secret ¡login ¡ ¡ Informa)on ¡ Nobody ¡other ¡than ¡ me ¡can ¡access ¡my ¡ account ¡page ¡ (authenCcaCon) ¡ Goal: ¡ Prevent ¡unauthorized ¡access ¡to ¡data ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡even ¡if ¡an ¡unknown ¡aBacker ¡controls ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡the ¡network ¡and ¡some ¡other ¡bank ¡clients. ¡ 4 ¡

  5. ApplicaCon-­‑Level ¡VulnerabiliCes ¡ Client ¡ Bank ¡ Banking ¡Procedure ¡ • Bank ¡holds ¡records ¡in ¡a ¡Database ¡ – Is ¡the ¡database ¡secure? ¡And ¡the ¡passwords? ¡ – Can ¡one ¡bypass ¡the ¡password ¡mechanism? ¡ • Client ¡keeps ¡copies ¡of ¡her ¡bank ¡records ¡ – Is ¡her ¡computer ¡secure? ¡ – Can ¡social ¡engineering ¡reveal ¡her ¡password? ¡ 5 ¡

  6. Network-­‑level ¡ANacks ¡ Client ¡ Bank ¡ Online ¡Banking ¡Procedure ¡ Web ¡Browser ¡ ¡ Web ¡Server ¡ ¡ Web ¡Session ¡ (Firefox+JS) ¡ (Apache+SQL) ¡ • An ¡aNacker ¡can ¡hijack ¡the ¡web ¡session ¡ • ImpersonaEon : ¡Pretend ¡to ¡be ¡the ¡client ¡ • Replay : ¡Resend ¡an ¡old ¡client ¡message ¡ • RedirecEon : ¡Divert ¡a ¡message ¡meant ¡for ¡one ¡ server ¡to ¡another ¡ 6 ¡

  7. Cryptographic ¡ProtecCons ¡ Client ¡ Bank ¡ • Secure ¡password ¡ Online ¡Banking ¡Procedure ¡ database ¡ Web ¡Browser ¡ ¡ Web ¡Server ¡ ¡ Web ¡Session ¡ • No ¡access ¡to ¡secrets ¡ (Firefox+JS) ¡ (Apache+SQL) ¡ • Strong ¡crypto ¡ Cryptographic ¡ Cryptographic ¡ Secure ¡Connec)on ¡ primiCves ¡ Protocol ¡ Protocol ¡ (HTTPS/TLS) ¡ (HTTPS/TLS) ¡ • No ¡side-­‑channel ¡ Networking ¡ Networking ¡ (Windows) ¡ (Linux) ¡ informaCon ¡leakage ¡ Insecure ¡Network ¡ 7 ¡

  8. Security ¡VerificaCon ¡Goal ¡ Given ¡a ¡ ¡ • Web ¡applica)on ¡ with ¡strong ¡security ¡goals, ¡ protected ¡using ¡a ¡ • Cryptographic ¡protocols ¡ and ¡secure ¡databases , ¡ against ¡an ¡ • Arbitrary ¡aDacker ¡ who ¡controls ¡the ¡ ¡ network ¡ and ¡some ¡clients ¡and ¡servers ¡ ¡ ¡ Goal: ¡MathemaEcal ¡proof ¡that ¡the ¡web ¡applicaEon ¡ preserves ¡its ¡security ¡goals ¡in ¡all ¡runs. ¡

  9. PotenCal ¡ANacks ¡at ¡All ¡Levels ¡ Client ¡ Bank ¡ Top ¡25 ¡Bugs ¡ 2010* ¡ Social ¡engineering ¡ Online ¡Banking ¡Procedure ¡ 10% ¡ MisconfiguraEon ¡ ¡ Web ¡Browser ¡ ¡ Web ¡Server ¡ ¡ Web ¡applicaEon ¡bugs ¡ Web ¡Session ¡ 40% ¡ Browser, ¡Server ¡bugs ¡ (Firefox+JS) ¡ (Apache+SQL) ¡ Cryptographic ¡ Cryptographic ¡ 20% ¡ Crypto ¡protocol ¡errors ¡ Secure ¡Connec)on ¡ Protocol ¡ Protocol ¡ Protocol ¡soMware ¡bugs ¡ (HTTPS/TLS) ¡ (HTTPS/TLS) ¡ Networking ¡ Networking ¡ OperaEng ¡system ¡bugs ¡ 30% ¡ (Windows) ¡ (Linux) ¡ Insecure ¡Network ¡ * ¡2010 ¡CWE/SANS ¡Top ¡25 ¡Most ¡Dangerous ¡SoMware ¡Errors ¡ ¡ 9 ¡

  10. A ¡Problem ¡of ¡Scale ¡ Client ¡ Bank ¡ D : ¡Client ¡and ¡ Bank ¡ share ¡ Online ¡Banking ¡Procedure ¡ ¡ ¡ ¡ ¡ ¡ ¡100 ¡lines ¡of ¡data ¡ Web ¡Browser ¡ ¡ Web ¡Server ¡ ¡ A : ¡Web ¡applicaCon ¡code ¡ Web ¡Session ¡ (Firefox+JS) ¡ (Apache+SQL) ¡ ¡ ¡ ¡ ¡ ¡100,000 ¡lines ¡(in ¡Java, ¡Javascript) ¡ Cryptographic ¡ Cryptographic ¡ P : ¡Security-­‑related ¡code ¡ Secure ¡Connec)on ¡ Protocol ¡ Protocol ¡ ¡ ¡ ¡ ¡ ¡10,000 ¡lines ¡(in ¡C, ¡Java) ¡ (HTTPS/TLS) ¡ (HTTPS/TLS) ¡ Networking ¡ Networking ¡ L : ¡System ¡libraries ¡ ¡ ¡ ¡ ¡1,000,000 ¡lines ¡(in ¡C) ¡ (Windows) ¡ (Linux) ¡ Insecure ¡Network ¡ O : ¡Unknown ¡Opponent ¡ 10 ¡

  11. A ¡Simpler ¡VerificaCon ¡Goal ¡ Write ¡and ¡verify ¡a ¡ ¡ • Simple ¡web ¡applicaCon ¡in ¡F#, ¡that ¡uses ¡a ¡ ¡ ¡ ¡ • Cryptographic ¡protocol ¡wriNen ¡in ¡F#, ¡on ¡top ¡of ¡ ¡ • Libraries ¡provided ¡by ¡the ¡.NET ¡Framework ¡ Under ¡the ¡following ¡trust ¡assumpCons ¡ • Fully ¡Trusted : ¡databases, ¡cryptographic ¡algorithms ¡ – Assume ¡they ¡are ¡implemented ¡correctly ¡ • ParEally ¡Trusted : ¡operaCng ¡systems, ¡web ¡browsers ¡ – Assume ¡they ¡do ¡not ¡leak ¡secret ¡data ¡ • No ¡Trust : ¡network, ¡compromised ¡clients ¡and ¡servers ¡ – Assume ¡they ¡are ¡under ¡the ¡control ¡of ¡the ¡aNacker ¡

  12. A ¡Simpler ¡VerificaCon ¡Goal ¡ Client ¡ Bank ¡ Password-­‑based ¡Authen)ca)on ¡ Client ¡and ¡ Bank ¡ share ¡ 100 ¡lines ¡of ¡data ¡ Abstract ¡ Web ¡Browser ¡ ¡ Web ¡Server ¡ ¡ A : ¡Web ¡applicaCon ¡code ¡ HTTPS ¡Session ¡ (Firefox+JS) ¡ (Apache+SQL) ¡ ¡ ¡ ¡ ¡100,000 ¡lines ¡ Cryptographic ¡ Cryptographic ¡ P ¡ : ¡Security-­‑related ¡code ¡ TLS ¡ ¡Connec)on ¡ Protocol ¡ Protocol ¡ ¡ ¡ ¡ ¡ ¡10,000 ¡lines ¡ ¡ (Windows ¡TLS) ¡ (OpenSSL) ¡ Abstract ¡ Networking ¡ Networking ¡ L : ¡System ¡libraries ¡ ¡ ¡ ¡ ¡1,000,000 ¡lines ¡ (Windows) ¡ (Linux) ¡ Insecure ¡Network ¡ O : ¡Opponent ¡ ¡ ¡ ¡ ¡<unknown> ¡lines ¡

  13. If ¡you ¡cannot ¡verify, ¡find ¡an ¡aNack ¡ • Protocols ¡are ¡designed ¡by ¡experienced ¡cryptographers ¡ – And ¡implemented ¡by ¡skilled ¡programmers ¡ • SCll, ¡serious ¡flaws ¡both ¡in ¡designs ¡and ¡implementaCons ¡ – Most ¡standards ¡got ¡it ¡wrong ¡once ¡or ¡twice ¡(SSL, ¡SSH, ¡IPSEC) ¡ – Just ¡in ¡2009, ¡bugs ¡in ¡Google ¡single-­‑sign-­‑on, ¡MicrosoO ¡Kerberos, ¡ and ¡OpenSSL ¡cerCficate ¡verificaCon ¡ Security ¡tesCng ¡does ¡not ¡help ¡much ¡ – How ¡to ¡test ¡for ¡all ¡aNack ¡scenarios? ¡ Independent ¡expert ¡review ¡may ¡help ¡ – E.g. ¡mandatory ¡Crypto ¡Board ¡review ¡for ¡any ¡non-­‑standard ¡ crypto ¡ – SCll, ¡more ¡an ¡art ¡than ¡a ¡science, ¡and ¡a ¡limited ¡resource ¡ Do ¡I ¡need ¡a ¡new ¡review ¡before ¡submikng ¡any ¡code ¡change? ¡

  14. Course ¡Outline ¡ • Write ¡web ¡applicaCons ¡in ¡F# ¡ – Using ¡simple ¡libraries ¡for ¡Networking, ¡Databases, ¡ Cryptography, ¡and ¡Key ¡Management ¡ • ¡Security ¡analysis ¡of ¡F# ¡programs ¡ – Syntax ¡and ¡semanCcs ¡of ¡F, ¡a ¡core ¡subset ¡of ¡F# ¡ – Understand ¡and ¡implement ¡aNacks ¡ – Formalize ¡security ¡properCes ¡of ¡programs ¡ • Automated ¡proofs ¡of ¡security ¡for ¡F# ¡programs ¡ – Syntax ¡and ¡semanCcs ¡of ¡applied ¡pi ¡calculus ¡ – TranslaCon ¡from ¡F ¡to ¡applied ¡pi ¡ – Verify ¡F# ¡programs ¡using ¡the ¡ProVerif ¡theorem ¡prover ¡ • Other ¡security ¡verificaCon ¡techniques ¡for ¡progams ¡ ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend