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