Secure Coding Flashcards
What are some countermeasures against code vulnerabilities? (7)
Input validation.
Don’t display irrelevant output to user.
Log errors.
Check code (catch exceptions, use parameters to avoid SQL injection, check for overflows).
Use a different testing team from development team.
Use manual and automatic review tools.
Follow a standard.
What is an SQL injection and how do you prevent it?
Executing SQL by appending it to an input.
Can view, add, manipulate or delete data.
To prevent:
Use parametrised queries.
What is Buffer Overflow and how do you solve it?
Execution of arbitrary code.
Happens when an input is longer than destination buffer.
To solve:
Validate the input
Check that the length of string is equal to or less than the number of characters in destination buffer.