SlideShare a Scribd company logo
1 of 66
Download to read offline
Tobias Zander | @airbone42
OWASP Top 10
Current state of security
Open Web Application
Security Project
The Top 10 Most
Critical Web
Application Security
Risks
Not just Vulnerabilities
http://xkcd.com/327/
Don‘t try this at home!
http://funfive.net/drop-database-license-plate/2670.html
Prepared Statements
$stmt = $mysqli->prepare(
'UPDATE users
SET email = ?
WHERE id = 123'‚
);
$stmt->bind_param(
's',
$email
);
DBA
$q = Doctrine_Query::create()
->update('Account')
->set('email', 'foo@bar.de')
->where(
'username LIKE ?',
$username
);
$username = 'A%';
Time-based
SELECT IF(
SUBSTRING(
user_password, 1, 1
) = CHAR(65),
BENCHMARK(
5000000,
ENCODE(‘foo', ‘bar')
),
null
)
FROM users
WHERE user_id = 1;
Injection
• Use prepared statements
• Or stored procedures
• Check for wildcards
www.owasp.org/index.php/SQL_Injection_Prevention_Cheat_Sheet
eBay
https://twitter.com/kennwhite/status/470545973547397120/photo/1/large
Online-Banking Newsletter
Sollte Ihr Kennwort Sonderzeichen
enthalten, bitten wir Sie, Ihr Kennwort zu
ändern. Durch die technische Umstellung
auf das neue Online-Banking werden nur
noch Kennwörter zugelassen, die
bestimmte Sonderzeichen erlauben. Die
zugelassenen Sonderzeichen im
Kennwort lauten: # ? * + - .
Broken Authentication
• Don‘t limit password strength
• Force long and complex passwords
• Check error messages
• Prevent brute-force-attacks
www.owasp.org/index.php/Authentication_Cheat_Sheet
Session Hijacking
Session ID: abcde
Mr. Evil
Session Fixation
Mr. Evil
Link
Predefined Session ID
Broken Session Management
session.use_trand_sid = Off
session.use_only_cookies = On
session.cookie_secure = On
session.cookie_httponly = On
session.hash_function = sha512
Broken Session Management
• Don‘t expose session ids
• Probably bind sessions to IP
• Reduce Session-Lifetime
• Regenerate Session-Ids
www.owasp.org/index.php/Session_Management_Cheat_Sheet
XSS
echo '<input
type="text"
name="foo"
value="' .
htmlspecialchars(
$string
ENT_QUOTES|
ENT_SUBSTITUTE|
ENT_DISALLOWED,
'UTF-8'
) .
'">';
XSS
$value = '</script>';
echo json_encode(
$value
);
XSS
• Escape output by context
– htmlspecialchars
– json_encode
– …
• Content-Security-Policy
• X-XSS-Protection
• Template engine
Insecure Object Reference
<select>
<option value="2">
moderator
</option>
<option value="3">
editor
</option>
</select>
Insecure Object Reference
<select>
<option value="random-ref-x">
moderator
</option>
<option value="random-ref-y">
editor
</option>
</select>
Insecure Object Reference
• Validate user input
• Use indirect object references
• Check access permissions
Security Misconfiguration
<Directory "/var/www">
AllowOverride All
</Directory>
memory_limit = 1024M
allow_url_fopen = On
allow_url_include = On
;open_basedir =
Security Misconfiguration
<Directory "/var/www">
AllowOverride None
Options -Indexes
</Directory>
memory_limit = 128M
log_errors = On
allow_url_fopen = Off
allow_url_include = Off
open_basedir = /var/www/app
Security Misconfiguration
• Keep your system up-to-date
• Remove setup/deployment routines
• Disable exposure of sensitive data
• Review server settings
• github.com/ioerror/duraconf
Fucking rainbow tables
http://edwardhotspur.wordpress.com/tag/devil-bunny/
PHP 5.5
password_hash($password);
if (password_verify($password, $hash)) {
// Success!
} else {
// Failed :(
}
SSDE - Password encryption
• Add a salt
• Use different salts
• Use a strong algorithm (NOT md5)
• Use password_hash in PHP 5.5
• github.com/ircmaxell/password_compat
SSDE - PHP Exposure
expose_php Off
Remove
phpinfo();
SSDE - Secure URLs
• Use TLS for all pages
• Use Secure Cookie Flag
• Keep sensitive data out of the URL
class AdminController {
public function editAction() {
$this->model
->save($this->formData);
}
}
Missing Function Level AC
class AdminController {
public function editAction() {
if (!$this->_isAllowed()) {
throw new Exception(
'insufficient privileges'
);
}
…
Missing Function Level AC
• Standard should disallow all access
• Use roles to keep ACL simple
• ACL model should be very flexible
• Check privileges on each step
class BankaccountController {
public function transferAction() {
if ($this->_isAllowed()) {
$this->transfer(
$amount,
$account
);
}
}
}
Cross Site Request Forgery
Login / create session
Visitwebsite
Requestapp…
… through victim‘s browser
evil.com
sensitive.com
CSRF
class BankaccountController {
public function transferAction() {
$this->validateToken();
if ($this->_isAllowed()) {
$this->transfer(
$amount,
$account
);
}
}
Infected
profile
TOKEN
My profile
Authenticate user
CSRF
• Use One-Time-Token and secure it
• Authenticate user
–Credentials
–Captcha
www.owasp.org/index.php/CSRF_Prevention_Cheat_Sheet
Known Vulnerabilities
• Review third party libraries
• Keep libraries up-to-date -
http://www.versioneye.com/
• Check:
– mailing lists
– boards
– news- and vendor-sites
Redirects and Forwards
Redirects and Forwards
$allowedDomains = array('good.com',
'better.com');
if (!in_array(
$url,
$allowedDomains
)) {
throw new Exception('invalid redirect');
}
$this->_redirectUrl($url);
http://www.lolhome.com/funny-picture-620770644.html
Improper Error Handling
DoS
Security by Obscurity
Insecure File Uploads
Malicious File
Execution
Mail Header Injection
Source Code
Revelation
Hardcoded
Credentials
Clickjacking
Buffer Overflows
XML External Entity
Perfect Pixel Timing
• OWASP Top 10
• CWE/SANS Top 25
• PCI DSS
• Zed Attack Proxy
• Metasploit
• WireShark
• BeEF
http://amzn.to/1vKNLqM
Trust noone!
www.owasp.org security.stackexchange.com
http://www.glittercats.com/image/30189/cute-cats-wallpapers-colorful-wallpaper
Tobias Zander | @airbone42
Questions?
Tobias Zander | @airbone42
Thanks!

More Related Content

What's hot

What's hot (20)

Intro to SQL Injection
Intro to SQL InjectionIntro to SQL Injection
Intro to SQL Injection
 
Ben Bridts - $ aws help
Ben Bridts -  $ aws helpBen Bridts -  $ aws help
Ben Bridts - $ aws help
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC
 
Check username availability with vue.js and PHP
Check username availability with vue.js and PHPCheck username availability with vue.js and PHP
Check username availability with vue.js and PHP
 
PHP Secure Programming
PHP Secure ProgrammingPHP Secure Programming
PHP Secure Programming
 
General Principles of Web Security
General Principles of Web SecurityGeneral Principles of Web Security
General Principles of Web Security
 
Add loop shortcode
Add loop shortcodeAdd loop shortcode
Add loop shortcode
 
My app is secure... I think
My app is secure... I thinkMy app is secure... I think
My app is secure... I think
 
Hidden in plain site – joomla! hidden secrets for code monkeys
Hidden in plain site – joomla! hidden secrets for code monkeysHidden in plain site – joomla! hidden secrets for code monkeys
Hidden in plain site – joomla! hidden secrets for code monkeys
 
Eric Redmond – Distributed Search on Riak 2.0 - NoSQL matters Barcelona 2014
Eric Redmond – Distributed Search on Riak 2.0 - NoSQL matters Barcelona 2014Eric Redmond – Distributed Search on Riak 2.0 - NoSQL matters Barcelona 2014
Eric Redmond – Distributed Search on Riak 2.0 - NoSQL matters Barcelona 2014
 
Debugging: Rules And Tools - PHPTek 11 Version
Debugging: Rules And Tools - PHPTek 11 VersionDebugging: Rules And Tools - PHPTek 11 Version
Debugging: Rules And Tools - PHPTek 11 Version
 
Agile database access with CakePHP 3
Agile database access with CakePHP 3Agile database access with CakePHP 3
Agile database access with CakePHP 3
 
Quebec pdo
Quebec pdoQuebec pdo
Quebec pdo
 
Security Meetup 22 октября. «Реверс-инжиниринг в Enterprise». Алексей Секрето...
Security Meetup 22 октября. «Реверс-инжиниринг в Enterprise». Алексей Секрето...Security Meetup 22 октября. «Реверс-инжиниринг в Enterprise». Алексей Секрето...
Security Meetup 22 октября. «Реверс-инжиниринг в Enterprise». Алексей Секрето...
 
Teaching Your Machine To Find Fraudsters
Teaching Your Machine To Find FraudstersTeaching Your Machine To Find Fraudsters
Teaching Your Machine To Find Fraudsters
 
User registration and login using stored procedure in php
User registration and login using stored procedure in phpUser registration and login using stored procedure in php
User registration and login using stored procedure in php
 
Future of HTTP in CakePHP
Future of HTTP in CakePHPFuture of HTTP in CakePHP
Future of HTTP in CakePHP
 
2011/1/27 Amazon Route53 使ってみた@第1回クラウド女子会
2011/1/27 Amazon Route53 使ってみた@第1回クラウド女子会2011/1/27 Amazon Route53 使ってみた@第1回クラウド女子会
2011/1/27 Amazon Route53 使ってみた@第1回クラウド女子会
 
Security: Odoo Code Hardening
Security: Odoo Code HardeningSecurity: Odoo Code Hardening
Security: Odoo Code Hardening
 
DevOps Fest 2019. Сергей Марченко. Terraform: a novel about modules, provider...
DevOps Fest 2019. Сергей Марченко. Terraform: a novel about modules, provider...DevOps Fest 2019. Сергей Марченко. Terraform: a novel about modules, provider...
DevOps Fest 2019. Сергей Марченко. Terraform: a novel about modules, provider...
 

Viewers also liked

Nursing Assessment
Nursing AssessmentNursing Assessment
Nursing Assessment
preet kaur
 

Viewers also liked (6)

Teamlead
TeamleadTeamlead
Teamlead
 
Magento 2 - Meet Magento 2014 DE
Magento 2 - Meet Magento 2014 DEMagento 2 - Meet Magento 2014 DE
Magento 2 - Meet Magento 2014 DE
 
Software quality in e-commerce projects at Magento Live DE 2014
Software quality in e-commerce projects at Magento Live DE 2014Software quality in e-commerce projects at Magento Live DE 2014
Software quality in e-commerce projects at Magento Live DE 2014
 
"Turbo boost your website" aka BigPipe at Webinale 2014 in Berlin
"Turbo boost your website" aka BigPipe at Webinale 2014 in Berlin"Turbo boost your website" aka BigPipe at Webinale 2014 in Berlin
"Turbo boost your website" aka BigPipe at Webinale 2014 in Berlin
 
Collaboration between project management and developers
Collaboration between project management and developersCollaboration between project management and developers
Collaboration between project management and developers
 
Nursing Assessment
Nursing AssessmentNursing Assessment
Nursing Assessment
 

Similar to OWASP Top 10 at International PHP Conference 2014 in Berlin

Quality Assurance for PHP projects - ZendCon 2012
Quality Assurance for PHP projects - ZendCon 2012Quality Assurance for PHP projects - ZendCon 2012
Quality Assurance for PHP projects - ZendCon 2012
Michelangelo van Dam
 
Security 202 - Are you sure your site is secure?
Security 202 - Are you sure your site is secure?Security 202 - Are you sure your site is secure?
Security 202 - Are you sure your site is secure?
ConFoo
 

Similar to OWASP Top 10 at International PHP Conference 2014 in Berlin (20)

Rails Security
Rails SecurityRails Security
Rails Security
 
PHP SA 2014 - Releasing Your Open Source Project
PHP SA 2014 - Releasing Your Open Source ProjectPHP SA 2014 - Releasing Your Open Source Project
PHP SA 2014 - Releasing Your Open Source Project
 
Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12
 
Quality Assurance for PHP projects - ZendCon 2012
Quality Assurance for PHP projects - ZendCon 2012Quality Assurance for PHP projects - ZendCon 2012
Quality Assurance for PHP projects - ZendCon 2012
 
Charla EHU Noviembre 2014 - Desarrollo Web
Charla EHU Noviembre 2014 - Desarrollo WebCharla EHU Noviembre 2014 - Desarrollo Web
Charla EHU Noviembre 2014 - Desarrollo Web
 
QA for PHP projects
QA for PHP projectsQA for PHP projects
QA for PHP projects
 
Unit testing zend framework apps
Unit testing zend framework appsUnit testing zend framework apps
Unit testing zend framework apps
 
PHP on Windows Azure
PHP on Windows Azure PHP on Windows Azure
PHP on Windows Azure
 
A 2-2 php on windows azure
A 2-2 php on windows azureA 2-2 php on windows azure
A 2-2 php on windows azure
 
Whatever it takes - Fixing SQLIA and XSS in the process
Whatever it takes - Fixing SQLIA and XSS in the processWhatever it takes - Fixing SQLIA and XSS in the process
Whatever it takes - Fixing SQLIA and XSS in the process
 
Php Security By Mugdha And Anish
Php Security By Mugdha And AnishPhp Security By Mugdha And Anish
Php Security By Mugdha And Anish
 
Unit testing with zend framework tek11
Unit testing with zend framework tek11Unit testing with zend framework tek11
Unit testing with zend framework tek11
 
Unit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBeneluxUnit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBenelux
 
Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8
 
What's new with PHP7
What's new with PHP7What's new with PHP7
What's new with PHP7
 
Fatc
FatcFatc
Fatc
 
Debugging: Rules & Tools
Debugging: Rules & ToolsDebugging: Rules & Tools
Debugging: Rules & Tools
 
Security 202 - Are you sure your site is secure?
Security 202 - Are you sure your site is secure?Security 202 - Are you sure your site is secure?
Security 202 - Are you sure your site is secure?
 
UA testing with Selenium and PHPUnit - TrueNorthPHP 2013
UA testing with Selenium and PHPUnit - TrueNorthPHP 2013UA testing with Selenium and PHPUnit - TrueNorthPHP 2013
UA testing with Selenium and PHPUnit - TrueNorthPHP 2013
 
Drupal campleuven: Secure Drupal Development
Drupal campleuven: Secure Drupal DevelopmentDrupal campleuven: Secure Drupal Development
Drupal campleuven: Secure Drupal Development
 

Recently uploaded

AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 

Recently uploaded (20)

%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions Presentation
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
 

OWASP Top 10 at International PHP Conference 2014 in Berlin