SlideShare uma empresa Scribd logo
1 de 26
Baixar para ler offline
Hong Kong Drupal User Group 
Drupal 7.32 Security Vulnerability 
Edison Wong 
2014 Nov 08th
Edison Wong 
● CEO, PantaRei Design 
– hswong3i@pantarei-design.com 
● Drupal developer & contributor 
– https://drupal.org/user/33940 
● HKDUG Co-founder 
– https://groups.drupal.org/drupalhk 
● Startup founder 
– 2009 - PantaRei Design founded 
– 2010 - YBHK applicant 
– 2011 - ITF SERAP applicant 
– 2011 - HKSTP Incu-Tech applicant
PantaRei Design 
● Hong Kong based Free and Open Source Software (FOSS) service 
provider 
– Content Management System (CMS) with Drupal 
– Cloud hosting with Amazon Web Services (AWS) 
● Business Partnership 
– 2012 - AWS Consulting Partner 
– 2013 - Acquia Partner 
– 2013 - Atlassian Experts 
– 2014 - Rackspace Hosting Partner 
● FOSS Contributor 
– 2008 - Hong Kong Drupal User Group Co-founder 
– 2012 - Drupal Services Provider
Outline 
● What's Happened with Drupal 7.32? 
● Technical Details 
● OMG! So What Should I Do for It? 
● How to Restore My (Hacked) Drupal Site? 
● How to Update My Drupal Site? 
● Any Follow Up Action Required? 
● Is Drupal Secure? 
● Security Tips
What's Happened with Drupal 
7.32? 
● Vulnerability: SQL Injection 
● Security risk: 25/25 (Highly Critical) 
● Unless updated or patched to Drupal 7.23 before 2014 Oct 
15th, 23:00 UTC (i.e. 7 hours after the announcement), you 
should assume your sites was compromised. 
● Simply updating to Drupal 7.32 will NOT remove backdoors. 
● Attackers may have copied all data out of your site and 
could use it maliciously. 
● There may be no trace of the attack.
Technical Details 
● Drupal uses prepared statements in all its SQL queries. 
To handle IN statements there is an expandArguments() 
function to expand arrays. 
● The function assumes that it is called with an array 
which has no keys. Example: 
– db_query("SELECT * FROM {users} where name IN 
(:name)", array(':name'=>array('user1','user2'))); 
● Which results in this SQL Statement with the parameters 
name_0 = user1 and name_1 = user2: 
– SELECT * from users where name IN (:name_0, :name_1)
Technical Details (cont.) 
● The Problem occurs, if the array has keys, 
which are no integers. Example: 
– db_query("SELECT * FROM {users} where name IN 
(:name)", array(':name'=>array('test -- ' => 
'user1','test' => 'user2'))); 
● This results in an exploitable SQL query with 
parameters :name_test = user2: 
– SELECT * FROM users WHERE name = 
:name_test -- , :name_test AND status = 1
Technical Details (cont.) 
● Since Drupal uses PDO, multi-queries are allowed. So this 
SQL Injection can be used to insert arbitrary data in the 
database, dump or modify existing data or drop the whole 
database. 
● With the possibility to INSERT arbitrary data into the 
database an attacker can execute any PHP code through 
Drupal features with callbacks. 
● Attackers may have created access points for themselves 
(sometimes called “backdoors”) in the database, code, files 
directory and other locations. Attackers could compromise 
other services on the server or escalate their access.
OMG! So What Should I Do for It? 
● Removing a compromised website’s backdoors 
is difficult because it is not possible to be 
certain all backdoors have been found. 
● The Drupal security team recommends that you 
consult with your hosting provider. If they did 
not patch Drupal for you or otherwise block the 
SQL injection attacks within hours of the 
announcement of Oct 15th, 4pm UTC, restore 
your website to a backup from before 15 
October 2014.
How to Restore My (Hacked) 
Drupal Site? 
● Take the website offline by replacing it with a static HTML 
page 
● Notify the server’s administrator emphasizing that other sites 
or applications hosted on the same server might have been 
compromised via a backdoor installed by the initial attack. 
● Consider obtaining a new server, or otherwise remove all the 
website’s files and database from the server. (Keep a copy 
safe for later analysis.) 
● Restore the website (Drupal files, uploaded files and 
database) from backups from before 15 October 2014
How to Update My Drupal Site? 
● Update or patch the restored Drupal core code, e.g. 
– cd public_html 
– curl -sL https://www.drupal.org/files/issues/SA-CORE- 
2014-005-D7.patch | patch -p1 
● Put the restored and patched/updated website back 
online. 
● Manually redo any desired changes made to the 
website since the date of the restored backup.
Any Follow Up Action Required? 
● Audit anything merged from the compromised 
website, such as custom code, configuration, 
files or other artifacts, to confirm they are 
correct and have not been tampered with. 
● While recovery without restoring from backup 
may be possible, this is not advised because 
backdoors can be extremely difficult to find. The 
recommendation is to restore from backup or 
rebuild from scratch.
Is Drupal Secure? 
● All software has security vulnerabilities and Drupal is no 
exception. In a study by WhiteHat Security, 86% of websites 
across a variety of platforms both Open Source and proprietary 
had a serious vulnerability. 
● Drupal aims to provide a framework with built-in security features 
that make it easier for site-builders and developers to build a 
secure website. 
● Over the years the mix of security issues found in Drupal has 
changed. The OWASP project lists injection issues such as SQL 
Injection as the #1 issue based on how often it is found and the 
risk exposure. By providing rich APIs and developer education, 
Drupal has reduced the frequency of SQL Injection vulnerabilities.
Security Tips 
● Keep Your Drupal Install Updated 
● Always Keep Maintained Plug-ins And Modules 
● Making Strong Passwords 
● Authorize Website Accounts 
● Setup Firewall Settings 
● Make A Security Strategy For Your Independent Modules 
● Think Like A Hacker 
● Audit Your Drupal Security 
● Get In Touch With the Drupal Community And Security Team
References 
● https://www.drupal.org/drupalsa05FAQ 
● https://www.drupal.org/SA-CORE-2014-005 
● https://www.drupal.org/PSA-2014-003 
● https://www.drupal.org/files/issues/SA-CORE-2014-005-D7.patc 
h 
● https://www.drupal.org/node/2365547 
● https://www.sektioneins.de/en/advisories/advisory-012014-drupal-pre- 
auth-sql-injection-vulnerability.html 
● http://drupal.stackexchange.com/questions/133795/what-kind-of 
-attacks-does-the-patch-for-sa-core-2014-005-drupal-7-32-prev 
ent
Q & A
I Need More Help! 
● Read documents from Drupal Community 
– https://drupal.org/documentation 
● Join Hong Kong Drupal User Group 
– Event organizing: http://www.meetup.com/drupalhk 
– Technological discussion: https://groups.drupal.org/drupalhk 
– Business connection: 
http://www.linkedin.com/groups/?gid=6644792 
– General sharing: https://www.facebook.com/groups/drupalhk 
● Contact us for one (1) month free-trial support service 
– http://pantarei-design.com/services/support/#support-service-plan 
s
Thank You 
● Please feel free to contact us: 
– Unit 207, 2/F IC Development Centre, No.6 Science 
Park West Avenue, Hong Kong Science Park, 
Shatin, N.T. 
– +852 3576 3812 
– http://pantarei-design.com/ 
– sales@pantarei-design.com

