{
"success": true,
"data": {
"id": "finding_xyz789",
"scan_id": "scan_abc123",
"title": "SQL Injection in User Search",
"severity": "critical",
"cvss_score": 9.8,
"cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"status": "open",
"category": "injection",
"subcategory": "sql_injection",
"cwe_id": "CWE-89",
"description": "A SQL injection vulnerability was discovered in the user search endpoint. An attacker can inject arbitrary SQL queries through the 'query' parameter, potentially accessing or modifying all data in the database.",
"impact": "An attacker could extract sensitive user data including credentials, modify or delete database records, or potentially gain shell access to the server.",
"endpoint": {
"method": "POST",
"path": "/api/users/search",
"parameter": "query",
"full_url": "https://app.example.com/api/users/search"
},
"proof_of_concept": {
"request": {
"method": "POST",
"url": "https://app.example.com/api/users/search",
"headers": {
"Content-Type": "application/json",
"Authorization": "Bearer [REDACTED]"
},
"body": "{\"query\": \"' UNION SELECT username, password FROM users--\"}"
},
"response": {
"status": 200,
"body": "[{\"username\": \"admin\", \"password\": \"$2b$10$...\"}, ...]",
"evidence": "Database credentials were returned in the response"
},
"curl_command": "curl -X POST 'https://app.example.com/api/users/search' -H 'Content-Type: application/json' -d '{\"query\": \"\\' UNION SELECT username, password FROM users--\"}'"
},
"remediation": {
"summary": "Use parameterized queries or prepared statements instead of string concatenation for SQL queries.",
"code_example": {
"language": "javascript",
"vulnerable": "const query = `SELECT * FROM users WHERE name LIKE '%${userInput}%'`;",
"secure": "const query = 'SELECT * FROM users WHERE name LIKE ?';\ndb.execute(query, [`%${userInput}%`]);"
},
"references": [
"https://owasp.org/www-community/attacks/SQL_Injection",
"https://cheatsheetseries.owasp.org/cheatsheets/SQL_Injection_Prevention_Cheat_Sheet.html"
]
},
"compliance": {
"pci_dss": ["6.5.1"],
"owasp_top_10": ["A03:2021"],
"cis": ["18.9"]
},
"first_seen": "2024-01-15T12:30:00Z",
"created_at": "2024-01-15T12:30:00Z",
"updated_at": "2024-01-15T12:30:00Z"
}
}