SlideShare a Scribd company logo
Join the conversation #DevSecCon
The Path of Secure Software
BY KATY ANTON CA / VERACODE
Katy Anton
• Software development background
• Certified Secure Software Lifecycle Professional (CSSLP)
• Application Security Consultant @Veracode (part of CA
Technologies)
• OWASP Bristol Chapter Leader
• Project Co-leader for OWASP Top 10 Proactive Controls
OWASP Top 10 Risks - 2013
A1 – Injection A2 - Broken Auth.
and Session
Management
A3 – Cross-Site
Scripting (XSS)
A4 – Insecure
Direct Object
References
A5 – Security
Misconfiguration
A6 – Sensitive
Data Exposure
A7 – Missing
Function Level
Access Control
A8 – Cross-Site
Request Forgery
A9 – Using Comp.
with Known
Vulnerabilities
A10 – Unvalidated
Redirects and
Forwards
Cyber attacks
Casinos
New Website
OWASP Application Security Verification Standard
(ASVS)
OWASP ASVS
C1. Consider OWASP ASVS
• Choose the level of security for your application
• Extract the requirements for that level
• Use requirements to generate test cases
• Integrate security testing in SDLC.
C1. Build Security Into Software Early and Verify It
Development
Code Commit
Deployment
Code
review
System
Tests
Pre-commit
hooks
Unit Tests
Unit Test
Regression
Tests
C1. Verify for Security Early and Often
C1. Vulnerabilities Addressed - All Top Ten!
A1 – Injection A2 – Broken Auth.
and Session
Management
A3 – Cross-Site
Scripting (XSS)
A4 – Insecure
Direct Object
References
A5 – Security
Misconfiguration
A6 – Sensitive
Data Exposure
A7 – Missing
Function Level
Access Control
A8 – Cross-Site
Request Forgery
A9 – Using Comp.
with Known
Vulnerabilities
A10 - Unvalidated
Redirects and
Forwards
SQL injection example
$email=‘;- - @owasp.org;
$sql = UPDATE user set email=‘$email’ WHERE id=‘1’;
$sql = UPDATE user SET email=‘'; -- @owasp.org' WHERE id=‘1’;
Becomes
C2. Query Parameterization Example
String cmd = String.Format(“SELECT * FROM users where userID = {}”,userID)
reader = cmd.ExecuteReader();
Example of Query ParameterisationHow not to do it ! .
C2. Query Parameterization - Correct Usage
string cmd= "SELECT * FROM users WHERE userId = @Id";
SqlCommand sql = new SqlCommand(cmd);
sql.SqlParameter("@Id", System.Data.SqlDbType.Int));
sql.Parameters["@Id"].Value = ID;
reader = sql.ExecuteReader();
Secure Database Access
Credentials:
• Store encrypted credentials out of the source code
Database user:
• Grant least privilege
• Remove unrequired users
Stored procedures:
• Grant EXECUTE permissions on the stored procedures
• Revoke or deny all permissions to the underlying tables for all roles
C2: Vulnerabilities Addressed
A1 – Injection A2 – Broken Auth.
and Session
Management
A3 – Cross-Site
Scripting (XSS)
A4 – Insecure
Direct Object
References
A5 – Security
Misconfiguration
A6 – Sensitive
Data Exposure
A7 – Missing
Function Level
Access Control
A8 – Cross-Site
Request Forgery
A9 – Using Comp.
with Known
Vulnerabilities
A10 – Unvalidated
Redirects and
Forwards
XSS Example
C3. Encode Your Output
C3. Contextual Encoding Libraries
Java OWASP Java Encoder Project
.Net AntiXSS
PHP Symfony 2+: Twig
Zend Framework: ZendEscaper
C3. Vulnerabilities Addressed
A1 – Injection A2 – Broken Auth.
and Session
Management
A3 – Cross-Site
Scripting (XSS)
A4 – Insecure
Direct Object
References
A5 – Security
Misconfiguration
A6 – Sensitive
Data Exposure
A7 – Missing
Function Level
Access Control
A8 – Cross-Site
Request Forgery
A9 – Using Comp.
with Known
Vulnerabilities
A10 – Unvalidated
Redirects and
Forwards
C4. Validate All Input
C4. Example of Validations
• GET / POST data (including hidden fields )
• File uploads
• HTTP Headers
• Cookies
• Database
C4. Vulnerabilities Addressed
A1 – Injection A2 – Broken Auth.
and Session
Management
A3 – Cross-Site
Scripting (XSS)
A4 – Insecure
Direct Object
References
A5 – Security
Misconfiguration
A6 – Sensitive
Data Exposure
A7 – Missing
Function Level
Access Control
A8 – Cross-Site
Request Forgery
A9 – Using Comp.
with Known
Vulnerabilities
A10 - Unvalidated
Redirects and
Forwards
C5. Implement Digital Identity Controls
C5. Best practices
• Secure Password Storage
• Multi-Factor Authentication
• Secure Password Recovery Mechanism
• Transmit sensitive data only over TLS (v1.2)
• Error Messages
C5. Strong cryptographic algorithms
• PBKDF2
• scrypt
• bcrypt
Source: https://www.owasp.org/index.php/Password_Storage_Cheat_Sheet
NIST: 2017 Digital Identity Guidelines
• Allow all ASCII printable characters, including space
• Minimum 8 characters length
• Allow users to passwords lengthy as they want, within reason.
• Offer guidance, such as a password-strength meter
• Do not require password to be changed periodically
• Permit to use “paste” functionality
• Check against a list of bad password
Source: https://pages.nist.gov/800-63-3/sp800-63b.html
Hash Password with a modern Hash
Problem:
• Long passwords can cause DoS
• bcrypt truncates passwords to 72 bytes
Solution:
• SHA-512 - converts long passwords to 512 bits
C5. Secure Password Storage
protect(sha512(password), [salt], [workFactor])
+
2nd Factor Authentication
Don’t use SMS as multi-factor (use FIDO or dedicated app)
C5. Password Storage – How Not To Do It!
$password=bcrypt([salt] + [password], work_factor);
$loginkey =md5(lc([username]).”::”.lc([password]))
C5. Error Messages - How Not To Do It!
Error message for not-registered userError message for valid user
C5. Vulnerabilities Addressed
A1 – Injection A2 – Broken Auth.
and Session
Management
A3 – Cross-Site
Scripting (XSS)
A4 – Insecure
Direct Object
References
A5 – Security
Misconfiguration
A6 – Sensitive
Data Exposure
A7 – Missing
Function Level
Access Control
A8 – Cross-Site
Request Forgery
A9 – Using Comp.
with Known
Vulnerabilities
A10 – Unvalidated
Redirects and
Forwards
C6. Implement Appropriate Access Controls
C6. Vulnerabilities Addressed
A1 – Injection A2 – Broken Auth.
and Session
Management
A3 – Cross-Site
Scripting (XSS)
A4 – Insecure
Direct Object
References
A5 – Security
Misconfiguration
A6 – Sensitive
Data Exposure
A7 – Missing
Function Level
Access Control
A8 – Cross-Site
Request Forgery
A9 – Using Comp.
with Known
Vulnerabilities
A10 – Unvalidated
Redirects and
Forwards
C7. Protect Data
C7. Data in Transit
Data in transit: HTTPS
• Confidentiality: Spy cannot view your data
• Integrity: Spy cannot change your data
• Authenticity: Server you visit is the right one
MITM Protection - HSTS
• HTTPS + Strict Transport Security Header
C7. Data at Rest
1. Strong algorithm – AES
2. Secure key management
3. Adequate access controls and auditing
C7. Vulnerabilities Addressed
A1 – Injection A2 – Broken Auth.
and Session
Management
A3 – Cross-Site
Scripting (XSS)
A4 – Insecure
Direct Object
References
A5 – Security
Misconfiguration
A6 – Sensitive
Data Exposure
A7 – Missing
Function Level
Access Control
A8 – Cross-Site
Request Forgery
A9 – Using Comp.
with Known
Vulnerabilities
A10 – Unvalidated
Redirects and
Forwards
C8. Implement Logging and Intrusion Detection
C8. Examples of Intrusion Detection Points
• Application receives GET when expecting POST
• Additional form or URL parameters submitted with request
• Input validation failure server side when client side validation exists
• Input validation failure server side on non-user editable parameters
such as hidden fields, checkboxes, radio buttons or select lists
• HTTP headers, Cookies received differ from the expected
Source: https://www.owasp.org/index.php/OWASP_AppSensor_Project
Logging Frameworks
• Use logging framework
• Encode untrusted data -> protection against Log injection attacks
• Validate untrusted data-> protection against Log forging attacks
C8. Vulnerabilities Addressed - All Top Ten!
A1 – Injection A2 – Broken Auth.
and Session
Management
A3 – Cross-Site
Scripting (XSS)
A4 – Insecure
Direct Object
References
A5 – Security
Misconfiguration
A6 – Sensitive
Data Exposure
A7 – Missing
Function Level
Access Control
A8 – Cross-Site
Request Forgery
A9 – Using Comp.
with Known
Vulnerabilities
A10 - Unvalidated
Redirects and
Forwards
C9. Leverage Security Frameworks
and Libraries
C9. Examples
• Access Controls
• CSRF protection
• XSS protection
• ORM - SQL injection prevention
Current state of software
Source: https://www.veracode.com/resources/state-of-software-security
Cyber breaches
Root cause of the top 50 breaches in 2016:
#1
A9-Using Components with Known Vulnerabilities
Source: snyk.io
Unmanaged 3rd Party Components
C9. API Integration Best Practices
“When you wrap a third-party API, you minimize
your dependencies upon it: You can choose to move
to a different library in the future without much
penalty. “
Robert C. Martin
Wrapper
Adapter
C9. Design Patterns for Integration
Façade
C9. Automate
OWASP Dependency Check - supported languages:
• Java
• .NET
JavaScript
• Retire.JS scanner
PHP
• PHP Security Checker
C9. Best Practices
• Use trusted sources
• Encapsulate 3rd party libraries
• Hide information
• Reduce attack surface
• Update regularly / replace
C9. Vulnerabilities Addressed - All Top Ten!
A1 – Injection A2 – Broken Auth.
and Session
Management
A3 – Cross-Site
Scripting (XSS)
A4 – Insecure
Direct Object
References
A5 – Security
Misconfiguration
A6 – Sensitive
Data Exposure
A7 – Missing
Function Level
Access Control
A8 – Cross-Site
Request Forgery
A9 – Using Comp.
with Known
Vulnerabilities
A10 - Unvalidated
Redirects and
Forwards
C10. Error and Exception Handling
C10: Best Practices
• Centralised error handling
• Verbose enough to explain the issue
• Don’t leak critical information
C10. Don’t leak information !
A1 – Injection A2 – Broken Auth.
and Session
Management
A3 – Cross-Site
Scripting (XSS)
A4 – Insecure
Direct Object
References
A5 – Security
Misconfiguration
A6 – Sensitive
Data Exposure
A7 – Missing
Function Level
Access Control
A8 – Cross-Site
Request Forgery
A9 – Using Comp.
with Known
Vulnerabilities
A10 - Unvalidated
Redirects and
Forwards
C10. Vulnerabilities Addressed - All Top Ten!
Developer Controls
C1
Build Security Early
C4
Validate Input
C6
Access Controls
C5
Digital Identity C7
Protect Data
C10
Error Handling
C8
Logging
C2
Secure Database Access
C9
Leverage security
C3
Encode Data
Project Page
Project page: https://www.owasp.org/index.php/OWASP_Proactive_Controls
Twitter: @OWASPControls
Join the conversation #DevSecCon
Thank you
Katy Anton
Application Security Consultant
Ca / Veracode