Mais conteúdo relacionado

Destaque (6)

BarCamp Hong Kong 2015 - AuthBucket - Open Source Identity Management System
BarCamp Hong Kong 2015 - AuthBucket - Open Source Identity Management SystemBarCamp Hong Kong 2015 - AuthBucket - Open Source Identity Management System
BarCamp Hong Kong 2015 - AuthBucket - Open Source Identity Management System
 
[HKDUG] #20160626 - HKOSCon 2015 - Website DIY with Drupal 8
[HKDUG] #20160626 - HKOSCon 2015 - Website DIY with Drupal 8[HKDUG] #20160626 - HKOSCon 2015 - Website DIY with Drupal 8
[HKDUG] #20160626 - HKOSCon 2015 - Website DIY with Drupal 8
 
CUHK CSCI 4140 2015 Spring Guest Lecture - Agile Development
CUHK CSCI 4140 2015 Spring Guest Lecture - Agile DevelopmentCUHK CSCI 4140 2015 Spring Guest Lecture - Agile Development
CUHK CSCI 4140 2015 Spring Guest Lecture - Agile Development
 
Drupal in 5mins + Previewing Drupal 8.x
Drupal in 5mins + Previewing Drupal 8.xDrupal in 5mins + Previewing Drupal 8.x
Drupal in 5mins + Previewing Drupal 8.x
 
