SlideShare a Scribd company logo
1 of 49
Drupal security
             Gábor Hojtsy , Acquia




   February 27. 2010, Drupalcamp Bratislava
With special thanks to Four Kitchens, Greg Knaddison and Jakub Suchy
Why I’m here?

• Stepping in for Jakub Suchy
• Co-maintainer to Drupal 6
• De-facto member of the security team
Are you affected?
With relatively simple holes,
your administrator user can
be taken over.
Open Web Application
           Security Project’s
              Top 10 risks
http://www.owasp.org/images/0/0f/OWASP_T10_-_2010_rc1.pdf
Security misconfiguration
Secure server

• Avoid using FTP at all cost (Total
  Commander is the enemy)
• Who do you share your server with? Are
  you confident?
• Keep your OS, PHP, SQL server, etc. up
  to date
Secure Drupal

• Is your admin password “admin”?
• Look at all “administer *” permissions
• “administer filters” can take over a site
• Use update.module, watch the security
  news (Wednesdays)
Secure Drupal

• Avoid any kind of PHP input, write your
  own modules instead
• Watch your input formats (you can be
  googled)
Injection
index.php?id=12


mysql_query(“UPDATE mytable
SET value = ‘”. $value .”’
WHERE id = ”. $_GET[‘id’]);
Drupal approach

• db_query(“UPDATE {mytable} SET
  value = ‘%s’ WHERE id = %d”, $value,
  $id);
• If you need to include dynamic table or
  column names in your query, see
  db_escape_table()
Cross Site Scripting (XSS)
index.php?id=12
print $_GET[‘id’];


$output .= $node->title;
Giving full HTML access.
66%
  likeliness a website has
 Cross site scripting issues
http://www.whitehatsec.com/home/assets/presentations/09PPT/PPT_statsfall09_8th.pdf
jQuery.get('/user/1/edit',
   function (data, status) {
     if (status == 'success') {
       var p = /id="edit-user-edit-form-token"
value="([a-z0-9]*)"/;
       var matches = data.match(p);
       var token = matches[1];
       var payload = {
          "form_id": 'user_edit',
          "form_token": token,
          "pass[pass1]": 'hacked',
          "pass[pass2]": 'hacked'
       };
       jQuery.post('/user/1/edit', payload);
     }
   }
);

                 Example from Heine Deelstra, Drupal Security team lead
                  http://heine.familiedeelstra.com/change-password-xss
Drupal approach

• check_plain() to escape text to HTML
• check_markup() to format text to HTML
• filter_xss() to filter text to HTML
• filter_xss_admin() to filter admin text to HTML
• node_view($node) instead of $node->body
Drupal approach
•   t(), format_plural() placeholders:
    %name, @url, !insecure

    t(‘%name has a blog at <a
    href=”@url”>@url</a>’, array(‘@url’ =>
    valid_url($user->profile_blog), ‘%name’
    => $user->name));
•   Use Drupal.t(), Drupal.formatPlural() in JS.
Authentication
 & sessions
• Weak password storage and
 account management
• Session hijacking / fixation
• Lack of session timeout /
 logout
Drupal approach

•   Passwords are stored encrypted
•   Session IDs changed when permissions
    change
•   Drupal works with Apache’s SSL transport
•   Modules to set certain URLs to use SSL
Insecure direct object references
index.php?id=12


db_query(“SELECT * FROM {user}
WHERE id = %d”, $_GET[‘id’]);
Drupal approach
• Menu system handles permission checking
• user_access(‘administer nodes’, $account)
• node_access(‘edit’, $node, $account);
• db_query(db_rewrite_sql(‘SELECT title
  FROM {node} n’));
• Form API checks for data validity
Cross Site Request
 Forgery (CSRF)
http://example.com/index.php?
delete=12


<img src=”http://example.com/
index.php?delete=12” />
Drupal approach
• Form API works with POST submissions
  by default (makes it harder)
• Form API includes form tokens, requires
  form retrieval before submission, checks
  valid values
• drupal_valid_token() provided to
  generate/validate tokens for GET requests
Failure to restrict
   URL access
Drupal approach


• Menu system uses access callback and
  access arguments
