Network-Based Authentication Flaws
CWE-291, CWE-293, CWE-300, CWE-350, CWE-940, CWE-941
Real-World Attack Scenarios
Scenario 1: IP-Based Authentication
def get_admin_panel():
client_ip = request.remote_addr
# VULNERABLE - Trusts IP!
if client_ip in ['192.168.1.100', '10.0.0.50']:
return render_template('admin.html')
return "Access Denied", 403# Method 1: IP Spoofing (network level)
# Attacker sends packets with source IP 192.168.1.100
# Method 2: Proxy through trusted IP
# Attacker finds proxy server at 192.168.1.100
# Routes traffic through proxy
# Server sees trusted IP
# Method 3: X-Forwarded-For Header (if vulnerable)
curl http://example.com/admin \
-H "X-Forwarded-For: 192.168.1.100"
# If server trusts header, access grantedScenario 2: Referer Header Authentication
Scenario 3: Reverse DNS Authentication
Scenario 4: Channel Accessible by Unintended Endpoint
Scenario 5: Header-Based Authentication Without Validation
Mitigation Strategies
Last updated