OWASP Risk Rating Methodology Equation
Risk = Likelihood * Impact
Steps in OWASP Risk Rating Methodology
Step 1: Identifying a Risk
Step 2: Factors for Estimating Likelihood
Step 3: Factors for Estimating Impact
Step 4: Determining Severity of the Risk
Step 5: Deciding what to Fix
Step 6: Customizing Your Risk Rating Model
Step 1: Identifying a Risk
Identifying a security Risk
– List from OWASP, SANS top 25 e.g
Step 2: Factors for Estimating Likelihood
Step 3: Factors for Estimating Impact
Step 4: Determining the Severity of the Risk
0 to <3 : low
3 to <6: medium
6 to 9: high
Step 5 : Deciding what to Fix
Step 6: Customzing Your Risk Rating Model
o Adding factors
o Customizing options
Cross-Site Scripting (XSS)
A client-side code injection attack allowing the injection of malicious code into a website
When do XSS happen?
XSS flaws occur when an application includes untrusted data in a web page without proper validation or escaping, or updates an existing web page with user-supplied data using a browser API that can create HTML or JavaScript
Impact of XSS
It allows attackers to execute scripts in the victim’s browser.
- He can steal the user’s cookies, allowing for someone to use the website pretending to be that user.
- He can steal the user’s session, steal sensitive data, rewrite webpage, redirect user to phishing or malware sit
Types of XSS attacks
Reflected XSS Attack
Persistent XSS Attack
Source
A source is a Javascript property that contains data that an attacker could potentially control.
Sink
A sink is a function or DOM object that allows Javascript code execution or rendering of HTML.
DOM Based XSS
XSS Prevention
Encoding - which escapes the user input so that
the browser interprets it only as data, not as
code.
Validation - which filters the user input so that the
browser interprets it as code without malicious
commands.
Cross-Site Request Foregery (CSRF)
A client-side attack that forces an end user to execute unwanted actions on a web application in which they’re currently authenticated.
Differences between CSRF and XSS
CSRF is restricted to the actions victims can perform. XSS, on the other hand, works on the execution of malicious scripts enlarging the scope of actions the attacker can perform
* XSS requires only a vulnerability, while CSRF requires a user to access the malicious page or click a link.
* CSRF works only one way – it can only send HTTP requests, but cannot view the response. XSS can send and receive HTTP requests and responses in order to extract the required data.
CSRF Prevention