The World We Live In
The World We Live InThe World We Live In
The World We Live In
 
[20160314][CUHK][CSCI4140]Life of an Agile Team]
[20160314][CUHK][CSCI4140]Life of an Agile Team][20160314][CUHK][CSCI4140]Life of an Agile Team]
[20160314][CUHK][CSCI4140]Life of an Agile Team]
 

Semelhante a Hong Kong Drupal User Group - Nov 8th

Modernize Your Drupal Development
Modernize Your Drupal DevelopmentModernize Your Drupal Development
Modernize Your Drupal Development
Chris Tankersley
 
From Drupal 7 to Drupal 8 - Drupal Intensive Course Overview
From Drupal 7 to Drupal 8 - Drupal Intensive Course OverviewFrom Drupal 7 to Drupal 8 - Drupal Intensive Course Overview
From Drupal 7 to Drupal 8 - Drupal Intensive Course Overview
Italo Mairo
 

Semelhante a Hong Kong Drupal User Group - Nov 8th (20)

Open Innovation Lab (OIL) - 2014 Sep 26th
Open Innovation Lab (OIL) - 2014 Sep 26thOpen Innovation Lab (OIL) - 2014 Sep 26th
Open Innovation Lab (OIL) - 2014 Sep 26th
 
Becoming A Drupal Master Builder
Becoming A Drupal Master BuilderBecoming A Drupal Master Builder
Becoming A Drupal Master Builder
 
Drupal 7 training
Drupal 7 trainingDrupal 7 training
Drupal 7 training
 
Bgoug 2019.11 building free, open-source, plsql products in cloud
Bgoug 2019.11   building free, open-source, plsql products in cloudBgoug 2019.11   building free, open-source, plsql products in cloud
Bgoug 2019.11 building free, open-source, plsql products in cloud
 
Drupal 8 DevOps . Profile and SQL flows.
Drupal 8 DevOps . Profile and SQL flows.Drupal 8 DevOps . Profile and SQL flows.
Drupal 8 DevOps . Profile and SQL flows.
 
Drupal in-depth
Drupal in-depthDrupal in-depth
Drupal in-depth
 
Modernize Your Drupal Development
Modernize Your Drupal DevelopmentModernize Your Drupal Development
Modernize Your Drupal Development
 
It4k12 wordpress
It4k12 wordpressIt4k12 wordpress
It4k12 wordpress
 
Drupal 8 improvements for developer productivity php symfony and more
Drupal 8 improvements for developer productivity  php symfony and moreDrupal 8 improvements for developer productivity  php symfony and more
Drupal 8 improvements for developer productivity php symfony and more
 
From Drupal 7 to Drupal 8 - Drupal Intensive Course Overview
From Drupal 7 to Drupal 8 - Drupal Intensive Course OverviewFrom Drupal 7 to Drupal 8 - Drupal Intensive Course Overview
From Drupal 7 to Drupal 8 - Drupal Intensive Course Overview
 
Drupal Development Tips
Drupal Development TipsDrupal Development Tips
Drupal Development Tips
 
Cloudera hadoop installation
Cloudera hadoop installationCloudera hadoop installation
Cloudera hadoop installation
 
Doing Drupal security right
Doing Drupal security rightDoing Drupal security right
Doing Drupal security right
 
Choosing Drupal as your Content Management Framework
Choosing Drupal as your Content Management FrameworkChoosing Drupal as your Content Management Framework
Choosing Drupal as your Content Management Framework
 
