Web Application Security

Get Started. It's Free
or sign up with your email address
Web Application Security by Mind Map: Web Application Security

1. Client Side

1.1. XSS

1.1.1. 3 types reflected XSS problem DOM based XSS unique form of XSS similar to reflected XSS DOM (Document Object Model) input validation vulnerability on the client side JS stored XSS

1.1.2. resulting from missing/bad input/input handling user is able to define content which gets evaluated as javascript or create own javascript blocks developer doesn't apply needed sanitzation for given context of user supplied input

1.1.3. technique to force web sites to display malicious code which gets executed in users web browser browser doesn't have to be susceptible to any vulnerability

1.1.4. user supplied data doesn't only reach the server via GET and POST all headers may be spoofed by user including cookie, referer and host logging infrastructure must implement proper escaping for everything logged

1.1.5. encoding can pose a problem variable width encoding can make escaping invalid server can't correctly check and filter the encoding the browser uses to interpret the page is a different

1.1.6. possible attack methods history stealing getComputedStyle API intranet hacking defacement JS can completely alter look of web site can be leveraged for phishers to occur on the real website abuse users browser to run applications without user approval as filesharing node as part of anonymity network

1.2. Flash Security

1.2.1. compiled bytecode unaware developer might include secrets into code those can be revealed by decompilers and reversing

1.2.2. cross domain requests each exact domain gets an own sandbox crossdomain.xml for cross sandbox communication

1.2.3. sandboxing

1.3. Java Security

1.4. DNS Pinning Vulnerabilites

1.4.1. attack without dns pinning browser connects to malicious server with dns timeout of 1 second JS tells browser to connect back in 2 seconds browser resolves name again since no longer valid dns server replies with arbitrary ip address it wants to get the contents from this ip may be in the intranet providing attacker access to the inner network

1.4.2. the browser pins once received IPs to domains to prevent the attack above browser protection to prevent attackers from breaking the same-origin policy through DNS tricks

1.4.3. anti-dns pinning the browser is re-requesting dns if the web server isn't reachable anymore attack same as above, but this time the base attacker system firewalls itself to be unreachable for the browser in the second request anti-anti-dns pinning checking the host header if the targeted system by the browser is really ours anti-anti-anti-dns pinning

1.4.4. it is not possible to hijack session via automated sending of cookies with this, because cookie sending is determined by domain not IP

1.4.5. intranet scanning can be combined with an automated search for vulnerabilities in the intranet possibility to take over systems in the intranet use XSS or CSRF exploit to attack users browser to steal information or authentication tokens

1.5. JavaScript Hijacking

1.5.1. request json from other side via <script> include redefine Array object to have the results accessible XMLHttpRequest wouldn't work because of same origin policy

1.5.2. user is authenticated on other web service via cookie

1.5.3. if web service discloses privacy relevant information over json

2. Logical Flaws

2.1. Password Change/Forgotten Functions

2.2. Brute Forcible Login

2.3. Verbose Failure Messages

2.4. Insecure Credential Distribution

2.5. Predictable Usernames/Initial Passwords

2.6. Predictable Account Activation Link/ID

2.7. Bad Passwords

2.8. Fail-Open Login

2.9. defective multi-stage login

3. Server Side

3.1. Attacks

3.1.1. SQL Injection SQL databases are usually called indirected by a web application, which passes a complete query containing parts of user supplied content to the database subsystem attacks SELECT INSERT UPDATE DELETE UNION operator Blind SQL injection timing attacks Second Order SQL Injection

3.1.2. Remote File Inclusion

3.1.3. Remote Code Execution usually interpreted languages executed code is built at runtime containing user supplied content utilizing special characters to break out of data context therefore being able to execute arbitrary commands in compiled languages attack not leverages syntactic features of programming language payload contains machine code

3.1.4. Path Traversal

3.2. Web Application Firewall

3.2.1. ModSecurity (Apache)

4. Sessions

4.1. session management needed to identify different users across requests

4.1.1. session management closely related to authentication mechanism

4.1.2. http is stateless webapplications becoming like desktop applications -> need state

4.2. technologies

4.2.1. main technology Cookies

4.2.2. http authentication basic digest NTLM (Kerberos) client certificates

4.2.3. encoded session state being pushed to client in cookie in hidden form fields

4.3. attacks

4.3.1. Session Hijacking CSRF simple attack huge impact on web app security perform actions in users behalf via users browser doesn't obey to same-origin policy XSS and CSRF can let unsuspecting user attack a webserver on attackers behalf counter measures Session Fixation webapp accepts provided tokens as new sessions webapp doesn't create new token on login attacker can smuggle new session token into users browser and continue his session after login weak Session IDs guessable meaningful tokens predictable tokens static tokens

4.3.2. disclosure of tokens on network fallback to http after login http for all static content usage of https only cookies tricked by attacker to make http request to server, not matter if successful, token will be disclosed

4.3.3. vulnerable session termination logout doesn't invalidate session no session expiration user didn't log out possibly user got force quit

4.3.4. liberal cookie scope domain cookies are default sent in every request web-servers sharing the same right-hand-side of the domain domain value can be changed upto one below the tld path similar to domain path defines to which subdirectories on the server cookies will be passed

4.4. counter measures

4.4.1. creating additional page tokens pro if an attacker uses the session of a user it will be detected because the page token replied will not be the last provided, because there are two open instances can be leveraged to track user movement on page con opening several tabs at the same time will be interpreted as an attack

4.4.2. reactive session termination deauthenticating user when suspicious activity is noticed like modified hidden form fields or strings associated with SQLi or XSS

5. Same Origin Policy

5.1. only allow to read data originating from the same source

5.1.1. enforced by utilizing domain names only the exact same domain can be accessed explicit exceptions can be made

5.1.2. sources are the same if the following matches protocol hostname port (not for IE?)