SlideShare a Scribd company logo
T3DD12 Security
                       Beyond SQL Injections
                                 13.04.2012

         Helmut Hummel <helmut@typo3.org>




TYPO3 Developer Days - Munich 2012             Inspiring people
Security Workshop                    1
                                               shar
Introduction


Who‘s that guy?
     TYPO3 Security Team Leader

     TYPO3 Core Team Member

     Employed @ naw.info in Hannover, Germany




TYPO3 Developer Days - Munich 2012         Inspiring people
Security Workshop                    2
                                           shar
T3DD12 Security Workshop


Agenda
     Web Application Security - a Recap

     Did you know ...?

     Knowing the Enemy

     Best Practice

     TYPO3 Security Team




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    3
                                          shar
What is Security?




TYPO3 Developer Days - Munich 2012       Inspiring people
Security Workshop                    4
                                         shar
Absence of potential




TYPO3 Developer Days - Munich 2012       Inspiring people
Security Workshop                    5
                                         shar
What is Security?


Characteristics of Security




TYPO3 Developer Days - Munich 2012       Inspiring people
Security Workshop                    6
                                         shar
What is Security?


Characteristics of Security
     There is no absolute Security




TYPO3 Developer Days - Munich 2012       Inspiring people
Security Workshop                    6
                                         shar
What is Security?


Characteristics of Security
     There is no absolute Security

     An evironment is only as secure as it‘s weakest
     point




TYPO3 Developer Days - Munich 2012             Inspiring people
Security Workshop                    6
                                               shar
What is Security?


Characteristics of Security
     There is no absolute Security

     An evironment is only as secure as it‘s weakest
     point

     Security is an investment




TYPO3 Developer Days - Munich 2012             Inspiring people
Security Workshop                    6
                                               shar
What is Security?


Characteristics of Security
     There is no absolute Security

     An evironment is only as secure as it‘s weakest
     point

     Security is an investment

     The efforts for Security must be proportianal to
     the potential damage




TYPO3 Developer Days - Munich 2012              Inspiring people
Security Workshop                    6
                                                shar
What is Security?


Characteristics of Security
     There is no absolute Security

     An evironment is only as secure as it‘s weakest
     point

     Security is an investment

     The efforts for Security must be proportianal to
     the potential damage

     An application or a service can be called secure, if
     the effort of compromising it are way higher than
     the possible gains


TYPO3 Developer Days - Munich 2012               Inspiring people
Security Workshop                    6
                                                 shar
What is Security?


Security is relative




TYPO3 Developer Days - Munich 2012       Inspiring people
Security Workshop                    7
                                         shar
What is Security?


Security is relative
     Security depends on your needs




TYPO3 Developer Days - Munich 2012       Inspiring people
Security Workshop                    7
                                         shar
What is Security?


Security is relative
     Security depends on your needs

     Security depends on a certain point in time




TYPO3 Developer Days - Munich 2012                 Inspiring people
Security Workshop                    7
                                               shar
What is Security?


Security is relative
     Security depends on your needs

     Security depends on a certain point in time

     Security needs to be constantly adapte and
     improved




TYPO3 Developer Days - Munich 2012                 Inspiring people
Security Workshop                    7
                                               shar
Security is a process, not
          a product.
                            (Bruce Schneier)




TYPO3 Developer Days - Munich 2012             Inspiring people
Security Workshop                    8
                                               shar
Criteria for Security




TYPO3 Developer Days - Munich 2012       Inspiring people
Security Workshop                    9
                                         shar
Criteria for Security




                        10
Criteria for Security




                        Security




                           10
Criteria for Security




                        Integrity




                        Security




                           10
Criteria for Security




                        Integrity




                        Security


                                    Availability




                           10
Criteria for Security




                        Integrity




                        Security


       Confidentiality               Availability




                           10
General Security Priciples
     Least privilege

     Minimize Exposure

     Do not rely on „security by obscurity“

     Defense in depth




TYPO3 Developer Days - Munich 2012            Inspiring people
Security Workshop                    11
                                              shar
Defense in Depth




            12
Defense in Depth
PHP-application

     PHP

    DBMS

  Webserver

      OS

    Server
                  12
Defense in Depth
PHP-application

     PHP

    DBMS

  Webserver

      OS

    Server             Firewall
                        Proxy
                  12
Defense in Depth
PHP-application

     PHP

    DBMS

  Webserver

      OS               Harding



    Server             Firewall
                        Proxy
                  12
