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

Please wait while the activity loads.
If this activity does not load, try refreshing your browser. Also, this page requires javascript. Please visit using a browser with javascript enabled.
If loading fails, click here to try again

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