More Related Content

PDF
Why does security matter for devops by Caroline Wong
PDF
Threat Modeling workshop by Robert Hurlbut
PPTX
Turning security into code by Jeff Williams
PPTX
The road goes ever on and on by Ciaran Conliffe
PDF
Bringing Security Testing to Development: How to Enable Developers to Act as ...
PDF
Threat modeling with architectural risk patterns
PDF
Scalable threat modelling with risk patterns
PDF
Threat Modeling Everything
Why does security matter for devops by Caroline Wong
Threat Modeling workshop by Robert Hurlbut
Turning security into code by Jeff Williams
The road goes ever on and on by Ciaran Conliffe
Bringing Security Testing to Development: How to Enable Developers to Act as ...
Threat modeling with architectural risk patterns
Scalable threat modelling with risk patterns
Threat Modeling Everything

What's hot (20)

PPTX
Introduction to DevSecOps
PPTX
AllDayDevOps 2019 AppSensor
PPTX
Elizabeth Lawler - Devops, security, and compliance working in unison
PPTX
Application Security at DevOps Speed and Portfolio Scale
PDF
Why should developers care about container security?
PDF
The Joy of Proactive Security
PPTX
Agile Network India | DevSecOps - The What and the Why | Ritesh Shregill
PPTX
2017-11 Three Ways of Security - OWASP London
PDF
Devops security-An Insight into Secure-SDLC
PDF
Realities of Security in the Cloud - CSS ATX 2017
PPTX
The New Security Practitioner
PDF
Realities of Security in the Cloud
PDF
A Successful SAST Tool Implementation
PPTX
Making Security Agile
PDF
Dev seccon london 2016 intelliment security
PPTX
Cloud Security vs Security in the Cloud
PPTX
Practical Secure Coding Workshop - {DECIPHER} Hackathon
PPTX
Integrate Security into DevOps - SecDevOps
PPTX
IntroSec Con - Building Your Blue Team Arsenal - glitch
PDF
Proactive Security AppSec Case Study
Introduction to DevSecOps
AllDayDevOps 2019 AppSensor
Elizabeth Lawler - Devops, security, and compliance working in unison
Application Security at DevOps Speed and Portfolio Scale
Why should developers care about container security?
The Joy of Proactive Security
Agile Network India | DevSecOps - The What and the Why | Ritesh Shregill
2017-11 Three Ways of Security - OWASP London
Devops security-An Insight into Secure-SDLC
Realities of Security in the Cloud - CSS ATX 2017
The New Security Practitioner
Realities of Security in the Cloud
A Successful SAST Tool Implementation
Making Security Agile
Dev seccon london 2016 intelliment security
Cloud Security vs Security in the Cloud
Practical Secure Coding Workshop - {DECIPHER} Hackathon
Integrate Security into DevOps - SecDevOps
IntroSec Con - Building Your Blue Team Arsenal - glitch
Proactive Security AppSec Case Study
Ad

