20 Jun 2012

Secure Coding Quiz

Thank you for taking the Secure Coding Quiz. For a better idea of application security, please download our free product ThreatModeler to learn more about threat modeling and building secure applications.

 



Secure Coding Quiz

Congratulations – you have completed Secure Coding Quiz.

You scored %%SCORE%% out of %%TOTAL%%.

Your performance has been rated as %%RATING%%

Your answers are highlighted below.

Question 1
The best way to implement input validation is by:
A
Server Side Whitelisting
B
Encrypted communications
C
Client Side Input Validation
D
Server Side Blacklisting
Question 2
For a centralized input validation component, what is the area at which you redirect input data for validation?
A
At the database
B
Trust Boundary
C
At the communication medium
D
Client Side Form
Question 3
Failure of handling of concurrent requests by a process dependent on a sequence or timing of events leads to:
A
SQL Injection
B
Brute Force Attack
C
Race Condition
D
Session Fixation
Question 4
What is the practice of encoding data to a common character set before validation formally known as?
A
Sanitization
B
Canonicalization
C
Encryption
D
Input Validation
Question 5
How do you implement efficient error handling?
A
Redirect user to homepage
B
Give verbose error messages to help obtain necessary technical feedback.
C
Generic error messages without any information on the type of error or stack traces
Question 6
Which of the following should be avoided as a security measure?
A
Blacklisting
B
Parameterized Queries
C
Whitelisting
D
Encryption
Question 7
For output data as input to another module of the application or to the underlying OS, what would be appropriate?
A
Validate all Input
B
Transfer data using HTTP POST method
C
Implement application at least privilege
D
Per-request session token
Question 8
Before embedding data into an HTTP response header, validating input for CR/LFs would help mitigate against:
A
Remote File Inclusion
B
Cross Site Request Forgery
C
HTTP Response Splitting
D
Brute Force Attack
Question 9
For limited input type, what security measure is most viable as input validation?
A
Blacklist: Create a list of known bad values
B
Prepared Statements
C
Output Encoding
D
Create a list of legitimate values that a user is allowed to specify
Question 10
Best practice for secure coding against SQL Injection attacks?
A
Database hardening
B
Use of Parameterized Queries.
C
Use of Stored Procedures
D
Lowering application privileges
Question 11
To harden your system against a Path Traversal attack, the following is considered a good practice
A
Use a chrooted environment on the directory containing your application files
B
Transfer data in a POST request
C
Using Parameterized Queries
D
Generate a new session identifier to force change from HTTP to HTTPS and deactivate the old one.
Question 12
Consider the scenario where a developer uses a cookie to count failed login attempts to implement account lockout against a brute force attack. How can this measure be bypassed?
A
User can manipulate the cookie
B
Attacker will attempt a session fixation attack
C
Account Lockout will cause a denial of service thus helping the attacker
Question 13
The use of a Canary value is a safeguard against what type of attack?
A
Heap Overflow
B
Brute Force
C
Buffer Overflow by stack smashing
D
Denial of Service
Question 14
Why do you require to change the Session ID after Login?
A
To prevent XSS
B
To Prevent Cross Site Request Forgery
C
To Prevent SQL Injection
D
To prevent Session Fixation
Question 15
For a web mail application that handles form input and displays them in the browser, what threat are you at risk of?
A
SQL Injection
B
Remote File Inclusion
C
CSRF
D
XSS
Once you are finished, click the button below. Any items you have not completed will be marked incorrect.
Get Results


There are 15 questions to complete.
List

Return

Shaded items are complete.
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
End
Return


Leave a Reply