• Continually review permissions
Unvalidated
redirections
http://example.com/index.php?
target=evil.com
Drupal approach

• Drupal has various internal
  redirections, which use local paths and
  generate URLs based on them
• Look for use of drupal_goto() and Form
  API #redirect instances in your
  modules to validate their compliance
Insecure cryptographic storage
Drupal approach
• Drupal stores user passwords encrypted
  with a one-way hash
• Different randomly generated private
  key is provided on each site, which can
  be used to do reversible encryption
• Up to you to ensure backups are
  properly protected
Insufficient transport protection
Drupal approach
• Run Drupal on top of full SSL
• Use securepages and
  securepages_prevent_hijack to wall
  your important pages
• http://crackingdrupal.com/blog/
  greggles/drupal-and-ssl-multiple-
  recipes-possible-solutions
• Use a valid certificate
Is Open Source
    secure?
“Open Source is
       secure”

• Open Source makes people look at it
• Popularity gets more eyes
• There are always more smart people to
  find and fix problems
“Open Source is
       insecure”
• People can equally find holes
• Some people (inadvertently) disclose
  issues in the public
• Fix becomes public and can / will be
  reviewed
Is Drupal secure?
Developers and users
• Drupal APIs are designed to be secure
• It is eventually up to programmers to
  use them that way
• http://drupal.org/writing-secure-code
• Tools designed for security can still be
  misconfigured
Drupal security team


A team of volunteers working to ensure
best security of Drupal and thousands of
contributed modules
Design. Educate. Fix.
What’s supported?
• Drupal core and all(!) contributed
  project on drupal.org
• Not actively looking for vulnerabilities
  in contributed modules
• Stable releases and development
  versions (for very popular modules)
• Only current and one earlier versions
  are supported: now 6.x, 5.x
Points of contact

• Releases at http://drupal.org/security
• Reporting issues: http://drupal.org/
  node/101494
• Reporting cracked sites: http://
  drupal.org/node/213320
These slides are (CC)
                       Images used:
       http://www.flickr.com/photos/rtv/2398561954/
       http://www.flickr.com/photos/jonk/19422564/
     http://www.flickr.com/photos/duncan/2693141693/
     http://www.flickr.com/photos/duncan/2742371814
 http://www.flickr.com/photos/jontintinjordan/3736095793/
    http://www.flickr.com/photos/djbrady/2304740173/
    http://www.flickr.com/photos/inkytwist/2654071573/
     http://www.flickr.com/photos/duncan/2741594585/
  http://www.flickr.com/photos/shellysblogger/2924699161/
  http://www.flickr.com/photos/blogumentary/434097609/
    http://www.flickr.com/photos/glamhag/2214986176/
     http://www.flickr.com/photos/duncan/2693140217/




This presentation is © Gábor Hojtsy
Licensed: Licensed: http://creativecommons.org/licenses/by-nc-sa/2.0/
Questions?
Thank you!
 Gábor Hojtsy, Acquia
http://twitter.com/gaborhojtsy

More Related Content

What's hot

Hypermedia: The Missing Element to Building Adaptable Web APIs in Rails
Hypermedia: The Missing Element to Building Adaptable Web APIs in RailsHypermedia: The Missing Element to Building Adaptable Web APIs in Rails
Hypermedia: The Missing Element to Building Adaptable Web APIs in RailsToru Kawamura
 
Beautiful REST+JSON APIs with Ion
Beautiful REST+JSON APIs with IonBeautiful REST+JSON APIs with Ion
Beautiful REST+JSON APIs with IonStormpath
 
Case Study of Django: Web Frameworks that are Secure by Default
Case Study of Django: Web Frameworks that are Secure by DefaultCase Study of Django: Web Frameworks that are Secure by Default
Case Study of Django: Web Frameworks that are Secure by DefaultMohammed ALDOUB
 
Reviewing RESTful Web Apps
Reviewing RESTful Web AppsReviewing RESTful Web Apps
Reviewing RESTful Web AppsTakuto Wada
 
Building Beautiful REST APIs in ASP.NET Core
Building Beautiful REST APIs in ASP.NET CoreBuilding Beautiful REST APIs in ASP.NET Core
Building Beautiful REST APIs in ASP.NET CoreStormpath
 
