• No results found

Web Application Security

N/A
N/A
Protected

Academic year: 2021

Share "Web Application Security"

Copied!
15
0
0

Loading.... (view fulltext now)

Full text

(1)

Web Application Security

John Zaharopoulos

ITS - Security

(2)

• Web 2.0

– Dynamic Webpages

– Growth of Ajax / Client side Javascript

• Hardening of OSes

– Secure by default

– Auto-patching and Auto-updating

(3)

• Sony Pictures

– Stolen admin details and passwords

– 75,000 music codes

• LinkedIn

– 6 million password hashes

• eHarmony

– 1.5 million password hashes

• Yahoo

– 450K passwords

(4)

OWASP

Top 10

Threats

(5)

A SQL injection attack consists of insertion or

"injection" of a SQL query via the input data

from the client to the application.

(6)

SQL Injection Example 1

• Code: $password =

mysql_query

("SELECT password

FROM users WHERE password = '". $pass . "';");

• Attacker sends: ' OR 1 = 1 /*

• Result: SELECT password FROM users WHERE

password = '' OR 1 = 1 /*

(7)

• Code: statement := "SELECT * FROM userinfo WHERE

id = " + a_variable + ";“

• Attacker sends: 1;DROP TABLE users

• Result: SELECT * FROM userinfo WHERE id=1;DROP

TABLE users;

(8)

• Prepared Statements (Parameterized Queries) - Parameterized queries force developers to define all the SQL code, then pass in each parameter to the query, which allows the database to distinguish between code and data, regardless of what input is supplied.

• Stored Procedures - a stored procedure is defined and stored in the database itself, and then called from the application rather than something that a user is

allowed to enter.

• Escaping all User Supplied Input - Each DBMS supports one or more

character escaping schemes specific to certain kinds of queries. If you then escape all user supplied input using the proper escaping scheme for the database you are using, the DBMS will not confuse that input with SQL code written by the developer, thus avoiding any possible SQL injection vulnerabilities.

• Least Privilege – or minimizing the privileges assigned to every database account, so that users have enough permission to do their job, but no more.

• White List Input Validation - Input validation is used to detect unauthorized input before it is processed by the application, thereby preventing the attack

(9)

Cross-Site Scripting attacks are a type of injection

problem, in which malicious scripts are injected into the

otherwise benign and trusted web site. Cross-site

scripting (XSS) attacks occur when an attacker uses a

web application to send malicious code, generally in the

form of a browser side script, to a different end user.

(10)

Non-persistent / Reflected:

• Alice often visits a particular website, which is hosted by Bob. Bob's website allows

Alice to log in with a username/password pair and stores sensitive data, such as billing information.

• Mallory observes that Bob's website contains a reflected XSS vulnerability.

• Mallory crafts a URL to exploit the vulnerability, and sends Alice an email, enticing

her to click on a link for the URL under false pretenses. This URL will point to Bob's

website (either directly or through an iframe or ajax), but will contain Mallory's

malicious code, which the website will reflect.

• Alice visits the URL provided by Mallory while logged into Bob's website.

• The malicious script embedded in the URL executes in Alice's browser, as if it came

directly from Bob's server (this is the actual XSS vulnerability). The script can be used to send Alice's session cookie to Mallory. Mallory can then use the session cookie to

(11)
(12)

Persistent attack:

• Mallory posts a message with malicious

payload to a social network.

• When Bob reads the message, Mallory's XSS

steals Bob's cookie.

• Mallory can now hijack Bob's session and

impersonate Bob.

(13)

• Escaping

– transforming the data in such a way that the

browser will not interpret it as code

• characters like "<" and "&" should be rewritten

as HTML entities -- "&lt;" and "&amp;

• Validation and filtering

– disallow users from entering special characters

like <, or filter out those characters.

(14)

• OWASP

http://www.owasp.org/

• SANS Institute

http://www.sans.org/

(15)

References

Related documents

Section 2 presents an emerging framework for food security classification and response, based on the joint efforts of a number of UN and international agencies, including the Food

Entrance criteria for the Desert Willow program included women who were 18 years of age or older, had used alcohol or drugs for at least one year, were either pregnant or had

sultant very high MIR–X-ray ratio of IRAS 00188-0856 suggests that this source is either completely star formation dominated or contains a Compton-thick AGN with an intrinsic

Win-Situ Baro Merge™ software automatically subtracts BaroTROLL readings from data collected by an absolute Level TROLL instrument. Titanium

Rabin understood that Israel would need to live by the sword for many more years, and often stressed that despite the peace agreements with its neighbors, Israel would

cited here were openly Liberal in politics, they display this liberal consumerism both by promoting poems in praise of consumer goods, written in many instances by the same

Guideline 6: Develop a target organizational model using traditional conceptual modeling methods and the input elicited from data consumers to capture organizational

In summary, in the area of financing for innovation public policy has been aimed at providing greater support and has focused on solutions that are more easily implemented –