intrusion recovery for database backed web applications
play

Intrusion Recovery for Database-backed Web Applications Ramesh - PowerPoint PPT Presentation

Intrusion Recovery for Database-backed Web Applications Ramesh Chandra , Taesoo Kim, Meelap Shah, Neha Narula, Nickolai Zeldovich MIT CSAIL Web applications routinely compromised Web applications routinely compromised Web applications


  1. Intrusion Recovery for Database-backed Web Applications Ramesh Chandra , Taesoo Kim, Meelap Shah, Neha Narula, Nickolai Zeldovich MIT CSAIL

  2. Web applications routinely compromised

  3. Web applications routinely compromised

  4. Web applications routinely compromised

  5. Recovering integrity is important ● Preventing intrusions is important, but compromises will still happen ● Vulnerabilities are common, and new bugs are constantly being found [CVE] – 3-4 new vulnerabilities found per day, on average for the past 4 years ● Administrators misconfigure policies, settings ● This talk: recovering integrity after attack

  6. Cross-site scripting (XSS) bugs (simplified) Time Eve's browser Wiki pages table ID Text 5 Welcome!! Alice's browser Wiki Server

  7. Cross-site scripting (XSS) bugs (simplified) Time Eve's browser Edit page: <script>httpReq(“/addAcl?u=Eve”) </script> Wiki pages table ID ID Text Text 5 5 Welcome!! <script>...</script> Alice's browser Wiki Server

  8. Cross-site scripting (XSS) bugs (simplified) Time Eve's browser Wiki pages table ID ID Text Text <script> httpReq(“/addAcl?u=Eve”) 5 5 Welcome!! <script>...</script> </script> Alice's browser Wiki Server

  9. Cross-site scripting (XSS) bugs (simplified) Time Eve's browser Wiki pages table ID ID Text Text <script> httpReq(“/addAcl?u=Eve”) 5 5 Welcome!! <script>...</script> </script> Alice's browser Wiki Server Attack code runs as Alice

  10. Cross-site scripting (XSS) bugs (simplified) Time Eve's browser Wiki pages table ID ID Text Text <script> httpReq(“/addAcl?u=Eve”) 5 5 <script>...</script> Welcome!! </script> Legitimate Alice's requests browser Wiki Server Attack code Add Eve to ACL: runs as Alice /addAcl?u=Eve

  11. Recovering web application integrity is hard ● Web apps store data in shared data store ● Multiple users data is commingled ● Users access each other's data ● Makes recovering from attack complicated: ● Attack propagates across users ● Attack can arbitrarily corrupt user data – e.g., financial information ● Attack can install backdoors – e.g., modify ACLs, install Google apps scripts

  12. Limited recovery tools ● Backup-and-restore tools ● Attack may be detected days or weeks later ● Restoring from backup discards all users' changes ● Manual recovery ● Admin spends days or weeks tracking attack's effects ● Admin could miss a subtle backdoor or corruption

  13. Contributions ● Warp: web application intrusion recovery ● Undoes effects of attack but keeps legitimate changes ● Works for real applications: MediaWiki, Drupal, Gallery2 ● Key ideas: ● Retroactive patching eliminates need to pinpoint attack ● Time-travel DB precisely tracks causal effects ● DOM-level replay preserves users' intended changes

  14. High-level approach: rollback and re-execute ● Normal execution ● Record actions in system to a log ● Record causal dependencies between actions ● Record checkpoints system state ● Repair ● Identify attack action ● Rollback affected system state to before attack ● Replay all affected actions except attack action

  15. Normal execution Time Eve's browser Eve's Req Wiki pages table ID Text 5 <script>...</script> ID Text 5 Welcome!! Dependencies Dependencies Alice's Req Alice's Warp logs browser Warp state … … Wiki Server

  16. Normal execution Time Eve's browser Eve's Req Wiki pages table ID Text Log HTTP requests 5 <script>...</script> Log database ID Text queries 5 Welcome!! Server actions Server Server actions Dependencies Dependencies Alice's Req Alice's Warp logs browser Warp state … … Wiki Server

  17. Normal execution Time Eve's browser Eve's Req Wiki pages table ID Text ID Text 5 Welcome!! Maintain 5 <script>...</script> ID Text checkpoints Checkpoints of database 5 Welcome!! Server actions Server actions Server Server Server actions Server actions Dependencies Dependencies Dependencies Dependencies Alice's Req Alice's Warp logs Warp logs browser Warp state Warp state … … Wiki Server

  18. Normal execution Time Eve's browser Eve's Req Wiki pages table ID Text ID Text Record 5 Welcome!! 5 <script>...</script> user actions ID Text using a browser Checkpoints 5 Welcome!! extension Server actions Server Server actions Dependencies Dependencies Alice's Req Alice's Client actions Client actions Warp logs browser Warp state … … Wiki Server Client actions

  19. Strawman repair Time Eve's browser Eve's Req Wiki pages table ID Text ID Text 5 Welcome!! 5 <script>...</script> ID Text Checkpoints 5 Welcome!! Server actions Server Server actions Dependencies Dependencies Alice's Req Alice's Warp client log Client actions Client actions Warp logs browser Warp state … … Wiki Server

  20. Repair: identify attack Time Eve's browser Eve's Req Wiki pages table ID Text ID Text Attack action 5 Welcome!! 5 <script>...</script> ID Text Checkpoints 5 Welcome!! Server actions Dependencies Alice's Req Alice's Client actions browser Warp state … … Wiki Server

  21. Repair: rollback to before attack Time Eve's browser Eve's Req Wiki pages table ID Text Rollback DB 5 Welcome!! ID Text Checkpoints 5 Welcome!! Server actions Server Server actions Dependencies Dependencies Alice's Req Alice's Warp client log Client actions Client actions Warp logs browser Warp state … … Wiki Server

  22. Repair: skip attack action X Time Eve's X browser X Eve's Req X Wiki pages table ID Text 5 Welcome!! ID Text Checkpoints 5 Welcome!! Server actions Server Server actions Dependencies Dependencies Alice's Req Alice's Warp client log Client actions Client actions Warp logs browser Warp state … … Wiki Server

  23. Repair: re-execute subsequent actions X Time Eve's X browser X Eve's Req X Wiki pages table ID Text Re-execute Alice's actions in 5 Welcome!! shadow browser Checkpoints Server actions Server Server actions Dependencies Dependencies Alice's Req Alice's Warp client log Client actions Client actions Warp logs browser Warp state … … Wiki Server Warp client log Client actions

  24. Repair: re-execute subsequent actions X Time Eve's X browser X Eve's Req X Wiki pages table ID Text 5 Welcome!! New response: Welcome!! Checkpoints Server actions Server Server actions Dependencies Dependencies Alice's Req Alice's Warp client log Client actions Client actions Warp logs browser Warp state … … Wiki Server Warp client log Client actions No attack code

  25. Repair: re-execute subsequent actions X Time Eve's X browser X Eve's Req X Wiki pages table ID Text 5 Welcome!! Checkpoints Server actions Server Server actions Preserve Dependencies Dependencies Alice's Req legitimate requests Alice's Warp client log Client actions Client actions Warp state browser Warp state X … … Wiki Server Client actions Skip attack requests

  26. Challenges to intrusion recovery X Time Eve's X browser Wiki pages table ID Text ID Text 5 Welcome!! 5 Welcome!! Alice's browser X Wiki Server

  27. Challenges to intrusion recovery X Time Eve's Must pinpoint X browser intrusion in a complex app Wiki pages table ID Text ID Text 5 Welcome!! 5 Welcome!! Alice's browser X Wiki Server

  28. Challenges to intrusion recovery X Time Eve's Must pinpoint X browser intrusion in a complex app Bob's Wiki pages table Must reduce browser unnecessary ID Text ID Text re-execution 5 Welcome!! 5 Welcome!! Alice's browser X Wiki Server

  29. Challenges to intrusion recovery X Time Eve's Must pinpoint X browser intrusion in a complex app Bob's Wiki pages table Must reduce browser unnecessary ID Text ID Text re-execution 5 Welcome!! 5 Welcome!! Alice's Must reduce browser X user involvement during repair Wiki Server

  30. Challenge 1: intrusion detection is difficult Time Eve's browser Need expert Wiki pages table to pinpoint attack ID Text ID ID Text Text 5 Welcome!! 5 5 Welcome!! <script>...</script> Alice's browser Wiki Server

  31. Idea: retroactive patching ● Key observation: patch renders attacks harmless ● Approach: ● Retroactively apply security patches back in time ● Re-execute all affected requests

  32. Retroactive patching Time Eve's browser Eve's Req Wiki pages table ID Text ID Text 5 Welcome!! 5 <script>...</script> ID Text 5 Welcome!! Alice's Req Alice's browser … … Wiki Server

  33. Retroactive patching: normal execution Time Eve's main.php browser Eve's Req Wiki pages table ID Text ID Text 5 Welcome!! 5 <script>...</script> ID Text 5 Welcome!! Alice's Req Alice's browser … … Wiki Server

  34. Retroactive patching: repair Time Eve's main.php browser Eve's Req Wiki pages table ID Text ID Text 5 Welcome!! 5 <script>...</script> ID Text 5 Welcome!! Alice's Req Alice's browser … … Wiki Server

Recommend


More recommend