π― 1. Investigating Blind Spots in Authenticated Areas
π© Source: Parameters in authenticated functionality
β οΈ Sink: Privileged operations
user_id = request.form['user_id'] # π© Source
db.execute(f"DELETE FROM users WHERE id = {user_id}") # β οΈ Sink
π Attack Flow:Source β Privilege bypass β Sink
π§Ό 2. Input Sanitization Analysis
π© Source: User input fields
β οΈ Sink: Rendering functions
const userComment = req.body.comment; // π© Source
const sanitized = userComment.replace('<script>', ''); // π Vulnerable
res.send(`<div>${sanized}</div>`); // β οΈ Sink
π Attack Vector:Source β Weak sanitization β Sink
πΎ 3. Dangerous Database Query Flows
π© Source: Search fields
β οΈ Sink: Query execution
String userInput = request.getParameter("search"); // π© Source
stmt.executeQuery("SELECT * FROM products WHERE name = '" + userInput + "'"); // β οΈ Sink
π Vulnerability Flow:Source β Concatenation β Sink
π 4. Account Management Attack Vectors
π© Source: Reset tokens
β οΈ Sink: Auth change functions
email = params[:email] # π© Source
reset_token = user.id.to_s + Time.now.strftime("%Y%m%d") // π² Predictable
user.update(password: new_password) # β οΈ Sink
π Attack Path:Source β Weak token β Sink
π» 5. OS Command Injection Chains
π© Source: Network parameters
β οΈ Sink: System calls
$user_ip = $_GET['ip']; // π© Source
system("traceroute " . $user_ip); // β οΈ Sink
π Dangerous Flow:Source β Unvalidated β Sink
βοΈ 6. Language-Specific Source-Sink Pairs
Node.js Prototype Pollution:
const userData = JSON.parse(req.body); // π© Source
Object.assign({}, userData); // π§© Vulnerable merge
if (user.isAdmin) { // β οΈ Sink
grantAdminAccess();
}
π Python Deserialization:
imported_data = request.GET.get('data') # π© Source
pickle.loads(base64.b64decode(imported_data)) # β οΈ Sink
πΊοΈ Source-Sink Mapping Table
| Vulnerability Type | π© Source | β οΈ Sink | π₯ Attack Example |
|---|---|---|---|
| XSS | Form inputs | innerHTML | <img src=x onerror=alert()> |
| SQL Injection | API parameters | execute() | ' OR 1=1-- |
| Command Injection | System params | system() | ; cat /etc/passwd |
| Path Traversal | Filename params | fs.readFile() | ../../etc/passwd |
| Prototype Pollution | JSON input | Privilege checks | {"__proto__":{...}} |
| Deserialization | Serialized data | pickle.loads() | Malicious payloads |
π Penetration Testing Strategy:
- Map all π© Sources
- Identify critical β οΈ Sinks
- Trace π data flows
- Verify π‘οΈ sanitization at each hop