Week 8 - Web Attacks Flashcards
What is a SQL injection attack?
When an attacker writes SQL code into a form that then gets executed by the server.
How do you prevent a SQL injection attack?
Sanitise user input
What is XSS?
Cross site scripting. When an attacker submits javascript code through a form which then leads to the server serving the malicious code to other users.
How do you prevent XSS?
Sanitise user input
What is path traversal?
When an attacker gains access to material they shouldn’t by typing in the path in the url.
How do you prevent path traversal attacks?
Make a user account for the web server and only give it access to public files.
What is CSRF?
Cross site request forgery. An innocent, trusted end user is tricked by the attacker into sending a request to a vulnerable web server.
How do you prevent CSRF?
Check the value of the referer header.
Every time a form is served, add an additional parameter with a token and check that it is valid upon submission.