Similar to The path of secure software by Katy Anton (20)

PPTX
Owasp top-ten-mapping-2015-05-lwc
PPTX
Spa Secure Coding Guide
PDF
How to Harden the Security of Your .NET Website
 
PPTX
Vulnerabilities in modern web applications
PDF
Web hackingtools cf-summit2014
PDF
How to avoid top 10 security risks in Java EE applications and how to avoid them
PDF
Managed Threat Detection and Response
PPTX
OWASP top 10-2013
PDF
Managed Threat Detection & Response for AWS Applications
PDF
Web hackingtools 2015
PDF
Web hackingtools 2015
PPTX
AWS Security Architecture - Overview
PPTX
owasp top 10 security risk categories and CWE
PPTX
Owasp Indy Q2 2012 Cheat Sheet Overview
PDF
How do JavaScript frameworks impact the security of applications?
PDF
OWASP Top 10 Proactive Controls 2016 - NorthEast PHP 2017
PDF
OWASP Top 10 Proactive Controls 2016 - PHP Québec August 2017
PDF
The Path of Secure Software
PPTX
Securing Applications in the Cloud
PPTX
CS166 Final project
Owasp top-ten-mapping-2015-05-lwc
Spa Secure Coding Guide
How to Harden the Security of Your .NET Website
 
