Secure Coding Flashcards

1
Q

What are some countermeasures against code vulnerabilities? (7)

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is an SQL injection and how do you prevent it?

A

Executing SQL by appending it to an input.

Can view, add, manipulate or delete data.

To prevent:
Use parametrised queries.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is Buffer Overflow and how do you solve it?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly