SlideShare una empresa de Scribd logo
1 de 37
Descargar para leer sin conexión
Our sponsors
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
Our sponsors
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
Our sponsors
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
About me
Who’s me?
Ezequiel ”Zequi”V´azquez
Backend Developer
Sysadmin & DevOps
Hacking & Security
@RabbitLair
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
About me
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
Index
1 Introduction
2 Analysis of Vulnerabilities
3 What if I don’t patch?
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
Index
1 Introduction
2 Analysis of Vulnerabilities
3 What if I don’t patch?
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
Life cycle of a patch
General steps
1 Discovery of a vulnerability → security team
2 Implementation of a patch, new release is published
3 Hackers study patch using reverse engineering → POC
4 POC published → massive attacks
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
Ok! I will patch my system, but . . .
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
Ok! I will patch my system, but . . .
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
Index
1 Introduction
2 Analysis of Vulnerabilities
3 What if I don’t patch?
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
Drupalgeddon 1
SA-CORE-2014-005
CVE-2014-3704
Patch released on October 15th, 2014
SQL injection as anonymous user
All Drupal 7.x prior to 7.32 affected
25/25 score on NIST index
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
Drupalgeddon 1
Arrays on HTTP POST method
Method POST submits form values to server application
Usually, integers or strings, but arrays are allowed
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
Drupalgeddon 1
Database queries sanitization
File includes/database/database.inc
Method expandArguments
Queries with condition like “column IN (a, b, c, . . . )”
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
Drupalgeddon 1
Database queries sanitization
File includes/database/database.inc
Method expandArguments
Queries with condition like “column IN (a, b, c, . . . )”
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
Drupalgeddon 1
Database queries sanitization
File includes/database/database.inc
Method expandArguments
Queries with condition like “column IN (a, b, c, . . . )”
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
Drupalgeddon 1
The vulnerability
Array index is not sanitized properly
Poisoned variable is passed to database
Result: Arbitrary SQL queries can be executed
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
Drupalgeddon 1
The vulnerability
Array index is not sanitized properly
Poisoned variable is passed to database
Result: Arbitrary SQL queries can be executed
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
Drupalgeddon 1
Let’s see it
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
Drupalgeddon 2
SA-CORE-2018-002
CVE-2018-7600
Patch released on March 28th, 2018
Remote code execution as anonymous user
All versions affected prior to 7.58 and 8.5.1
24/25 score on NIST index
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
Drupalgeddon 2
Renderable Arrays
Forms API introduced in Drupal 4.7
Arrays whose keys start with “#”
Drupal 7 generalized this mechanism to render everything
Recursive behavior
Callbacks: post render, pre render, value callback, . . .
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
Drupalgeddon 2
Submitting forms
Submitted value is stored in #value
HTTP POST method allows to submit array as value
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
Drupalgeddon 2
The vulnerability
Use POSTMAN or similar to bypass the form
Submit an array value in a field where Drupal expects a string
Submitted array contains indexes starting with “#”
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
Drupalgeddon 2
The vulnerability
Use Ajax API to trick Drupal to renderize again mail field
element parents determines part of form to be renderized
Field is renderized, and post render callback is executed
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
Drupalgeddon 2
Let’s see it
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
Drupalgeddon 3
SA-CORE-2018-004
CVE-2018-7602
Patch released on April 25th, 2018
Remote code execution as authenticated user
All versions affected prior to 7.59 and 8.5.3
20/25 score on NIST index
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
Drupalgeddon 3
Destination parameter
GET parameter used to redirect to an URL after execution
It’s passed to stripDangerousValues to sanitize it
Double encoding not detected: “#” → “ %23” → “ %2523”
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
Drupalgeddon 3
Destination parameter
GET parameter used to redirect to an URL after execution
It’s passed to stripDangerousValues to sanitize it
Double encoding not detected: “#” → “ %23” → “ %2523”
Option trigering element name
File includes/ajax.inc
Identifies the element used for submission
Sets a form element to be renderized again
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
Drupalgeddon 3
The vulnerability: First step
Perform a POST call to URL of a confirmation form
trigering element name with value form id
Destination contains a field with post render callback
POST call redirects to confirmation form again → All set
Payload must be URL encoded
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
Drupalgeddon 3
The vulnerability: First step
Perform a POST call to URL of a confirmation form
trigering element name with value form id
Destination contains a field with post render callback
POST call redirects to confirmation form again → All set
Payload must be URL encoded
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
Drupalgeddon 3
The vulnerability: Second step
Execute form cancel action as AJAX POST call
/file/ajax/actions/cancel/ %23options/path/[form build id]
Ajax API processes the form and executes poisoned post render
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
Drupalgeddon 3
Let’s see it
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
Index
1 Introduction
2 Analysis of Vulnerabilities
3 What if I don’t patch?
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
Attacks in the wild
Kids, don’t do this at home
Full database dump
Execute cryptocurrency mining malware
Server used as malicious proxy
Infect site users
Defacement / Black SEO
???
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
In summary . . .
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
That’s all, folks!
Thank you!
@RabbitLair
zequi[at]lullabot[dot]com
Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities

Más contenido relacionado

La actualidad más candente

Justin collins - Practical Static Analysis for continuous application delivery
Justin collins - Practical Static Analysis for continuous application deliveryJustin collins - Practical Static Analysis for continuous application delivery
Justin collins - Practical Static Analysis for continuous application delivery
DevSecCon
 

La actualidad más candente (6)

Justin collins - Practical Static Analysis for continuous application delivery
Justin collins - Practical Static Analysis for continuous application deliveryJustin collins - Practical Static Analysis for continuous application delivery
Justin collins - Practical Static Analysis for continuous application delivery
 
SFSCon19 - Kristian Schwienbacher - Custom error and event tracking for Ember...
SFSCon19 - Kristian Schwienbacher - Custom error and event tracking for Ember...SFSCon19 - Kristian Schwienbacher - Custom error and event tracking for Ember...
SFSCon19 - Kristian Schwienbacher - Custom error and event tracking for Ember...
 
DevSecCon London 2018: Open DevSecOps
DevSecCon London 2018: Open DevSecOpsDevSecCon London 2018: Open DevSecOps
DevSecCon London 2018: Open DevSecOps
 
Invoke-DOSfuscation
Invoke-DOSfuscationInvoke-DOSfuscation
Invoke-DOSfuscation
 
A Taxonomy of Clustering, or, No Container is an Island
A Taxonomy of Clustering, or, No Container is an IslandA Taxonomy of Clustering, or, No Container is an Island
A Taxonomy of Clustering, or, No Container is an Island
 
Geb for browser automation
Geb for browser automationGeb for browser automation
Geb for browser automation
 

Similar a Drupal Dev Days 2018 - Autopsy of Vulnerabilities

Similar a Drupal Dev Days 2018 - Autopsy of Vulnerabilities (20)

CodeOne SF 2018 "Are you deploying and operating with security in mind?"
CodeOne SF 2018 "Are you deploying and operating with security in mind?"CodeOne SF 2018 "Are you deploying and operating with security in mind?"
CodeOne SF 2018 "Are you deploying and operating with security in mind?"
 
Java application security the hard way - a workshop for the serious developer
Java application security the hard way - a workshop for the serious developerJava application security the hard way - a workshop for the serious developer
Java application security the hard way - a workshop for the serious developer
 
Checking Bitcoin
 Checking Bitcoin Checking Bitcoin
Checking Bitcoin
 
Add More Security To Your Testing and Automating - Saucecon 2021
Add More Security To Your Testing and Automating - Saucecon 2021Add More Security To Your Testing and Automating - Saucecon 2021
Add More Security To Your Testing and Automating - Saucecon 2021
 