Vulnerabilities in modern web applications
Web hackingtools cf-summit2014
How to avoid top 10 security risks in Java EE applications and how to avoid them
Managed Threat Detection and Response
OWASP top 10-2013
Managed Threat Detection & Response for AWS Applications
Web hackingtools 2015
Web hackingtools 2015
AWS Security Architecture - Overview
owasp top 10 security risk categories and CWE
Owasp Indy Q2 2012 Cheat Sheet Overview
How do JavaScript frameworks impact the security of applications?
OWASP Top 10 Proactive Controls 2016 - NorthEast PHP 2017
OWASP Top 10 Proactive Controls 2016 - PHP Québec August 2017
The Path of Secure Software
Securing Applications in the Cloud
CS166 Final project
Ad

More from DevSecCon (20)

PDF
DevSecCon London 2019: Workshop: Cloud Agnostic Security Testing with Scout S...
PDF
DevSecCon London 2019: Are Open Source Developers Security’s New Front Line?
PDF
DevSecCon London 2019: How to Secure OpenShift Environments and What Happens ...
PDF
DevSecCon London 2019: A Kernel of Truth: Intrusion Detection and Attestation...
PPTX
DevSecCon Seattle 2019: Containerizing IT Security Knowledge
PPTX
DevSecCon Seattle 2019: Decentralized Authorization - Implementing Fine Grain...
PPTX
DevSecCon Seattle 2019: Liquid Software as the real solution for the Sec in D...
PPTX
DevSecCon Seattle 2019: Fully Automated production deployments with HIPAA/HIT...
PDF
DevSecCon Singapore 2019: Four years of reflection: How (not) to secure Web A...
PPTX
DevSecCon Singapore 2019: crypto jacking: An evolving threat for cloud contai...
PDF
DevSecCon Singapore 2019: Can "dev", "sec" and "ops" really coexist in the wi...
PDF
DevSecCon Singapore 2019: Workshop - Burp extension writing workshop
PDF
DevSecCon Singapore 2019: Embracing Security - A changing DevOps landscape
PDF
DevSecCon Singapore 2019: Web Services aren’t as secure as we think
PDF
DevSecCon Singapore 2019: An attacker's view of Serverless and GraphQL apps S...
PDF
DevSecCon Singapore 2019: The journey of digital transformation through DevSe...
PDF
DevSecCon Singapore 2019: Preventative Security for Kubernetes
PPTX
DevSecCon London 2018: Is your supply chain your achille's heel
PPTX
DevSecCon London 2018: Get rid of these TLS certificates
PDF
DevSecCon London 2018: Open DevSecOps
DevSecCon London 2019: Workshop: Cloud Agnostic Security Testing with Scout S...
DevSecCon London 2019: Are Open Source Developers Security’s New Front Line?
DevSecCon London 2019: How to Secure OpenShift Environments and What Happens ...
DevSecCon London 2019: A Kernel of Truth: Intrusion Detection and Attestation...
DevSecCon Seattle 2019: Containerizing IT Security Knowledge
DevSecCon Seattle 2019: Decentralized Authorization - Implementing Fine Grain...
DevSecCon Seattle 2019: Liquid Software as the real solution for the Sec in D...
DevSecCon Seattle 2019: Fully Automated production deployments with HIPAA/HIT...
DevSecCon Singapore 2019: Four years of reflection: How (not) to secure Web A...
DevSecCon Singapore 2019: crypto jacking: An evolving threat for cloud contai...
DevSecCon Singapore 2019: Can "dev", "sec" and "ops" really coexist in the wi...
DevSecCon Singapore 2019: Workshop - Burp extension writing workshop
DevSecCon Singapore 2019: Embracing Security - A changing DevOps landscape
DevSecCon Singapore 2019: Web Services aren’t as secure as we think
DevSecCon Singapore 2019: An attacker's view of Serverless and GraphQL apps S...
DevSecCon Singapore 2019: The journey of digital transformation through DevSe...
DevSecCon Singapore 2019: Preventative Security for Kubernetes
DevSecCon London 2018: Is your supply chain your achille's heel
DevSecCon London 2018: Get rid of these TLS certificates
DevSecCon London 2018: Open DevSecOps