Defense in Depth
PHP-application

     PHP

    DBMS

  Webserver            mod_security



      OS               Harding



    Server             Firewall
                        Proxy
                  12
Defense in Depth
PHP-application

     PHP

    DBMS               SQL Proxy



  Webserver            mod_security



      OS               Harding



    Server             Firewall
                        Proxy
                  12
Defense in Depth
PHP-application

     PHP               suhosin



    DBMS               SQL Proxy



  Webserver            mod_security



      OS               Harding



    Server             Firewall
                        Proxy
                  12
Defense in Depth
PHP-application        security layer(s)



     PHP                suhosin



    DBMS                SQL Proxy



  Webserver             mod_security



      OS                Harding



    Server              Firewall
                         Proxy
                  12
Did you know?




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    13
                                          shar
TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    14
                                          shar
TypoScript




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    15
                                          shar
page.10 = CONTENT
page.10.table = tt_content
page.10.where = colPos=0
page.10.andWhere.data = GP:page_id
page.10.andWhere.wrap = pid=|




                         16
page.10 = CONTENT
page.10.table = tt_content
page.10.where = colPos=0
page.10.andWhere.data = GP:page_id
page.10.andWhere.intval = 1
page.10.andWhere.wrap = pid=|




                         17
page.10 = TEXT
page.10.field = title
page.10.wrap = <h1 class="c-{field:layout}">|</h1>
page.10.insertData = 1




                          18
page.10 = TEXT
page.10.field = title
page.10.wrap = <h1 class="c-{field:layout}">|</h1>
page.10.insertData = 1




                          19
page.10 = TEXT
page.10.field = title
page.10.dataWrap = <h1 class="c-{field:layout}">|</h1>




                          20
page.10 = TEXT
page.10.field = title
page.10.dataWrap = <h1 class="c-{field:layout}">|</h1>
page.10.htmlSpecialChars = 1




                          21
page.10 = TEXT
page.10.field = title
page.10.dataWrap = <h1 class="c-{field:layout}">|</h1>
page.10.htmlSpecialChars = 1




                          22
Security Problems




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    23
                                          shar
XSS




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    24
                                          shar
HTML Contexts
     HTML-Element

     HTML-Attribute Value

     JS-Values

     URL Parameter




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    25
                                          shar
CSRF




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    26
                                          shar
CSRF

<img src="http://bank.com/transfer.do?
acct=MARIA&amount=100000" width="1" height="1"
border="0">




                       27
Avoid CSRF
     Secret random token in the request

     Save token in session

     One-Time Token may have usability impacts




TYPO3 Developer Days - Munich 2012          Inspiring people
Security Workshop                    28
                                            shar
SQLi




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    29
                                          shar
File Handling




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    30
                                          shar
Header Injection




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    31
                                          shar
Code Injection




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    32
                                          shar
Insecure Unserialize




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    33
                                          shar
Extbase Security




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    34
                                          shar
XSS




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    35
                                          shar
extbase


XSS
     Flash Messages

     Context




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    36
                                          shar
SQLi




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    37
                                          shar
Mass Assignment




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    38
                                          shar
Access Violation




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    39
                                          shar
Knowing the enemy




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    40
                                          shar
Demo




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    41
                                          shar
Best Practice




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    42
                                          shar
Best Practice




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    43
                                          shar
Best Practice
     The world is bad™




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    43
                                          shar
Best Practice
     The world is bad™

     Every request is an attack as long the opposite is
     proven




TYPO3 Developer Days - Munich 2012              Inspiring people
Security Workshop                    43
                                                shar
Best Practice
     The world is bad™

     Every request is an attack as long the opposite is
     proven

     User input is untrustable




TYPO3 Developer Days - Munich 2012              Inspiring people
Security Workshop                    43
                                                shar
Best Practice
     The world is bad™

     Every request is an attack as long the opposite is
     proven

     User input is untrustable

     User input needs to be validated and encoded and
     escaped right before output




TYPO3 Developer Days - Munich 2012              Inspiring people
Security Workshop                    43
                                                shar
Best Practice
     The world is bad™

     Every request is an attack as long the opposite is
     proven

     User input is untrustable

     User input needs to be validated and encoded and
     escaped right before output

     Encoding and escaping depends on the context




TYPO3 Developer Days - Munich 2012              Inspiring people
Security Workshop                    43
                                                shar
Best Practice
     The world is bad™

     Every request is an attack as long the opposite is
     proven

     User input is untrustable

     User input needs to be validated and encoded and
     escaped right before output

     Encoding and escaping depends on the context

     Separation of Concerns