Watch How The Giants Fall: Learning from Bug Bounty Results
Watch How The Giants Fall: Learning from Bug Bounty ResultsWatch How The Giants Fall: Learning from Bug Bounty Results
Watch How The Giants Fall: Learning from Bug Bounty Results
 
Auscert 2022 - log4shell and history of Java deserialisation RCE
Auscert 2022 - log4shell and history of Java deserialisation RCEAuscert 2022 - log4shell and history of Java deserialisation RCE
Auscert 2022 - log4shell and history of Java deserialisation RCE
 
Discussing Errors in Unity3D's Open-Source Components
Discussing Errors in Unity3D's Open-Source ComponentsDiscussing Errors in Unity3D's Open-Source Components
Discussing Errors in Unity3D's Open-Source Components
 
JS Fest 2019. Виктор Турский. 6 способов взломать твое JavaScript приложение
JS Fest 2019. Виктор Турский. 6 способов взломать твое JavaScript приложениеJS Fest 2019. Виктор Турский. 6 способов взломать твое JavaScript приложение
JS Fest 2019. Виктор Турский. 6 способов взломать твое JavaScript приложение
 
Vulners: Google for hackers
Vulners: Google for hackersVulners: Google for hackers
Vulners: Google for hackers
 
DevSecCon Boston 2018: Building a practical DevSecOps pipeline for free by Je...
DevSecCon Boston 2018: Building a practical DevSecOps pipeline for free by Je...DevSecCon Boston 2018: Building a practical DevSecOps pipeline for free by Je...
DevSecCon Boston 2018: Building a practical DevSecOps pipeline for free by Je...
 
Security as Code: DOES15
Security as Code: DOES15Security as Code: DOES15
Security as Code: DOES15
 
Making Security Agile
Making Security AgileMaking Security Agile
Making Security Agile
 
Automation of web attacks from advisories to create real world exploits
Automation of web attacks from advisories to create real world exploitsAutomation of web attacks from advisories to create real world exploits
Automation of web attacks from advisories to create real world exploits
 
6 ways to hack your JavaScript application by Viktor Turskyi
6 ways to hack your JavaScript application by Viktor Turskyi   6 ways to hack your JavaScript application by Viktor Turskyi
6 ways to hack your JavaScript application by Viktor Turskyi
 
JavaScript Supply Chain Security
JavaScript Supply Chain SecurityJavaScript Supply Chain Security
JavaScript Supply Chain Security
 
(automatic) Testing: from business to university and back
(automatic) Testing: from business to university and back(automatic) Testing: from business to university and back
(automatic) Testing: from business to university and back
 
Mining SQL Injection and Cross Site Scripting Vulnerabilities using Hybrid Pr...
Mining SQL Injection and Cross Site Scripting Vulnerabilities using Hybrid Pr...Mining SQL Injection and Cross Site Scripting Vulnerabilities using Hybrid Pr...
Mining SQL Injection and Cross Site Scripting Vulnerabilities using Hybrid Pr...
 
Long-Awaited Check of CryEngine V
Long-Awaited Check of CryEngine VLong-Awaited Check of CryEngine V
Long-Awaited Check of CryEngine V
 
Better Code through Lint and Checkstyle
Better Code through Lint and CheckstyleBetter Code through Lint and Checkstyle
Better Code through Lint and Checkstyle
 
Continuous Integration - Live Static Analysis with Puma Scan
Continuous Integration - Live Static Analysis with Puma ScanContinuous Integration - Live Static Analysis with Puma Scan
Continuous Integration - Live Static Analysis with Puma Scan
 

Más de zekivazquez

Más de zekivazquez (15)

DrupalCamp Spain 2018: CSI, autopsia de vulnerabilidades
DrupalCamp Spain 2018: CSI, autopsia de vulnerabilidadesDrupalCamp Spain 2018: CSI, autopsia de vulnerabilidades
DrupalCamp Spain 2018: CSI, autopsia de vulnerabilidades
 