Introduction to jQuery Mobile - Web Deliver for All
Introduction to jQuery Mobile - Web Deliver for AllIntroduction to jQuery Mobile - Web Deliver for All
Introduction to jQuery Mobile - Web Deliver for AllMarc Grabanski
 
1.6 米嘉 gobuildweb
1.6 米嘉 gobuildweb1.6 米嘉 gobuildweb
1.6 米嘉 gobuildwebLeo Zhou
 
Cached and Confused: Web Cache Deception in the Wild
Cached and Confused: Web Cache Deception in the WildCached and Confused: Web Cache Deception in the Wild
Cached and Confused: Web Cache Deception in the WildSajjad "JJ" Arshad
 
Build a Node.js Client for Your REST+JSON API
Build a Node.js Client for Your REST+JSON APIBuild a Node.js Client for Your REST+JSON API
Build a Node.js Client for Your REST+JSON APIStormpath
 
Building Beautiful REST APIs in ASP.NET Core
Building Beautiful REST APIs in ASP.NET CoreBuilding Beautiful REST APIs in ASP.NET Core
Building Beautiful REST APIs in ASP.NET CoreNate Barbettini
 
OWASP Top 10 vs Drupal - OWASP Benelux 2012
OWASP Top 10 vs Drupal - OWASP Benelux 2012OWASP Top 10 vs Drupal - OWASP Benelux 2012
OWASP Top 10 vs Drupal - OWASP Benelux 2012ZIONSECURITY
 
Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Ryan Price
 
Custom Post Types in Depth at WordCamp Montreal
Custom Post Types in Depth at WordCamp MontrealCustom Post Types in Depth at WordCamp Montreal
Custom Post Types in Depth at WordCamp MontrealJoey Kudish
 
Rails Gems realize RESTful modeling patterns
Rails Gems realize RESTful modeling patternsRails Gems realize RESTful modeling patterns
Rails Gems realize RESTful modeling patternsToru Kawamura
 
Cwinters Intro To Rest And JerREST and Jersey Introductionsey
Cwinters Intro To Rest And JerREST and Jersey IntroductionseyCwinters Intro To Rest And JerREST and Jersey Introductionsey
Cwinters Intro To Rest And JerREST and Jersey Introductionseyelliando dias
 

What's hot (20)

Why Django
Why DjangoWhy Django
Why Django
 
Hypermedia: The Missing Element to Building Adaptable Web APIs in Rails
Hypermedia: The Missing Element to Building Adaptable Web APIs in RailsHypermedia: The Missing Element to Building Adaptable Web APIs in Rails
Hypermedia: The Missing Element to Building Adaptable Web APIs in Rails
 
Beautiful REST+JSON APIs with Ion
Beautiful REST+JSON APIs with IonBeautiful REST+JSON APIs with Ion
Beautiful REST+JSON APIs with Ion
 
Case Study of Django: Web Frameworks that are Secure by Default
Case Study of Django: Web Frameworks that are Secure by DefaultCase Study of Django: Web Frameworks that are Secure by Default
Case Study of Django: Web Frameworks that are Secure by Default
 
Reviewing RESTful Web Apps
Reviewing RESTful Web AppsReviewing RESTful Web Apps
Reviewing RESTful Web Apps
 
Building Beautiful REST APIs in ASP.NET Core
Building Beautiful REST APIs in ASP.NET CoreBuilding Beautiful REST APIs in ASP.NET Core
Building Beautiful REST APIs in ASP.NET Core
 
WebCrawler
WebCrawlerWebCrawler
WebCrawler
 
Introduction to jQuery Mobile - Web Deliver for All
Introduction to jQuery Mobile - Web Deliver for AllIntroduction to jQuery Mobile - Web Deliver for All
Introduction to jQuery Mobile - Web Deliver for All
 
Rest and Rails
Rest and RailsRest and Rails
Rest and Rails
 
1.6 米嘉 gobuildweb
1.6 米嘉 gobuildweb1.6 米嘉 gobuildweb
1.6 米嘉 gobuildweb
 
