Web Security Flashcards
Security by Obscurity
DUMB AF
“Nobody knows the URLs of our API, so it’s safe”- some dumbass
What to use instead of HTTP
HTTPS! uses secure TLS connection (encrypted)
Harder to access the requests/responses
Not impossible though
Authentication vs Authorisation
Authentication: Confirming the identity of someone
Authorisation: Verifying that you are permitted to do what you want to do
How ot Authenticate/Authorize
HTTP Basic Authentication Session IDs Tokens OAuth (2.0) Authorisation Signed Requests
HTTP Basic Authentication
User and password authentication sent via HTTP headers… clear text.
User and password sent in each request
-Possible to steal
After first login use session IDs or tokens
Session IDs
After user is authenticated. set a cookie to provide the server with information about the client, server remembers rights, data, transactions etc)
Stateful (conflicts with REST)
Can be guessed/stolen
Tokens
Data that is used instead of credentials (user/pw)
-credentials not sent back and forth all the time
Bearer token: anyone who “bears” it has access
OAuth 2.0
Login with some other account… google or fb
Request Signing
Create secure hash of the entire request
send request and hash to the server
server creates hash using your secret(only you and the server know it) and compares to your hash
vulnerable to Replay attack
-fix with including date in the request
Secret is often sent with other mediums…email sms etc.
Vulnerability
weakness of an asset or group of assets which can be exploited by a threat
Threat
capabilities, intentions and attack methods of adversaries or any circumstance or event that has the potential to cause harm to info or system… or cause these to harm others
Exploit
defined way to breach the security of an information system through vulnerability
OWASP top 10
- Injection
- Broken Authentication
- Sensitive Data Exposure
- XML External Entities
- Broken Access Control
- Security Misconfiguration
- Cross-Site Scripting
- Insecure Deserialisation
- Using Components with known vulnerabilities
- Insufficient logging and monitoring
Injection
When untrusted data is sent to an interpreter as part of a command or query. Tricking the interpreter to execute unintended commands or accessing data without proper authorization
Broken Authentication
Username/pw re-use
Weak passwords
Re-use of session IDs no proper invalidation of session IDs