Recently uploaded (20)

PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Encapsulation theory and applications.pdf
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Approach and Philosophy of On baking technology
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Getting Started with Data Integration: FME Form 101
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Machine Learning_overview_presentation.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Machine learning based COVID-19 study performance prediction
Group 1 Presentation -Planning and Decision Making .pptx
NewMind AI Weekly Chronicles - August'25-Week II
Digital-Transformation-Roadmap-for-Companies.pptx
Encapsulation theory and applications.pdf
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Approach and Philosophy of On baking technology
MIND Revenue Release Quarter 2 2025 Press Release
Encapsulation_ Review paper, used for researhc scholars
cloud_computing_Infrastucture_as_cloud_p
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Getting Started with Data Integration: FME Form 101
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Heart disease approach using modified random forest and particle swarm optimi...
Mobile App Security Testing_ A Comprehensive Guide.pdf
A Presentation on Artificial Intelligence
Advanced methodologies resolving dimensionality complications for autism neur...
Machine Learning_overview_presentation.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Machine learning based COVID-19 study performance prediction

The path of secure software by Katy Anton

  • 1. Join the conversation #DevSecCon The Path of Secure Software BY KATY ANTON CA / VERACODE
  • 2. Katy Anton • Software development background • Certified Secure Software Lifecycle Professional (CSSLP) • Application Security Consultant @Veracode (part of CA Technologies) • OWASP Bristol Chapter Leader • Project Co-leader for OWASP Top 10 Proactive Controls
  • 3. OWASP Top 10 Risks - 2013 A1 – Injection A2 - Broken Auth. and Session Management A3 – Cross-Site Scripting (XSS) A4 – Insecure Direct Object References A5 – Security Misconfiguration A6 – Sensitive Data Exposure A7 – Missing Function Level Access Control A8 – Cross-Site Request Forgery A9 – Using Comp. with Known Vulnerabilities A10 – Unvalidated Redirects and Forwards
  • 6. OWASP Application Security Verification Standard (ASVS)
  • 8. C1. Consider OWASP ASVS • Choose the level of security for your application • Extract the requirements for that level • Use requirements to generate test cases • Integrate security testing in SDLC.
  • 9. C1. Build Security Into Software Early and Verify It
  • 10. Development Code Commit Deployment Code review System Tests Pre-commit hooks Unit Tests Unit Test Regression Tests C1. Verify for Security Early and Often
  • 11. C1. Vulnerabilities Addressed - All Top Ten! A1 – Injection A2 – Broken Auth. and Session Management A3 – Cross-Site Scripting (XSS) A4 – Insecure Direct Object References A5 – Security Misconfiguration A6 – Sensitive Data Exposure A7 – Missing Function Level Access Control A8 – Cross-Site Request Forgery A9 – Using Comp. with Known Vulnerabilities A10 - Unvalidated Redirects and Forwards
  • 12. SQL injection example $email=‘;- - @owasp.org; $sql = UPDATE user set email=‘$email’ WHERE id=‘1’; $sql = UPDATE user SET email=‘'; -- @owasp.org' WHERE id=‘1’; Becomes
  • 13. C2. Query Parameterization Example String cmd = String.Format(“SELECT * FROM users where userID = {}”,userID) reader = cmd.ExecuteReader(); Example of Query ParameterisationHow not to do it ! .
  • 14. C2. Query Parameterization - Correct Usage string cmd= "SELECT * FROM users WHERE userId = @Id"; SqlCommand sql = new SqlCommand(cmd); sql.SqlParameter("@Id", System.Data.SqlDbType.Int)); sql.Parameters["@Id"].Value = ID; reader = sql.ExecuteReader();
  • 15. Secure Database Access Credentials: • Store encrypted credentials out of the source code Database user: • Grant least privilege • Remove unrequired users Stored procedures: • Grant EXECUTE permissions on the stored procedures • Revoke or deny all permissions to the underlying tables for all roles
  • 16. C2: Vulnerabilities Addressed A1 – Injection A2 – Broken Auth. and Session Management A3 – Cross-Site Scripting (XSS) A4 – Insecure Direct Object References A5 – Security Misconfiguration A6 – Sensitive Data Exposure A7 – Missing Function Level Access Control A8 – Cross-Site Request Forgery A9 – Using Comp. with Known Vulnerabilities A10 – Unvalidated Redirects and Forwards
  • 18. C3. Encode Your Output
  • 19. C3. Contextual Encoding Libraries Java OWASP Java Encoder Project .Net AntiXSS PHP Symfony 2+: Twig Zend Framework: ZendEscaper
  • 20. C3. Vulnerabilities Addressed A1 – Injection A2 – Broken Auth. and Session Management A3 – Cross-Site Scripting (XSS) A4 – Insecure Direct Object References A5 – Security Misconfiguration A6 – Sensitive Data Exposure A7 – Missing Function Level Access Control A8 – Cross-Site Request Forgery A9 – Using Comp. with Known Vulnerabilities A10 – Unvalidated Redirects and Forwards
  • 22. C4. Example of Validations • GET / POST data (including hidden fields ) • File uploads • HTTP Headers • Cookies • Database
  • 23. C4. Vulnerabilities Addressed A1 – Injection A2 – Broken Auth. and Session Management A3 – Cross-Site Scripting (XSS) A4 – Insecure Direct Object References A5 – Security Misconfiguration A6 – Sensitive Data Exposure A7 – Missing Function Level Access Control A8 – Cross-Site Request Forgery A9 – Using Comp. with Known Vulnerabilities A10 - Unvalidated Redirects and Forwards
  • 24. C5. Implement Digital Identity Controls
  • 25. C5. Best practices • Secure Password Storage • Multi-Factor Authentication • Secure Password Recovery Mechanism • Transmit sensitive data only over TLS (v1.2) • Error Messages
  • 26. C5. Strong cryptographic algorithms • PBKDF2 • scrypt • bcrypt Source: https://www.owasp.org/index.php/Password_Storage_Cheat_Sheet
  • 27. NIST: 2017 Digital Identity Guidelines • Allow all ASCII printable characters, including space • Minimum 8 characters length • Allow users to passwords lengthy as they want, within reason. • Offer guidance, such as a password-strength meter • Do not require password to be changed periodically • Permit to use “paste” functionality • Check against a list of bad password Source: https://pages.nist.gov/800-63-3/sp800-63b.html
  • 28. Hash Password with a modern Hash Problem: • Long passwords can cause DoS • bcrypt truncates passwords to 72 bytes Solution: • SHA-512 - converts long passwords to 512 bits
  • 29. C5. Secure Password Storage protect(sha512(password), [salt], [workFactor]) + 2nd Factor Authentication Don’t use SMS as multi-factor (use FIDO or dedicated app)
  • 30. C5. Password Storage – How Not To Do It! $password=bcrypt([salt] + [password], work_factor); $loginkey =md5(lc([username]).”::”.lc([password]))
  • 31. C5. Error Messages - How Not To Do It! Error message for not-registered userError message for valid user
  • 32. C5. Vulnerabilities Addressed A1 – Injection A2 – Broken Auth. and Session Management A3 – Cross-Site Scripting (XSS) A4 – Insecure Direct Object References A5 – Security Misconfiguration A6 – Sensitive Data Exposure A7 – Missing Function Level Access Control A8 – Cross-Site Request Forgery A9 – Using Comp. with Known Vulnerabilities A10 – Unvalidated Redirects and Forwards
  • 33. C6. Implement Appropriate Access Controls
  • 34. C6. Vulnerabilities Addressed A1 – Injection A2 – Broken Auth. and Session Management A3 – Cross-Site Scripting (XSS) A4 – Insecure Direct Object References A5 – Security Misconfiguration A6 – Sensitive Data Exposure A7 – Missing Function Level Access Control A8 – Cross-Site Request Forgery A9 – Using Comp. with Known Vulnerabilities A10 – Unvalidated Redirects and Forwards
  • 36. C7. Data in Transit Data in transit: HTTPS • Confidentiality: Spy cannot view your data • Integrity: Spy cannot change your data • Authenticity: Server you visit is the right one MITM Protection - HSTS • HTTPS + Strict Transport Security Header
  • 37. C7. Data at Rest 1. Strong algorithm – AES 2. Secure key management 3. Adequate access controls and auditing
  • 38. C7. Vulnerabilities Addressed A1 – Injection A2 – Broken Auth. and Session Management A3 – Cross-Site Scripting (XSS) A4 – Insecure Direct Object References A5 – Security Misconfiguration A6 – Sensitive Data Exposure A7 – Missing Function Level Access Control A8 – Cross-Site Request Forgery A9 – Using Comp. with Known Vulnerabilities A10 – Unvalidated Redirects and Forwards
  • 39. C8. Implement Logging and Intrusion Detection
  • 40. C8. Examples of Intrusion Detection Points • Application receives GET when expecting POST • Additional form or URL parameters submitted with request • Input validation failure server side when client side validation exists • Input validation failure server side on non-user editable parameters such as hidden fields, checkboxes, radio buttons or select lists • HTTP headers, Cookies received differ from the expected Source: https://www.owasp.org/index.php/OWASP_AppSensor_Project
  • 41. Logging Frameworks • Use logging framework • Encode untrusted data -> protection against Log injection attacks • Validate untrusted data-> protection against Log forging attacks
  • 42. C8. Vulnerabilities Addressed - All Top Ten! A1 – Injection A2 – Broken Auth. and Session Management A3 – Cross-Site Scripting (XSS) A4 – Insecure Direct Object References A5 – Security Misconfiguration A6 – Sensitive Data Exposure A7 – Missing Function Level Access Control A8 – Cross-Site Request Forgery A9 – Using Comp. with Known Vulnerabilities A10 - Unvalidated Redirects and Forwards
  • 43. C9. Leverage Security Frameworks and Libraries
  • 44. C9. Examples • Access Controls • CSRF protection • XSS protection • ORM - SQL injection prevention
  • 45. Current state of software Source: https://www.veracode.com/resources/state-of-software-security
  • 46. Cyber breaches Root cause of the top 50 breaches in 2016: #1 A9-Using Components with Known Vulnerabilities Source: snyk.io
  • 47. Unmanaged 3rd Party Components
  • 48. C9. API Integration Best Practices “When you wrap a third-party API, you minimize your dependencies upon it: You can choose to move to a different library in the future without much penalty. “ Robert C. Martin
  • 49. Wrapper Adapter C9. Design Patterns for Integration Façade
  • 50. C9. Automate OWASP Dependency Check - supported languages: • Java • .NET JavaScript • Retire.JS scanner PHP • PHP Security Checker
  • 51. C9. Best Practices • Use trusted sources • Encapsulate 3rd party libraries • Hide information • Reduce attack surface • Update regularly / replace
  • 52. C9. Vulnerabilities Addressed - All Top Ten! A1 – Injection A2 – Broken Auth. and Session Management A3 – Cross-Site Scripting (XSS) A4 – Insecure Direct Object References A5 – Security Misconfiguration A6 – Sensitive Data Exposure A7 – Missing Function Level Access Control A8 – Cross-Site Request Forgery A9 – Using Comp. with Known Vulnerabilities A10 - Unvalidated Redirects and Forwards
  • 53. C10. Error and Exception Handling
  • 54. C10: Best Practices • Centralised error handling • Verbose enough to explain the issue • Don’t leak critical information
  • 55. C10. Don’t leak information !
  • 56. A1 – Injection A2 – Broken Auth. and Session Management A3 – Cross-Site Scripting (XSS) A4 – Insecure Direct Object References A5 – Security Misconfiguration A6 – Sensitive Data Exposure A7 – Missing Function Level Access Control A8 – Cross-Site Request Forgery A9 – Using Comp. with Known Vulnerabilities A10 - Unvalidated Redirects and Forwards C10. Vulnerabilities Addressed - All Top Ten!
  • 57. Developer Controls C1 Build Security Early C4 Validate Input C6 Access Controls C5 Digital Identity C7 Protect Data C10 Error Handling C8 Logging C2 Secure Database Access C9 Leverage security C3 Encode Data
  • 58. Project Page Project page: https://www.owasp.org/index.php/OWASP_Proactive_Controls Twitter: @OWASPControls
  • 59. Join the conversation #DevSecCon Thank you Katy Anton Application Security Consultant Ca / Veracode

Editor's Notes

  • #55: Think for example of coordinates: latitude and longitude have no value by themselves, but put them together, and they can pin-point the exact location on earth! The same thing can happened with error messages when attackers will aggregate /^ them from different parts /^ of the application. One way to deal with this, is to present the end user an error code, and store the details of the error in the database. ——> American English uses the Z, and British uses the S.