Cached and Confused: Web Cache Deception in the Wild
Cached and Confused: Web Cache Deception in the WildCached and Confused: Web Cache Deception in the Wild
Cached and Confused: Web Cache Deception in the Wild
 
Rest in Rails
Rest in RailsRest in Rails
Rest in Rails
 
Build a Node.js Client for Your REST+JSON API
Build a Node.js Client for Your REST+JSON APIBuild a Node.js Client for Your REST+JSON API
Build a Node.js Client for Your REST+JSON API
 
Building Beautiful REST APIs in ASP.NET Core
Building Beautiful REST APIs in ASP.NET CoreBuilding Beautiful REST APIs in ASP.NET Core
Building Beautiful REST APIs in ASP.NET Core
 
OWASP Top 10 vs Drupal - OWASP Benelux 2012
OWASP Top 10 vs Drupal - OWASP Benelux 2012OWASP Top 10 vs Drupal - OWASP Benelux 2012
OWASP Top 10 vs Drupal - OWASP Benelux 2012
 
Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011
 
Custom Post Types in Depth at WordCamp Montreal
Custom Post Types in Depth at WordCamp MontrealCustom Post Types in Depth at WordCamp Montreal
Custom Post Types in Depth at WordCamp Montreal
 
Rails Gems realize RESTful modeling patterns
Rails Gems realize RESTful modeling patternsRails Gems realize RESTful modeling patterns
Rails Gems realize RESTful modeling patterns
 
Cwinters Intro To Rest And JerREST and Jersey Introductionsey
Cwinters Intro To Rest And JerREST and Jersey IntroductionseyCwinters Intro To Rest And JerREST and Jersey Introductionsey
Cwinters Intro To Rest And JerREST and Jersey Introductionsey
 
Free django
Free djangoFree django
Free django
 

Similar to Drupal security

Doing Drupal security right
Doing Drupal security rightDoing Drupal security right
Doing Drupal security rightGábor Hojtsy
 
Drupal Security from Drupalcamp Bratislava
Drupal Security from Drupalcamp BratislavaDrupal Security from Drupalcamp Bratislava
Drupal Security from Drupalcamp BratislavaGábor Hojtsy
 
Doing Drupal security right from Drupalcon London
Doing Drupal security right from Drupalcon LondonDoing Drupal security right from Drupalcon London
Doing Drupal security right from Drupalcon LondonGábor Hojtsy
 
Staying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPStaying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPOscar Merida
 