Hacking a sistemas CMS
Hacking a sistemas CMSHacking a sistemas CMS
Hacking a sistemas CMS
 
Security for Human Beings
Security for Human BeingsSecurity for Human Beings
Security for Human Beings
 
Information is Power
Information is PowerInformation is Power
Information is Power
 
Hackea tu propia Harley
Hackea tu propia HarleyHackea tu propia Harley
Hackea tu propia Harley
 
Seguridad para todos
Seguridad para todosSeguridad para todos
Seguridad para todos
 
DrupalCon Barcelona 2015 - Drupal Extreme Scaling
DrupalCon Barcelona 2015 - Drupal Extreme ScalingDrupalCon Barcelona 2015 - Drupal Extreme Scaling
DrupalCon Barcelona 2015 - Drupal Extreme Scaling
 
Hack & Beers - Seguridad en Drupal
Hack & Beers - Seguridad en DrupalHack & Beers - Seguridad en Drupal
Hack & Beers - Seguridad en Drupal
 
Hacking & Hardening Drupal
Hacking & Hardening DrupalHacking & Hardening Drupal
Hacking & Hardening Drupal
 
Drupal Extreme Scaling
Drupal Extreme ScalingDrupal Extreme Scaling
Drupal Extreme Scaling
 
Hacking Drupal - Anatomía de una auditoría de seguridad
Hacking Drupal - Anatomía de una auditoría de seguridadHacking Drupal - Anatomía de una auditoría de seguridad
Hacking Drupal - Anatomía de una auditoría de seguridad
 
Taller Drupal - Jornadas Software Libre UCA
Taller Drupal - Jornadas Software Libre UCATaller Drupal - Jornadas Software Libre UCA
Taller Drupal - Jornadas Software Libre UCA
 
Desarrollo Seguro en Drupal - DrupalCamp Spain 2013
Desarrollo Seguro en Drupal - DrupalCamp Spain 2013Desarrollo Seguro en Drupal - DrupalCamp Spain 2013
Desarrollo Seguro en Drupal - DrupalCamp Spain 2013
 
Betabeers Sevilla - Hacking web con OWASP
Betabeers Sevilla - Hacking web con OWASPBetabeers Sevilla - Hacking web con OWASP
Betabeers Sevilla - Hacking web con OWASP
 
Hacking web con OWASP
Hacking web con OWASPHacking web con OWASP
Hacking web con OWASP
 

Último

Último (20)

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
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
 