TYPO3 Developer Days - Munich 2012              Inspiring people
Security Workshop                    43
                                                shar
What is User Input?




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    44
                                          shar
What is User Input?
     $_REQUEST ($_GET, $_POST, $_COOKIE)




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    44
                                          shar
What is User Input?
     $_REQUEST ($_GET, $_POST, $_COOKIE)

     $_FILES




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    44
                                          shar
What is User Input?
     $_REQUEST ($_GET, $_POST, $_COOKIE)

     $_FILES

     $_SERVER




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    44
                                          shar
What is User Input?
     $_REQUEST ($_GET, $_POST, $_COOKIE)

     $_FILES

     $_SERVER

     Filenames




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    44
                                          shar
What is User Input?
     $_REQUEST ($_GET, $_POST, $_COOKIE)

     $_FILES

     $_SERVER

     Filenames

     External Services




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    44
                                          shar
What is User Input?
     $_REQUEST ($_GET, $_POST, $_COOKIE)

     $_FILES

     $_SERVER

     Filenames

     External Services

     Editors are users




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    44
                                          shar
How to treat User Input
     Validation

     Filtering

     Escaping

     Encoding




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    45
                                          shar
How to treat User Input


    User Input            evil™




  Validate/ Filter        stop execution?




 Escaping/ Encoding       context!




      Output

                           46
How to treat User Input
     Filter Input




     Escape Output




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    47
                                          shar
How to treat User Input
     Filter Input

        Check Type

        Check Format

        Check length

     Escape Output

        Context!

          DB, HTML, JS

          Directly before output
TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    48
                                          shar
Separation of Concerns
 Security issues are bugs

 Clean code leads to less bugs

 Test Driven Development

 Leave Security to Security Code




                        49
TYPO3 Security Team




TYPO3 Developer Days - Munich 2012        Inspiring people
Security Workshop                    50
                                          shar
TYPO3 Security Team


TYPO3 Security Team
     Responsible Disclosure Policy

     One communication channel (security@typo3.org)

     Pre-Announcements for critical issues only

     You can support us with sober and precise
     communication and reading the Security Bulletins
     carefully




TYPO3 Developer Days - Munich 2012            Inspiring people
Security Workshop                    51
                                              shar
TYPO3 Security Team


CVSS2 Score
     It is a calculation to help you to identify the
     severity of a Security Issue

     The result are 4 different Scores

        Base Score

        Temporal Score

        Environmental Score

        Overall Score



TYPO3 Developer Days - Munich 2012                 Inspiring people
Security Workshop                    52
                                                   shar
53
53
53
53
54
54
54
55
55
55
56
Questions?




     57
Thank you!
     @helhum
h.hummel@naw.info




        58

More Related Content

Similar to T3DD12 Security Workshop

Web Application Security Workshop TYPO3 Developer Days 2014
Web Application Security Workshop TYPO3 Developer Days 2014Web Application Security Workshop TYPO3 Developer Days 2014
Web Application Security Workshop TYPO3 Developer Days 2014
Helmut Hummel
 

Similar to T3DD12 Security Workshop (20)

Steering a Bullet Train: Owasp Latam Tour BA 2015
Steering a Bullet Train: Owasp Latam Tour BA 2015Steering a Bullet Train: Owasp Latam Tour BA 2015
Steering a Bullet Train: Owasp Latam Tour BA 2015
 
Web Application Security Workshop TYPO3 Developer Days 2014
Web Application Security Workshop TYPO3 Developer Days 2014Web Application Security Workshop TYPO3 Developer Days 2014
Web Application Security Workshop TYPO3 Developer Days 2014
 
Alfresco Virtual DevCon 2020 - Security First!
Alfresco Virtual DevCon 2020 - Security First!Alfresco Virtual DevCon 2020 - Security First!
Alfresco Virtual DevCon 2020 - Security First!
 
Reversing & Malware Analysis Training Part 13 - Future Roadmap
Reversing & Malware Analysis Training Part 13 - Future RoadmapReversing & Malware Analysis Training Part 13 - Future Roadmap
Reversing & Malware Analysis Training Part 13 - Future Roadmap
 
Cloud, DevOps and the New Security Practitioner
Cloud, DevOps and the New Security PractitionerCloud, DevOps and the New Security Practitioner
Cloud, DevOps and the New Security Practitioner
 