Staying Sane with Drupal (A Develper's Survival Guide)
Staying Sane with Drupal (A Develper's Survival Guide)Staying Sane with Drupal (A Develper's Survival Guide)
Staying Sane with Drupal (A Develper's Survival Guide)Oscar Merida
 
Drupal security
Drupal securityDrupal security
Drupal securityTechday7
 
Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Drupalcon Paris
 
Drupal Security from Drupalcamp Cologne 2009
Drupal Security from Drupalcamp Cologne 2009Drupal Security from Drupalcamp Cologne 2009
Drupal Security from Drupalcamp Cologne 2009Gábor Hojtsy
 
Drupal campleuven: Secure Drupal Development
Drupal campleuven: Secure Drupal DevelopmentDrupal campleuven: Secure Drupal Development
Drupal campleuven: Secure Drupal DevelopmentSteven Van den Hout
 
Drupal 8 - Core and API Changes
Drupal 8 - Core and API ChangesDrupal 8 - Core and API Changes
Drupal 8 - Core and API ChangesShabir Ahmad
 
Extending drupal authentication
Extending drupal authenticationExtending drupal authentication
Extending drupal authenticationCharles Russell
 
Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8Angela Byron
 
Securing Drupal 7: Do not get Hacked or Spammed to death!
Securing Drupal 7: Do not get Hacked or Spammed to death!Securing Drupal 7: Do not get Hacked or Spammed to death!
Securing Drupal 7: Do not get Hacked or Spammed to death!Adelle Frank
 
An Introduction to Tornado
An Introduction to TornadoAn Introduction to Tornado
An Introduction to TornadoGavin Roy
 
Absolute Beginners Guide to Drupal
Absolute Beginners Guide to DrupalAbsolute Beginners Guide to Drupal
Absolute Beginners Guide to DrupalRod Martin
 
Django Overview
Django OverviewDjango Overview
Django OverviewBrian Tol
 
Everything You Need to Know About the Top Changes in Drupal 8
Everything You Need to Know About the Top Changes in Drupal 8Everything You Need to Know About the Top Changes in Drupal 8
Everything You Need to Know About the Top Changes in Drupal 8Acquia
 

Similar to Drupal security (20)

Doing Drupal security right
Doing Drupal security rightDoing Drupal security right
Doing Drupal security right
 
Drupal Security from Drupalcamp Bratislava
Drupal Security from Drupalcamp BratislavaDrupal Security from Drupalcamp Bratislava
Drupal Security from Drupalcamp Bratislava
 
Doing Drupal security right from Drupalcon London
Doing Drupal security right from Drupalcon LondonDoing Drupal security right from Drupalcon London
Doing Drupal security right from Drupalcon London
 
Staying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPStaying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHP
 
Staying Sane with Drupal (A Develper's Survival Guide)
Staying Sane with Drupal (A Develper's Survival Guide)Staying Sane with Drupal (A Develper's Survival Guide)
Staying Sane with Drupal (A Develper's Survival Guide)
 
Drupal security
Drupal securityDrupal security
Drupal security
 
Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3
 
Drupal Security Hardening
Drupal Security HardeningDrupal Security Hardening
Drupal Security Hardening
 
Drupal Security Hardening
Drupal Security HardeningDrupal Security Hardening
Drupal Security Hardening
 
Drupal Security from Drupalcamp Cologne 2009
Drupal Security from Drupalcamp Cologne 2009Drupal Security from Drupalcamp Cologne 2009
Drupal Security from Drupalcamp Cologne 2009
 
Drupal campleuven: Secure Drupal Development
Drupal campleuven: Secure Drupal DevelopmentDrupal campleuven: Secure Drupal Development
Drupal campleuven: Secure Drupal Development
 
Drupal 8 - Core and API Changes
Drupal 8 - Core and API ChangesDrupal 8 - Core and API Changes
Drupal 8 - Core and API Changes
 
Extending drupal authentication
Extending drupal authenticationExtending drupal authentication
Extending drupal authentication
 
Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8
 
Securing Drupal 7: Do not get Hacked or Spammed to death!
Securing Drupal 7: Do not get Hacked or Spammed to death!Securing Drupal 7: Do not get Hacked or Spammed to death!
Securing Drupal 7: Do not get Hacked or Spammed to death!
 
DrupalCon 2011 Highlight
DrupalCon 2011 HighlightDrupalCon 2011 Highlight
DrupalCon 2011 Highlight
 
An Introduction to Tornado
An Introduction to TornadoAn Introduction to Tornado
An Introduction to Tornado
 
Absolute Beginners Guide to Drupal
Absolute Beginners Guide to DrupalAbsolute Beginners Guide to Drupal
Absolute Beginners Guide to Drupal
 
Django Overview
Django OverviewDjango Overview
Django Overview
 
Everything You Need to Know About the Top Changes in Drupal 8
Everything You Need to Know About the Top Changes in Drupal 8Everything You Need to Know About the Top Changes in Drupal 8
Everything You Need to Know About the Top Changes in Drupal 8
 

More from Jozef Toth

Drupalfund - crowdfunding the future of Drupal development
Drupalfund - crowdfunding the future of Drupal developmentDrupalfund - crowdfunding the future of Drupal development
Drupalfund - crowdfunding the future of Drupal developmentJozef Toth
 
Drupal 8 logo design concepts
Drupal 8 logo design conceptsDrupal 8 logo design concepts
Drupal 8 logo design conceptsJozef Toth
 
Seo Pro Drupal Developery
Seo Pro Drupal DeveloperySeo Pro Drupal Developery
Seo Pro Drupal DeveloperyJozef Toth
 
Drupal V Biznise
Drupal V BizniseDrupal V Biznise
Drupal V BizniseJozef Toth
 
Drupal V Biznise
Drupal V BizniseDrupal V Biznise
Drupal V BizniseJozef Toth
 
Drupal ako nízkonákladová platforma pre business web aplikácie
Drupal ako nízkonákladová platforma pre business web aplikácieDrupal ako nízkonákladová platforma pre business web aplikácie
Drupal ako nízkonákladová platforma pre business web aplikácieJozef Toth
 
Freelancer's toolbox
Freelancer's toolboxFreelancer's toolbox
Freelancer's toolboxJozef Toth
 
Drupal - Open Source CMS
Drupal - Open Source CMSDrupal - Open Source CMS
Drupal - Open Source CMSJozef Toth
 

More from Jozef Toth (9)

Drupalfund - crowdfunding the future of Drupal development
Drupalfund - crowdfunding the future of Drupal developmentDrupalfund - crowdfunding the future of Drupal development
Drupalfund - crowdfunding the future of Drupal development
 
Drupal 8 logo design concepts
Drupal 8 logo design conceptsDrupal 8 logo design concepts
Drupal 8 logo design concepts
 
Seo Pro Drupal Developery
Seo Pro Drupal DeveloperySeo Pro Drupal Developery
Seo Pro Drupal Developery
 
Drupal V Biznise
Drupal V BizniseDrupal V Biznise
Drupal V Biznise
 
Drupal V Biznise
Drupal V BizniseDrupal V Biznise
Drupal V Biznise
 
Co je Drupal
Co je DrupalCo je Drupal
Co je Drupal
 
Drupal ako nízkonákladová platforma pre business web aplikácie
Drupal ako nízkonákladová platforma pre business web aplikácieDrupal ako nízkonákladová platforma pre business web aplikácie
Drupal ako nízkonákladová platforma pre business web aplikácie
 
Freelancer's toolbox
Freelancer's toolboxFreelancer's toolbox
Freelancer's toolbox
 
Drupal - Open Source CMS
Drupal - Open Source CMSDrupal - Open Source CMS
Drupal - Open Source CMS
 

Recently uploaded

Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 

Recently uploaded (20)

Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

Drupal security

  • 1. Drupal security Gábor Hojtsy , Acquia February 27. 2010, Drupalcamp Bratislava With special thanks to Four Kitchens, Greg Knaddison and Jakub Suchy
  • 2. Why I’m here? • Stepping in for Jakub Suchy • Co-maintainer to Drupal 6 • De-facto member of the security team
  • 4. With relatively simple holes, your administrator user can be taken over.
  • 5. Open Web Application Security Project’s Top 10 risks http://www.owasp.org/images/0/0f/OWASP_T10_-_2010_rc1.pdf
  • 7. Secure server • Avoid using FTP at all cost (Total Commander is the enemy) • Who do you share your server with? Are you confident? • Keep your OS, PHP, SQL server, etc. up to date
  • 8. Secure Drupal • Is your admin password “admin”? • Look at all “administer *” permissions • “administer filters” can take over a site • Use update.module, watch the security news (Wednesdays)
  • 9. Secure Drupal • Avoid any kind of PHP input, write your own modules instead • Watch your input formats (you can be googled)
  • 11. index.php?id=12 mysql_query(“UPDATE mytable SET value = ‘”. $value .”’ WHERE id = ”. $_GET[‘id’]);
  • 12. Drupal approach • db_query(“UPDATE {mytable} SET value = ‘%s’ WHERE id = %d”, $value, $id); • If you need to include dynamic table or column names in your query, see db_escape_table()
  • 14. index.php?id=12 print $_GET[‘id’]; $output .= $node->title; Giving full HTML access.
  • 15. 66% likeliness a website has Cross site scripting issues http://www.whitehatsec.com/home/assets/presentations/09PPT/PPT_statsfall09_8th.pdf
  • 16. jQuery.get('/user/1/edit', function (data, status) { if (status == 'success') { var p = /id="edit-user-edit-form-token" value="([a-z0-9]*)"/; var matches = data.match(p); var token = matches[1]; var payload = { "form_id": 'user_edit', "form_token": token, "pass[pass1]": 'hacked', "pass[pass2]": 'hacked' }; jQuery.post('/user/1/edit', payload); } } ); Example from Heine Deelstra, Drupal Security team lead http://heine.familiedeelstra.com/change-password-xss
  • 17. Drupal approach • check_plain() to escape text to HTML • check_markup() to format text to HTML • filter_xss() to filter text to HTML • filter_xss_admin() to filter admin text to HTML • node_view($node) instead of $node->body
  • 18. Drupal approach • t(), format_plural() placeholders: %name, @url, !insecure t(‘%name has a blog at <a href=”@url”>@url</a>’, array(‘@url’ => valid_url($user->profile_blog), ‘%name’ => $user->name)); • Use Drupal.t(), Drupal.formatPlural() in JS.
  • 20. • Weak password storage and account management • Session hijacking / fixation • Lack of session timeout / logout
  • 21. Drupal approach • Passwords are stored encrypted • Session IDs changed when permissions change • Drupal works with Apache’s SSL transport • Modules to set certain URLs to use SSL
  • 23. index.php?id=12 db_query(“SELECT * FROM {user} WHERE id = %d”, $_GET[‘id’]);
  • 24. Drupal approach • Menu system handles permission checking • user_access(‘administer nodes’, $account) • node_access(‘edit’, $node, $account); • db_query(db_rewrite_sql(‘SELECT title FROM {node} n’)); • Form API checks for data validity
  • 25. Cross Site Request Forgery (CSRF)
  • 27. Drupal approach • Form API works with POST submissions by default (makes it harder) • Form API includes form tokens, requires form retrieval before submission, checks valid values • drupal_valid_token() provided to generate/validate tokens for GET requests
  • 28. Failure to restrict URL access
  • 29. Drupal approach • Menu system uses access callback and access arguments • Continually review permissions
  • 32. Drupal approach • Drupal has various internal redirections, which use local paths and generate URLs based on them • Look for use of drupal_goto() and Form API #redirect instances in your modules to validate their compliance
  • 34. Drupal approach • Drupal stores user passwords encrypted with a one-way hash • Different randomly generated private key is provided on each site, which can be used to do reversible encryption • Up to you to ensure backups are properly protected
  • 36. Drupal approach • Run Drupal on top of full SSL • Use securepages and securepages_prevent_hijack to wall your important pages • http://crackingdrupal.com/blog/ greggles/drupal-and-ssl-multiple- recipes-possible-solutions • Use a valid certificate
  • 37. Is Open Source secure?
  • 38. “Open Source is secure” • Open Source makes people look at it • Popularity gets more eyes • There are always more smart people to find and fix problems
  • 39. “Open Source is insecure” • People can equally find holes • Some people (inadvertently) disclose issues in the public • Fix becomes public and can / will be reviewed
  • 41. Developers and users • Drupal APIs are designed to be secure • It is eventually up to programmers to use them that way • http://drupal.org/writing-secure-code • Tools designed for security can still be misconfigured
  • 42. Drupal security team A team of volunteers working to ensure best security of Drupal and thousands of contributed modules
  • 44. What’s supported? • Drupal core and all(!) contributed project on drupal.org • Not actively looking for vulnerabilities in contributed modules • Stable releases and development versions (for very popular modules) • Only current and one earlier versions are supported: now 6.x, 5.x
  • 45. Points of contact • Releases at http://drupal.org/security • Reporting issues: http://drupal.org/ node/101494 • Reporting cracked sites: http:// drupal.org/node/213320
  • 46.
  • 47. These slides are (CC) Images used: http://www.flickr.com/photos/rtv/2398561954/ http://www.flickr.com/photos/jonk/19422564/ http://www.flickr.com/photos/duncan/2693141693/ http://www.flickr.com/photos/duncan/2742371814 http://www.flickr.com/photos/jontintinjordan/3736095793/ http://www.flickr.com/photos/djbrady/2304740173/ http://www.flickr.com/photos/inkytwist/2654071573/ http://www.flickr.com/photos/duncan/2741594585/ http://www.flickr.com/photos/shellysblogger/2924699161/ http://www.flickr.com/photos/blogumentary/434097609/ http://www.flickr.com/photos/glamhag/2214986176/ http://www.flickr.com/photos/duncan/2693140217/ This presentation is © Gábor Hojtsy Licensed: Licensed: http://creativecommons.org/licenses/by-nc-sa/2.0/
  • 49. Thank you! Gábor Hojtsy, Acquia http://twitter.com/gaborhojtsy