wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Securing Source Code

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What is input validation and why is it important?

a)

Input validation ensures that all user input is automatically accepted.

b)

Input validation is the process of collecting user data without checks.

c)

Input validation is only necessary for web applications.

d)

Input validation is the process of verifying user input to ensure it meets required criteria, crucial for preventing errors and security vulnerabilities.

2.

Which of the following is a common method for input validation?

a)

Regular expressions

b)

User authentication

c)

Data encryption

d)

Input sanitization

3.

What is the purpose of authentication mechanisms in software security?

a)

To verify the identity of users or systems and ensure authorized access to resources.

b)

To monitor user activity for compliance purposes.

c)

To encrypt sensitive data during transmission.

d)

To manage software updates and patches.

4.

Name one widely used authentication method.

a)

Biometric authentication

b)

Password-based authentication

c)

Single sign-on authentication

d)

Two-factor authentication

5.

What is the principle of least privilege in access control?

a)

Allowing users to modify their own permissions freely.

b)

Restricting access based on user age rather than job function.

c)

The principle of least privilege in access control is the practice of granting users only the permissions they need to perform their job functions.

d)

Granting all users full access to the system.

6.

How can role-based access control enhance security?

a)

RBAC enhances security by increasing user privileges.

b)

RBAC is only useful for managing passwords.

c)

RBAC allows unrestricted access to all resources.

d)

RBAC limits access to resources based on user roles, enhancing security by preventing unauthorized access.

7.

What are secure coding practices and why are they necessary?

a)

Secure coding practices are techniques to enhance user interface design.

b)

Secure coding practices are techniques to write code that prevents security vulnerabilities, essential for protecting applications from attacks.

c)

Secure coding practices are only necessary for large companies.

d)

Secure coding practices focus solely on improving code readability.

8.

Give an example of a secure coding practice.

a)

Use hard-coded passwords in the code.

b)

Validate user input to prevent injection attacks.

c)

Ignore error messages during development.

d)

Disable all security features for better performance.

9.

Why is error handling important in secure coding?

a)

Error handling is irrelevant in secure coding practices.

b)

Error handling is important in secure coding to prevent information leakage, ensure predictable application behavior, and mitigate security vulnerabilities.

c)

Error handling can slow down application performance.

d)

Error handling is only necessary for debugging purposes.

10.

What is NOT a vulnerability found in the code?

a)

SQL injection

b)

Hardcoded credential

c)

OS command injection

d)

Insecure direct object reference