widgets web vulnerabilities for all little helpers web 2
play

widgets - web vulnerabilities for all little helpers web 2.0 - PowerPoint PPT Presentation

widgets - web vulnerabilities for all little helpers web 2.0 html / css / javascript easy to install safe secure convenient FAIL javascript outside the web with full control over the local machine widget.system runCommand


  1. widgets - web vulnerabilities for all

  2. little helpers

  3. web 2.0

  4. html / css / javascript

  5. easy to install

  6. safe secure convenient

  7. FAIL

  8. javascript outside the web

  9. with full control over the local machine

  10. widget.system runCommand System.Shell. execute

  11. run a command in the system’s shell

  12. when was your computer’s last cross-site scripting vulnerability?

  13. e.g., GMail

  14. var titleText = MessagesTable. getTitleTextFromEntryElement(currentEntry); titleText = '&nbsp;&nbsp;&nbsp;<span class="title-class">' + titleText + '</span>'; // (skipping code to build message summary) titleText = "<div class='table-overflow-col'>" + titleText + "</div>"; titleColumn.innerHTML = titleText;

  15. titleColumn. innerHTML = titleText;

  16. who controls titleText?

  17. Subject: <i>hi!</i>

  18. hi!

  19. we can write html into the dom, by sending e-mail

  20. scripts?

  21. innerHTML handles <script> strangely

  22. event handlers work just fine

  23. <a onmouseover=” ...”>

  24. <img src=”404.gif” onerror=”...”>

  25. hacking through e-mail

  26. output sanitization

  27. entity-escape strings before writing them to the dom

  28. Google announced fix in December

  29. vulnerable versions don’t work any more

  30. how about rendering html?

  31. say, from Wikipedia

  32. html parsing required by design

  33. bake your own?

  34. .innerHTML!

  35. I OWNZ UR COMPUTR http://en.wikipedia.org/wiki/Image:Jimmy-wales-frankfurt2005-alih01.jpg

  36. say, in an rss reader

  37. the disaster is one click away

  38. (incidentally, forget your firewall)

  39. can we have shrimps in that turducken?

  40. widget.system and friends call the shell

  41. Secure Unix Programming FAQ 1999/05/17

  42. 6.3) How do I safely pass input to an external program?

  43. “One of the biggest mistakes is to use a shell. ...”

  44. what’s new in that svn repository?

  45. notification through growl

  46. command = baseCommand // title (note the trailing space) + '"' + projLabel + ' is out of date" ' // message + '"You have revision r' + my_rev + ', and the repository has been updated to r' + repos_rev + ' by ' + repos_rev_author + ' with the following message:\n\n' + repos_rev_msg + '"';

  47. "; touch /tmp/gotcha; echo "

  48. hacking through svn commit messages

  49. there’s similar code in the wikipedia widget

  50. web 2.0

  51. JSON

  52. eval

  53. twitgit twitterlex facebook

  54. json based apis

  55. XMLHttpRequest eval

  56. twitter facebook

  57. not quite a JSON example

  58. var xmlResponse = xmlRequest.responseText xmlResponse = xmlResponse.replace(/[\n\r]/g,""); var NHLatl = null; var gameData = xmlResponse.match(/script[^<]*var NHLatl.*?<\/ script>/)[0].replace(/.*?var /,"").replace(/, \s*myScoresIcon.*/,"}"); eval(gameData);

  59. screen- scraping through eval

  60. another pattern: use JSON to check for updates

  61. this._checkVersion (transport. responseText. evalJSON());

  62. default json parser: eval

  63. widget doesn’t turn on sanitization

  64. frameworks may be less secure than you think

  65. “You’re trusting them anyway, so why bother?”

  66. http

  67. leverage network attack into machine takeover

  68. security of update servers at all times

  69. robustness against cross- site scripting

  70. http://ddanchev.blogspot.com/2008/03/more-high-profile-sites-iframe-injected.html

  71. “more high profile sites iframe injected”

  72. widgets are a predictor

  73. javascript as programming language of choice?

  74. sms application, web-based, widget-style?

  75. social network worms that create zombies?

  76. targeted attacks with plausible deniability?

  77. the flaws aren’t rocket science

  78. Secure Unix Programming FAQ 1999/05/17

  79. bugtraq 1996

  80. widespread

  81. trivial to exploit

  82. easy to find

  83. json-based api?

  84. shows html?

  85. uses external programs?

  86. oooops

Recommend


More recommend