[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?
[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?
[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?
 
Drupal Continuous Integration (European Drupal Days 2015)
Drupal Continuous Integration (European Drupal Days 2015)Drupal Continuous Integration (European Drupal Days 2015)
Drupal Continuous Integration (European Drupal Days 2015)
 
Drupal Security: What You Need to Know
Drupal Security: What You Need to KnowDrupal Security: What You Need to Know
Drupal Security: What You Need to Know
 
Building and Maintaining a Distribution in Drupal 7 with Features
Building and Maintaining a  Distribution in Drupal 7 with FeaturesBuilding and Maintaining a  Distribution in Drupal 7 with Features
Building and Maintaining a Distribution in Drupal 7 with Features
 
Lupus Decoupled Drupal - Drupal Austria Meetup - 2023-04.pdf
Lupus Decoupled Drupal - Drupal Austria Meetup - 2023-04.pdfLupus Decoupled Drupal - Drupal Austria Meetup - 2023-04.pdf
Lupus Decoupled Drupal - Drupal Austria Meetup - 2023-04.pdf
 
Drupal Security Hardening
Drupal Security HardeningDrupal Security Hardening
Drupal Security Hardening
 

Mais de Wong Hoi Sing Edison

Mais de Wong Hoi Sing Edison (20)

[HKOSCON][20220611][AlviStack: Hong Kong Based Kubernetes Distribution]
[HKOSCON][20220611][AlviStack: Hong Kong Based Kubernetes Distribution][HKOSCON][20220611][AlviStack: Hong Kong Based Kubernetes Distribution]
[HKOSCON][20220611][AlviStack: Hong Kong Based Kubernetes Distribution]
 
[HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes]
[HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes][HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes]
[HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes]
 
[HKOSCON][20200613][ Ansible: From VM to Kubernetes]
[HKOSCON][20200613][ Ansible: From VM to Kubernetes][HKOSCON][20200613][ Ansible: From VM to Kubernetes]
[HKOSCON][20200613][ Ansible: From VM to Kubernetes]
 
[HKOSCON][20190615][DevOps with Ansible, From Native to Kubernetes]
[HKOSCON][20190615][DevOps with Ansible, From Native to Kubernetes][HKOSCON][20190615][DevOps with Ansible, From Native to Kubernetes]
[HKOSCON][20190615][DevOps with Ansible, From Native to Kubernetes]
 
[BarCamp2018][20180915][Tips for Virtual Hosting on Kubernetes]
[BarCamp2018][20180915][Tips for Virtual Hosting on Kubernetes][BarCamp2018][20180915][Tips for Virtual Hosting on Kubernetes]
[BarCamp2018][20180915][Tips for Virtual Hosting on Kubernetes]
 
[HKOSCON][20180616][Containerized High Availability Virtual Hosting Deploymen...
[HKOSCON][20180616][Containerized High Availability Virtual Hosting Deploymen...[HKOSCON][20180616][Containerized High Availability Virtual Hosting Deploymen...
[HKOSCON][20180616][Containerized High Availability Virtual Hosting Deploymen...
 
[HKDUG] #20180512 - Fix Hacked Drupal with GIT
[HKDUG] #20180512 - Fix Hacked Drupal with GIT[HKDUG] #20180512 - Fix Hacked Drupal with GIT
[HKDUG] #20180512 - Fix Hacked Drupal with GIT
 
[HKDUG] #20161210 - BarCamp Hong Kong 2016 - What's News in PHP?
[HKDUG] #20161210 - BarCamp Hong Kong 2016 - What's News in PHP?[HKDUG] #20161210 - BarCamp Hong Kong 2016 - What's News in PHP?
[HKDUG] #20161210 - BarCamp Hong Kong 2016 - What's News in PHP?
 
DruStack- a mobile-friendly web content management system (cms
DruStack- a mobile-friendly web content management system (cmsDruStack- a mobile-friendly web content management system (cms
DruStack- a mobile-friendly web content management system (cms
 
drustack a mobile-friendly web content management system (cms)
drustack   a mobile-friendly web content management system (cms)drustack   a mobile-friendly web content management system (cms)
drustack a mobile-friendly web content management system (cms)
 
Open Innovation Lab (OIL) - 20150227 - GIT Intro Workshop
Open Innovation Lab (OIL) - 20150227 - GIT Intro WorkshopOpen Innovation Lab (OIL) - 20150227 - GIT Intro Workshop
Open Innovation Lab (OIL) - 20150227 - GIT Intro Workshop
 
IT Entrepreneurship Talk - City University of Hong Kong
IT Entrepreneurship Talk - City University of Hong KongIT Entrepreneurship Talk - City University of Hong Kong
IT Entrepreneurship Talk - City University of Hong Kong
 
OSS Community Meeting - OSS Community Management for Dummy
OSS Community Meeting - OSS Community Management for DummyOSS Community Meeting - OSS Community Management for Dummy
OSS Community Meeting - OSS Community Management for Dummy
 
Barcamp Hong Kong 2014 - Introduction to GIT
Barcamp Hong Kong 2014 - Introduction to GITBarcamp Hong Kong 2014 - Introduction to GIT
Barcamp Hong Kong 2014 - Introduction to GIT
 
Barcamp Hong Kong 2014 - Commercial Use of OSS Web Content Management System
Barcamp Hong Kong 2014 - Commercial Use of OSS Web Content Management SystemBarcamp Hong Kong 2014 - Commercial Use of OSS Web Content Management System
Barcamp Hong Kong 2014 - Commercial Use of OSS Web Content Management System
 
Entrepreneurship Talk
Entrepreneurship TalkEntrepreneurship Talk
Entrepreneurship Talk
 
Open Source.HK Workshop - 2014 Oct 11th
Open Source.HK Workshop - 2014 Oct 11thOpen Source.HK Workshop - 2014 Oct 11th
Open Source.HK Workshop - 2014 Oct 11th
 
Barcamp Macau 2014 - Introduction to GIT
Barcamp Macau 2014 - Introduction to GITBarcamp Macau 2014 - Introduction to GIT
Barcamp Macau 2014 - Introduction to GIT
 
Barcamp Macau 2014 - Introduction to AWS
Barcamp Macau 2014 - Introduction to AWSBarcamp Macau 2014 - Introduction to AWS
Barcamp Macau 2014 - Introduction to AWS
 
Hong Kong Drupal User Group - Sep 13th
Hong Kong Drupal User Group - Sep 13thHong Kong Drupal User Group - Sep 13th
Hong Kong Drupal User Group - Sep 13th
 

Último

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Último (20)

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Hong Kong Drupal User Group - Nov 8th

  • 1. Hong Kong Drupal User Group Drupal 7.32 Security Vulnerability Edison Wong 2014 Nov 08th
  • 2. Edison Wong ● CEO, PantaRei Design – hswong3i@pantarei-design.com ● Drupal developer & contributor – https://drupal.org/user/33940 ● HKDUG Co-founder – https://groups.drupal.org/drupalhk ● Startup founder – 2009 - PantaRei Design founded – 2010 - YBHK applicant – 2011 - ITF SERAP applicant – 2011 - HKSTP Incu-Tech applicant
  • 3. PantaRei Design ● Hong Kong based Free and Open Source Software (FOSS) service provider – Content Management System (CMS) with Drupal – Cloud hosting with Amazon Web Services (AWS) ● Business Partnership – 2012 - AWS Consulting Partner – 2013 - Acquia Partner – 2013 - Atlassian Experts – 2014 - Rackspace Hosting Partner ● FOSS Contributor – 2008 - Hong Kong Drupal User Group Co-founder – 2012 - Drupal Services Provider
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9. Outline ● What's Happened with Drupal 7.32? ● Technical Details ● OMG! So What Should I Do for It? ● How to Restore My (Hacked) Drupal Site? ● How to Update My Drupal Site? ● Any Follow Up Action Required? ● Is Drupal Secure? ● Security Tips
  • 10. What's Happened with Drupal 7.32? ● Vulnerability: SQL Injection ● Security risk: 25/25 (Highly Critical) ● Unless updated or patched to Drupal 7.23 before 2014 Oct 15th, 23:00 UTC (i.e. 7 hours after the announcement), you should assume your sites was compromised. ● Simply updating to Drupal 7.32 will NOT remove backdoors. ● Attackers may have copied all data out of your site and could use it maliciously. ● There may be no trace of the attack.
  • 11.
  • 12. Technical Details ● Drupal uses prepared statements in all its SQL queries. To handle IN statements there is an expandArguments() function to expand arrays. ● The function assumes that it is called with an array which has no keys. Example: – db_query("SELECT * FROM {users} where name IN (:name)", array(':name'=>array('user1','user2'))); ● Which results in this SQL Statement with the parameters name_0 = user1 and name_1 = user2: – SELECT * from users where name IN (:name_0, :name_1)
  • 13. Technical Details (cont.) ● The Problem occurs, if the array has keys, which are no integers. Example: – db_query("SELECT * FROM {users} where name IN (:name)", array(':name'=>array('test -- ' => 'user1','test' => 'user2'))); ● This results in an exploitable SQL query with parameters :name_test = user2: – SELECT * FROM users WHERE name = :name_test -- , :name_test AND status = 1
  • 14. Technical Details (cont.) ● Since Drupal uses PDO, multi-queries are allowed. So this SQL Injection can be used to insert arbitrary data in the database, dump or modify existing data or drop the whole database. ● With the possibility to INSERT arbitrary data into the database an attacker can execute any PHP code through Drupal features with callbacks. ● Attackers may have created access points for themselves (sometimes called “backdoors”) in the database, code, files directory and other locations. Attackers could compromise other services on the server or escalate their access.
  • 15.
  • 16. OMG! So What Should I Do for It? ● Removing a compromised website’s backdoors is difficult because it is not possible to be certain all backdoors have been found. ● The Drupal security team recommends that you consult with your hosting provider. If they did not patch Drupal for you or otherwise block the SQL injection attacks within hours of the announcement of Oct 15th, 4pm UTC, restore your website to a backup from before 15 October 2014.
  • 17. How to Restore My (Hacked) Drupal Site? ● Take the website offline by replacing it with a static HTML page ● Notify the server’s administrator emphasizing that other sites or applications hosted on the same server might have been compromised via a backdoor installed by the initial attack. ● Consider obtaining a new server, or otherwise remove all the website’s files and database from the server. (Keep a copy safe for later analysis.) ● Restore the website (Drupal files, uploaded files and database) from backups from before 15 October 2014
  • 18. How to Update My Drupal Site? ● Update or patch the restored Drupal core code, e.g. – cd public_html – curl -sL https://www.drupal.org/files/issues/SA-CORE- 2014-005-D7.patch | patch -p1 ● Put the restored and patched/updated website back online. ● Manually redo any desired changes made to the website since the date of the restored backup.
  • 19. Any Follow Up Action Required? ● Audit anything merged from the compromised website, such as custom code, configuration, files or other artifacts, to confirm they are correct and have not been tampered with. ● While recovery without restoring from backup may be possible, this is not advised because backdoors can be extremely difficult to find. The recommendation is to restore from backup or rebuild from scratch.
  • 20. Is Drupal Secure? ● All software has security vulnerabilities and Drupal is no exception. In a study by WhiteHat Security, 86% of websites across a variety of platforms both Open Source and proprietary had a serious vulnerability. ● Drupal aims to provide a framework with built-in security features that make it easier for site-builders and developers to build a secure website. ● Over the years the mix of security issues found in Drupal has changed. The OWASP project lists injection issues such as SQL Injection as the #1 issue based on how often it is found and the risk exposure. By providing rich APIs and developer education, Drupal has reduced the frequency of SQL Injection vulnerabilities.
  • 21.
  • 22. Security Tips ● Keep Your Drupal Install Updated ● Always Keep Maintained Plug-ins And Modules ● Making Strong Passwords ● Authorize Website Accounts ● Setup Firewall Settings ● Make A Security Strategy For Your Independent Modules ● Think Like A Hacker ● Audit Your Drupal Security ● Get In Touch With the Drupal Community And Security Team
  • 23. References ● https://www.drupal.org/drupalsa05FAQ ● https://www.drupal.org/SA-CORE-2014-005 ● https://www.drupal.org/PSA-2014-003 ● https://www.drupal.org/files/issues/SA-CORE-2014-005-D7.patc h ● https://www.drupal.org/node/2365547 ● https://www.sektioneins.de/en/advisories/advisory-012014-drupal-pre- auth-sql-injection-vulnerability.html ● http://drupal.stackexchange.com/questions/133795/what-kind-of -attacks-does-the-patch-for-sa-core-2014-005-drupal-7-32-prev ent
  • 24. Q & A
  • 25. I Need More Help! ● Read documents from Drupal Community – https://drupal.org/documentation ● Join Hong Kong Drupal User Group – Event organizing: http://www.meetup.com/drupalhk – Technological discussion: https://groups.drupal.org/drupalhk – Business connection: http://www.linkedin.com/groups/?gid=6644792 – General sharing: https://www.facebook.com/groups/drupalhk ● Contact us for one (1) month free-trial support service – http://pantarei-design.com/services/support/#support-service-plan s
  • 26. Thank You ● Please feel free to contact us: – Unit 207, 2/F IC Development Centre, No.6 Science Park West Avenue, Hong Kong Science Park, Shatin, N.T. – +852 3576 3812 – http://pantarei-design.com/ – sales@pantarei-design.com