Your SlideShare is downloading. ×
Looking for Vulnerable Code. Vlad Savitsky
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Looking for Vulnerable Code. Vlad Savitsky


Published on

How to find vulnerable code in your Drupal project? …

How to find vulnerable code in your Drupal project?
Different attacks and how to protect your site?
What to do if you find security problem in code/site?

Published in: Technology

1 Like
  • Be the first to comment

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

No notes for slide


  • 1. Are you sure thatyour site is secure? secure
  • 2. Site security ● Trusted, experienced and secure hosting ● Secure code ● Security updates
  • 3. Security Updates● Subscribe to Security-news● Use Drupal 7 core module Update Manager.
  • 4. How secure is Drupal code? code
  • 5. Types of vulnerabilities
  • 6. Is Your Drupal-site Code Secure?
  • 7. Speaker: Vlad Savitsky Working at Skype: vlad_savitsky ICQ: 205535814 +38096 530 27 12
  • 8. Challenge●● Gruyere /ɡruːˈjɛər/ - a small, cheesy web application that allows its users to publish snippets of text and store assorted files.● "Unfortunately," Gruyere has multiple security bugs ranging from cross-site scripting and cross- site request forgery, to information disclosure, denial of service, and remote code execution.The goal is to discover bugs in Gruyere.
  • 9. Cross-site scripting (XSS)● Allows attackers to inject script into Web pages viewed by other users.●
  • 10. Handling Data Golden Rule● Store exactly what the user typed.● When handling and outputting text in HTML, you need to be careful that proper filtering or escaping is done.
  • 11. 1. User sends some data User Input DrupalUser Invalid Input Code Validated User Input Database
  • 12. 2. Attacker sends code 1. Input JS DrupalUser Code 2. Not Well Validated Input JS Database
  • 13. 3. User request a page 1. Request DrupalUser JS 3. Not Well Code Escaped Data 2. SQL-Query JS Database
  • 14. 4. User runs Attackers code Browser 1. View page User HTML page Attackers 2. Send data JavaScript Code User
  • 15. Access Bypass 1. Request /devel/php DrupalUser Code 2. Get Access
  • 16. Cross-site request forgery● Ability to run some actions at server accessing some URL.● Also known as a one-click attack or session riding and abbreviated as CSRF (pronounced sea-surf) or XSRF.●
  • 17. 1. Find URL User Profile Save Save Delete Delete
  • 18. 2. Post URL Server 1. Post page User HTML page2. Send URL <img 3. Open URL src=”URL” />Admin
  • 19. Arbitrary code execution● Ability to execute any commands of the attackers choice on a target machine or in a target process.●
  • 20. Session fixation● Session fixation attacks attempt to exploit the vulnerability of a system which allows one person to fixate (set) another persons session identifier (SID).● Most session fixation attacks are web based, and most rely on session identifiers being accepted from URLs (query string) or POST data.●
  • 21. 1. Send URL with SID 1. Send URL Admin 2. LoginDrupal
  • 22. 2. Get Admins session 3. Login as admin URL Drupal Code
  • 23.
  • 24.
  • 25. How to find a vulnerability?
  • 26. XSS high-risk zones● theme(). ● Templates (.tpl.php).● t() and l(). ● Themes code.● dpm(). ● Preprocess functions.● echo(). ● $form_state values.● var_dump(). ● Validation messages● console.log(). and default values.● watchdog(). ● Field type select and options attribute.● drupal_set_message(). ● drupal_set_title().
  • 27. XSS Test<script>alert(xss);</script><img src=”notfound.png” onerror=”alert(xss);”>watchdog(type,message <scripttype="text/javascript">alert("xss");</script>);
  • 28. How to find XSRF?● Inspect hook_menu().● Inspect AJAX callbacks.● If secure tokens not used used then XSRF is possible● See drupal_get_token().
  • 29. Access bypass● Check hook_permissions().● Search for permission names.● Check access_callbacks in hook_menu().● Check if code works correctly with other contributed modules and respects their access restrictions.
  • 30. Code Execution● Search for eval, system and etc.● Check code includes.● Check if files with code could be executed.● Search for php input format for blocks, nodes, fields and etc.● Check if modules like devel, php and etc. enabled.● Check if uploading files with php-code is possible.
  • 31. SQL injection● Static queries.
  • 32. Drupal Security Team
  • 33. Goals of the security team● Resolve reported security issues.● Provide assistance for contributed module maintainers in resolving security issues.● Provide documentation on how to write secure code.● Provide documentation on securing your site.
  • 34. How to report a security issue● Do not post in the issue tracker or discuss it in IRC.● Mail to● Provide as many details as you can. At least: ● Drupal version and/or module version. ● Steps to reproduce the problem.● Do not disclose the vulnerability to anyone before the advisory is issued.● You will be credited in the security announcement.
  • 35. How the security team works with issues?● Review the issue and evaluate the potential impact on all supported releases of Drupal.● If it is indeed a valid problem, the security team is mobilized to eliminate it.● New versions are created and tested.● New packages are created and uploaded to● When an issue has been fixed, use all available communication channels to inform users of steps that must be taken to protect themselves.
  • 36. Issues with contributed modules● The module maintainer is contacted with a deadline.● When the maintainer fixes the problem, the security team issues an advisory.● If the maintainer does not fix the problem within the deadline, an advisory is issued, recommending disabling the module and the project on is unpublished.
  • 37. Additional Reading● Core Security Advisories● Contributed Project Security Advisories● The Drupal Security Team● Secure confguration of your Drupal site● Writing secure code● Cracking Drupal – The Drupal security book● This papers website● OWASP Top Ten Project
  • 38. Questions to speaker Vlad Savitsky Skype: vlad_savitsky ICQ: 205535814 +38 096 530 27 12