JSCONF 2018 - Baking security into DevOps - a tale of hunting down bugs befor...
JSCONF 2018 - Baking security into DevOps - a tale of hunting down bugs befor...JSCONF 2018 - Baking security into DevOps - a tale of hunting down bugs befor...
JSCONF 2018 - Baking security into DevOps - a tale of hunting down bugs befor...
 
Security within Scaled Agile
Security within Scaled AgileSecurity within Scaled Agile
Security within Scaled Agile
 
Dev secops. Real experience.
Dev secops. Real experience.Dev secops. Real experience.
Dev secops. Real experience.
 
Chameleon Secure Solutions Overview Presentation
Chameleon Secure Solutions Overview PresentationChameleon Secure Solutions Overview Presentation
Chameleon Secure Solutions Overview Presentation
 
SACON - Automating SecOps (Murray Goldschmidt)
SACON - Automating SecOps (Murray Goldschmidt)SACON - Automating SecOps (Murray Goldschmidt)
SACON - Automating SecOps (Murray Goldschmidt)
 
Db2z bp security_transcript
Db2z bp security_transcriptDb2z bp security_transcript
Db2z bp security_transcript
 
OWASP AppSecEu 2016 Rome - Building secure cloud native apps
OWASP AppSecEu 2016 Rome - Building secure cloud native appsOWASP AppSecEu 2016 Rome - Building secure cloud native apps
OWASP AppSecEu 2016 Rome - Building secure cloud native apps
 
Csa UK agm 2019 - Nsc42 - is the cloud secure - is easy if you do it smart Fr...
Csa UK agm 2019 - Nsc42 - is the cloud secure - is easy if you do it smart Fr...Csa UK agm 2019 - Nsc42 - is the cloud secure - is easy if you do it smart Fr...
Csa UK agm 2019 - Nsc42 - is the cloud secure - is easy if you do it smart Fr...
 
Nsc42-CSA AGM is the cloud secure - is easy if you do it smart
Nsc42-CSA AGM is the cloud secure - is easy if you do it smartNsc42-CSA AGM is the cloud secure - is easy if you do it smart
Nsc42-CSA AGM is the cloud secure - is easy if you do it smart
 
Innovation and Architecture
Innovation and ArchitectureInnovation and Architecture
Innovation and Architecture
 
Getting to Know Security and Devs: Keys to Successful DevSecOps
Getting to Know Security and Devs: Keys to Successful DevSecOpsGetting to Know Security and Devs: Keys to Successful DevSecOps
Getting to Know Security and Devs: Keys to Successful DevSecOps
 
OWASP Québec: Threat Modeling Toolkit - Jonathan Marcil
OWASP Québec: Threat Modeling Toolkit - Jonathan MarcilOWASP Québec: Threat Modeling Toolkit - Jonathan Marcil
OWASP Québec: Threat Modeling Toolkit - Jonathan Marcil
 
Hardening as Part of a holistic Security Strategy
Hardening as Part of a holistic Security StrategyHardening as Part of a holistic Security Strategy
Hardening as Part of a holistic Security Strategy
 
ABN AMRO DevSecOps Journey
ABN AMRO DevSecOps JourneyABN AMRO DevSecOps Journey
ABN AMRO DevSecOps Journey
 
Risk Analytics: One Intelligent View
Risk Analytics: One Intelligent ViewRisk Analytics: One Intelligent View
Risk Analytics: One Intelligent View
 

Recently uploaded

Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 

Recently uploaded (20)

Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 

