wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

03 Quizz Secure Coding Without C#

Total questions: 30

Worksheet time: 15mins

Name
Class
Date
1.
What is the main goal of input validation?
a)
Filter good data
b)
Accept all data
c)
Ensure data matches expected rules
d)
Encrypt inputs
2.
What is allowlisting?
a)
Blocking known bad input
b)
Accepting only known good input
c)
Logging all user input
d)
Encoding text
3.
What is denylisting?
a)
Accepting good input
b)
Blocking known malicious input
c)
Encoding input
d)
Hashing data
4.
Why must input validation be done server-side?
a)
Client validation is secure enough
b)
Attackers can bypass client-side checks
c)
It improves UI
d)
It speeds performance
5.
What is ReDoS?
a)
Regular Expression Denial of Service
b)
Random Encryption Delay of Service
c)
Recursive DNS Security
d)
Remote Data Stream
6.
What is mass assignment?
a)
Allowing multiple DB calls
b)
Automatic binding of request data to objects
c)
Encrypting API data
d)
Logging all requests
7.
How to prevent mass assignment?
a)
Use DTOs or explicit field mapping
b)
Use cookies
c)
Store input in JSON
d)
Log all forms
8.
What is input sanitization?
a)
Encoding or removing unsafe characters
b)
Logging input
c)
Encrypting files
d)
Filtering SQL data
9.
What is HTML encoding used for?
a)
Formatting web pages
b)
Preventing XSS attacks
c)
Encrypting user input
d)
Optimizing HTTP headers
10.
What is OAuth 2.0 designed for?
a)
Authorization
b)
Authentication
c)
Encryption
d)
Logging
11.
What does OpenID Connect add to OAuth2?
a)
Logging
b)
Encryption
c)
Authentication (identity)
d)
Session management
12.
What is an access token?
a)
A long-lived key
b)
A short-lived key for API access
c)
A password
d)
A log file
13.
What is a refresh token?
a)
For logging
b)
To renew access tokens
c)
For password reset
d)
To hash data
14.
Who is the resource owner in OAuth 2.0?
a)
The app
b)
The user
c)
The API
d)
The cloud
15.
What does encryption protect?
a)
Application speed
b)
Confidentiality of data
c)
Code readability
d)
Logging
16.
What is AES-256 used for?
a)
Compressing data
b)
Strong encryption of stored data
c)
Password hashing
d)
File naming
17.
What is hashing used for?
a)
Encrypting files
b)
Hiding passwords securely
c)
Logging access
d)
Compressing strings
18.
What does HMAC ensure?
a)
Data availability
b)
Data integrity
c)
Data deletion
d)
Performance
19.
What is SSL/TLS pinning used for?
a)
Prevent DDoS
b)
Prevent MITM attacks
c)
Hash passwords
d)
Speed up TLS
20.
What does HSTS enforce?
a)
HTTPS-only communication
b)
Cookie encryption
c)
File integrity
d)
IP blocking
21.
Why should you avoid storing secrets in config files?
a)
They can be stolen
b)
It slows performance
c)
It breaks builds
d)
It affects JSON syntax
22.
What is a safe place to store secrets?
a)
Logs
b)
Environment variables or vaults
c)
Text files
d)
Browser cache
23.
What does the principle of least privilege mean?
a)
Give all users admin access
b)
Grant minimum rights needed
c)
Restrict all access
d)
Only use one account
24.
What is Software Composition Analysis (SCA)?
a)
Code formatting tool
b)
Dependency vulnerability scanning
c)
Versioning system
d)
Build optimizer
25.
Why keep dependencies up to date?
a)
For speed
b)
To patch known vulnerabilities
c)
To reduce cost
d)
To enable caching
26.
What is dependency drift?
a)
Version changes without control
b)
File corruption
c)
Network lag
d)
Memory leak
27.
What does logging provide?
a)
Security visibility
b)
Slower performance
c)
Extra costs
d)
UI improvement
28.
Why avoid detailed error messages?
a)
They confuse users
b)
They expose internal information
c)
They break code
d)
They disable logging
29.
What is a security audit?
a)
UI inspection
b)
Systematic review for security flaws
c)
Cost estimation
d)
Load testing
30.
Why perform penetration testing?
a)
To measure load
b)
To simulate real-world attacks
c)
To test UI design
d)
To log results