Drupal Dev Days 2018 - Autopsy of Vulnerabilities

  • 1.
  • 2. Our sponsors Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 3. Our sponsors Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 4. Our sponsors Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 5. About me Who’s me? Ezequiel ”Zequi”V´azquez Backend Developer Sysadmin & DevOps Hacking & Security @RabbitLair Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 6. About me Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 7. Index 1 Introduction 2 Analysis of Vulnerabilities 3 What if I don’t patch? Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 8. Index 1 Introduction 2 Analysis of Vulnerabilities 3 What if I don’t patch? Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 9. Life cycle of a patch General steps 1 Discovery of a vulnerability → security team 2 Implementation of a patch, new release is published 3 Hackers study patch using reverse engineering → POC 4 POC published → massive attacks Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 10. Ok! I will patch my system, but . . . Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 11. Ok! I will patch my system, but . . . Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 12. Index 1 Introduction 2 Analysis of Vulnerabilities 3 What if I don’t patch? Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 13. Drupalgeddon 1 SA-CORE-2014-005 CVE-2014-3704 Patch released on October 15th, 2014 SQL injection as anonymous user All Drupal 7.x prior to 7.32 affected 25/25 score on NIST index Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 14. Drupalgeddon 1 Arrays on HTTP POST method Method POST submits form values to server application Usually, integers or strings, but arrays are allowed Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 15. Drupalgeddon 1 Database queries sanitization File includes/database/database.inc Method expandArguments Queries with condition like “column IN (a, b, c, . . . )” Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 16. Drupalgeddon 1 Database queries sanitization File includes/database/database.inc Method expandArguments Queries with condition like “column IN (a, b, c, . . . )” Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 17. Drupalgeddon 1 Database queries sanitization File includes/database/database.inc Method expandArguments Queries with condition like “column IN (a, b, c, . . . )” Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 18. Drupalgeddon 1 The vulnerability Array index is not sanitized properly Poisoned variable is passed to database Result: Arbitrary SQL queries can be executed Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 19. Drupalgeddon 1 The vulnerability Array index is not sanitized properly Poisoned variable is passed to database Result: Arbitrary SQL queries can be executed Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 20. Drupalgeddon 1 Let’s see it Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 21. Drupalgeddon 2 SA-CORE-2018-002 CVE-2018-7600 Patch released on March 28th, 2018 Remote code execution as anonymous user All versions affected prior to 7.58 and 8.5.1 24/25 score on NIST index Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 22. Drupalgeddon 2 Renderable Arrays Forms API introduced in Drupal 4.7 Arrays whose keys start with “#” Drupal 7 generalized this mechanism to render everything Recursive behavior Callbacks: post render, pre render, value callback, . . . Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 23. Drupalgeddon 2 Submitting forms Submitted value is stored in #value HTTP POST method allows to submit array as value Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 24. Drupalgeddon 2 The vulnerability Use POSTMAN or similar to bypass the form Submit an array value in a field where Drupal expects a string Submitted array contains indexes starting with “#” Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 25. Drupalgeddon 2 The vulnerability Use Ajax API to trick Drupal to renderize again mail field element parents determines part of form to be renderized Field is renderized, and post render callback is executed Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 26. Drupalgeddon 2 Let’s see it Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 27. Drupalgeddon 3 SA-CORE-2018-004 CVE-2018-7602 Patch released on April 25th, 2018 Remote code execution as authenticated user All versions affected prior to 7.59 and 8.5.3 20/25 score on NIST index Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 28. Drupalgeddon 3 Destination parameter GET parameter used to redirect to an URL after execution It’s passed to stripDangerousValues to sanitize it Double encoding not detected: “#” → “ %23” → “ %2523” Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 29. Drupalgeddon 3 Destination parameter GET parameter used to redirect to an URL after execution It’s passed to stripDangerousValues to sanitize it Double encoding not detected: “#” → “ %23” → “ %2523” Option trigering element name File includes/ajax.inc Identifies the element used for submission Sets a form element to be renderized again Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 30. Drupalgeddon 3 The vulnerability: First step Perform a POST call to URL of a confirmation form trigering element name with value form id Destination contains a field with post render callback POST call redirects to confirmation form again → All set Payload must be URL encoded Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 31. Drupalgeddon 3 The vulnerability: First step Perform a POST call to URL of a confirmation form trigering element name with value form id Destination contains a field with post render callback POST call redirects to confirmation form again → All set Payload must be URL encoded Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 32. Drupalgeddon 3 The vulnerability: Second step Execute form cancel action as AJAX POST call /file/ajax/actions/cancel/ %23options/path/[form build id] Ajax API processes the form and executes poisoned post render Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 33. Drupalgeddon 3 Let’s see it Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 34. Index 1 Introduction 2 Analysis of Vulnerabilities 3 What if I don’t patch? Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 35. Attacks in the wild Kids, don’t do this at home Full database dump Execute cryptocurrency mining malware Server used as malicious proxy Infect site users Defacement / Black SEO ??? Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 36. In summary . . . Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities
  • 37. That’s all, folks! Thank you! @RabbitLair zequi[at]lullabot[dot]com Zequi V´azquez @RabbitLair Autopsy of Vulnerabilities