T3DD12 Security Workshop

  • 1. T3DD12 Security Beyond SQL Injections 13.04.2012 Helmut Hummel <helmut@typo3.org> TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 1 shar
  • 2. Introduction Who‘s that guy? TYPO3 Security Team Leader TYPO3 Core Team Member Employed @ naw.info in Hannover, Germany TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 2 shar
  • 3. T3DD12 Security Workshop Agenda Web Application Security - a Recap Did you know ...? Knowing the Enemy Best Practice TYPO3 Security Team TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 3 shar
  • 4. What is Security? TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 4 shar
  • 5. Absence of potential TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 5 shar
  • 6. What is Security? Characteristics of Security TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 6 shar
  • 7. What is Security? Characteristics of Security There is no absolute Security TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 6 shar
  • 8. What is Security? Characteristics of Security There is no absolute Security An evironment is only as secure as it‘s weakest point TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 6 shar
  • 9. What is Security? Characteristics of Security There is no absolute Security An evironment is only as secure as it‘s weakest point Security is an investment TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 6 shar
  • 10. What is Security? Characteristics of Security There is no absolute Security An evironment is only as secure as it‘s weakest point Security is an investment The efforts for Security must be proportianal to the potential damage TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 6 shar
  • 11. What is Security? Characteristics of Security There is no absolute Security An evironment is only as secure as it‘s weakest point Security is an investment The efforts for Security must be proportianal to the potential damage An application or a service can be called secure, if the effort of compromising it are way higher than the possible gains TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 6 shar
  • 12. What is Security? Security is relative TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 7 shar
  • 13. What is Security? Security is relative Security depends on your needs TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 7 shar
  • 14. What is Security? Security is relative Security depends on your needs Security depends on a certain point in time TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 7 shar
  • 15. What is Security? Security is relative Security depends on your needs Security depends on a certain point in time Security needs to be constantly adapte and improved TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 7 shar
  • 16. Security is a process, not a product. (Bruce Schneier) TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 8 shar
  • 17. Criteria for Security TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 9 shar
  • 19. Criteria for Security Security 10
  • 20. Criteria for Security Integrity Security 10
  • 21. Criteria for Security Integrity Security Availability 10
  • 22. Criteria for Security Integrity Security Confidentiality Availability 10
  • 23. General Security Priciples Least privilege Minimize Exposure Do not rely on „security by obscurity“ Defense in depth TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 11 shar
  • 25. Defense in Depth PHP-application PHP DBMS Webserver OS Server 12
  • 26. Defense in Depth PHP-application PHP DBMS Webserver OS Server Firewall Proxy 12
  • 27. Defense in Depth PHP-application PHP DBMS Webserver OS Harding Server Firewall Proxy 12
  • 28. Defense in Depth PHP-application PHP DBMS Webserver mod_security OS Harding Server Firewall Proxy 12
  • 29. Defense in Depth PHP-application PHP DBMS SQL Proxy Webserver mod_security OS Harding Server Firewall Proxy 12
  • 30. Defense in Depth PHP-application PHP suhosin DBMS SQL Proxy Webserver mod_security OS Harding Server Firewall Proxy 12
  • 31. Defense in Depth PHP-application security layer(s) PHP suhosin DBMS SQL Proxy Webserver mod_security OS Harding Server Firewall Proxy 12
  • 32. Did you know? TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 13 shar
  • 33. TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 14 shar
  • 34. TypoScript TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 15 shar
  • 35. page.10 = CONTENT page.10.table = tt_content page.10.where = colPos=0 page.10.andWhere.data = GP:page_id page.10.andWhere.wrap = pid=| 16
  • 36. page.10 = CONTENT page.10.table = tt_content page.10.where = colPos=0 page.10.andWhere.data = GP:page_id page.10.andWhere.intval = 1 page.10.andWhere.wrap = pid=| 17
  • 37. page.10 = TEXT page.10.field = title page.10.wrap = <h1 class="c-{field:layout}">|</h1> page.10.insertData = 1 18
  • 38. page.10 = TEXT page.10.field = title page.10.wrap = <h1 class="c-{field:layout}">|</h1> page.10.insertData = 1 19
  • 39. page.10 = TEXT page.10.field = title page.10.dataWrap = <h1 class="c-{field:layout}">|</h1> 20
  • 40. page.10 = TEXT page.10.field = title page.10.dataWrap = <h1 class="c-{field:layout}">|</h1> page.10.htmlSpecialChars = 1 21
  • 41. page.10 = TEXT page.10.field = title page.10.dataWrap = <h1 class="c-{field:layout}">|</h1> page.10.htmlSpecialChars = 1 22
  • 42. Security Problems TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 23 shar
  • 43. XSS TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 24 shar
  • 44. HTML Contexts HTML-Element HTML-Attribute Value JS-Values URL Parameter TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 25 shar
  • 45. CSRF TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 26 shar
  • 47. Avoid CSRF Secret random token in the request Save token in session One-Time Token may have usability impacts TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 28 shar
  • 48. SQLi TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 29 shar
  • 49. File Handling TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 30 shar
  • 50. Header Injection TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 31 shar
  • 51. Code Injection TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 32 shar
  • 52. Insecure Unserialize TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 33 shar
  • 53. Extbase Security TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 34 shar
  • 54. XSS TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 35 shar
  • 55. extbase XSS Flash Messages Context TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 36 shar
  • 56. SQLi TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 37 shar
  • 57. Mass Assignment TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 38 shar
  • 58. Access Violation TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 39 shar
  • 59. Knowing the enemy TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 40 shar
  • 60. Demo TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 41 shar
  • 61. Best Practice TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 42 shar
  • 62. Best Practice TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 43 shar
  • 63. Best Practice The world is bad™ TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 43 shar
  • 64. Best Practice The world is bad™ Every request is an attack as long the opposite is proven TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 43 shar
  • 65. Best Practice The world is bad™ Every request is an attack as long the opposite is proven User input is untrustable TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 43 shar
  • 66. Best Practice The world is bad™ Every request is an attack as long the opposite is proven User input is untrustable User input needs to be validated and encoded and escaped right before output TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 43 shar
  • 67. Best Practice The world is bad™ Every request is an attack as long the opposite is proven User input is untrustable User input needs to be validated and encoded and escaped right before output Encoding and escaping depends on the context TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 43 shar
  • 68. Best Practice The world is bad™ Every request is an attack as long the opposite is proven User input is untrustable User input needs to be validated and encoded and escaped right before output Encoding and escaping depends on the context Separation of Concerns TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 43 shar
  • 69. What is User Input? TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 44 shar
  • 70. What is User Input? $_REQUEST ($_GET, $_POST, $_COOKIE) TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 44 shar
  • 71. What is User Input? $_REQUEST ($_GET, $_POST, $_COOKIE) $_FILES TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 44 shar
  • 72. What is User Input? $_REQUEST ($_GET, $_POST, $_COOKIE) $_FILES $_SERVER TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 44 shar
  • 73. What is User Input? $_REQUEST ($_GET, $_POST, $_COOKIE) $_FILES $_SERVER Filenames TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 44 shar
  • 74. What is User Input? $_REQUEST ($_GET, $_POST, $_COOKIE) $_FILES $_SERVER Filenames External Services TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 44 shar
  • 75. What is User Input? $_REQUEST ($_GET, $_POST, $_COOKIE) $_FILES $_SERVER Filenames External Services Editors are users TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 44 shar
  • 76. How to treat User Input Validation Filtering Escaping Encoding TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 45 shar
  • 77. How to treat User Input User Input evil™ Validate/ Filter stop execution? Escaping/ Encoding context! Output 46
  • 78. How to treat User Input Filter Input Escape Output TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 47 shar
  • 79. How to treat User Input Filter Input Check Type Check Format Check length Escape Output Context! DB, HTML, JS Directly before output TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 48 shar
  • 80. Separation of Concerns Security issues are bugs Clean code leads to less bugs Test Driven Development Leave Security to Security Code 49
  • 81. TYPO3 Security Team TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 50 shar
  • 82. TYPO3 Security Team TYPO3 Security Team Responsible Disclosure Policy One communication channel (security@typo3.org) Pre-Announcements for critical issues only You can support us with sober and precise communication and reading the Security Bulletins carefully TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 51 shar
  • 83. TYPO3 Security Team CVSS2 Score It is a calculation to help you to identify the severity of a Security Issue The result are 4 different Scores Base Score Temporal Score Environmental Score Overall Score TYPO3 Developer Days - Munich 2012 Inspiring people Security Workshop 52 shar
  • 84. 53
  • 85. 53
  • 86. 53
  • 87. 53
  • 88. 54
  • 89. 54
  • 90. 54
  • 91. 55
  • 92. 55
  • 93. 55
  • 94. 56
  • 96. Thank you! @helhum h.hummel@naw.info 58

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. Apache, OS, PHP\n
  24. Green SQL\n
  25. Green SQL\n
  26. Green SQL\n
  27. Green SQL\n
  28. Green SQL\n
  29. Green SQL\n
  30. Green SQL\n
  31. Green SQL\n
  32. Green SQL\n
  33. Green SQL\n
  34. Green SQL\n
  35. Green SQL\n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. DB : tt_content:234:header\nDB : be_users:1:password\n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. (CASE WHEN (SELECT ASCII(SUBSTRING(password, 1, 1)) FROM be_users where username = 0x61646D696E) = 65 THEN date ELSE title END)\n
  61. \n
  62. edit falsches Feld\n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n
  73. \n
  74. \n
  75. \n
  76. \n
  77. \n
  78. \n
  79. \n
  80. \n
  81. \n
  82. \n
  83. \n
  84. \n
  85. \n
  86. \n
  87. \n
  88. \n
  89. \n
  90. \n
  91. \n
  92. \n
  93. \n
  94. \n
  95. \n