Disclaimer:
Educational Use Only:
The website links provided are to be used strictly for educational and knowledge-gaining purposes only.
No Misuse:
Do not misuse the links or the information contained therein for any commercial, illegal, or unethical activities.
Respect for Websites and Businesses:
Respect the intellectual property and business interests of the websites and their owners. Do not attempt to alter, copy, or redistribute content without proper authorization.
Acknowledge Value of Knowledge:
Recognize and value the knowledge and resources shared by these websites. Use the information responsibly and ethically.
No Endorsement:
The provision of these links does not imply endorsement of the linked sites, their content, or their products and services. Users are responsible for evaluating the suitability and accuracy of the information.
User Responsibility:
By accessing these links, you agree to use the information at your own risk and to comply with all applicable laws and website terms of use.
1. Which HTTP header prevents browsers from interpreting files as a different MIME type than declared?
a. Content-Security-Policy
b. X-Content-Type-Options
c. X-Frame-Options
d. Strict-Transport-Security
Answer: b. X-Content-Type-Optionsexamradar+1
2. What value should be set for the X-Content-Type-Options header to prevent MIME sniffing?
a. block
b. nosniff
c. none
d. safe
Answer: b. nosniffexamradar+1
3. Which header is used to control whether a web page can be embedded within an iframe?
a. X-Frame-Options
b. Referrer-Policy
c. Content-Security-Policy
d. Permissions-Policy
Answer: a. X-Frame-Optionsexamradar+1
4. Which header enforces the use of HTTPS?
a. Secure-Transport-Policy
b. X-Frame-Options
c. Strict-Transport-Security
d. X-Content-Type-Options
Answer: c. Strict-Transport-Securityinvicti+2
5. What is the purpose of the Referrer-Policy header?
a. To specify character encoding for the document
b. To control how much referrer information is included in requests
c. To expire sessions
d. To restrict inline scripts
Answer: b. To control how much referrer information is included in requestscheatsheetseries.owasp+1
6. Which security header helps mitigate cross-site scripting (XSS) by restricting the sources of executable scripts?
a. Content-Security-Policy
b. X-DNS-Prefetch-Control
c. Strict-Transport-Security
d. X-Frame-Options
Answer: a. Content-Security-Policydeveloper.okta+2
7. The X-XSS-Protection header is designed to:
a. Prevent clickjacking
b. Stop browsers from loading mixed content
c. Enable browser XSS filter
d. Disallow MIME sniffing
Answer: c. Enable browser XSS filtercheatsheetseries.owasp+1
8. Which header defines where browsers can load resources from?
a. X-Frame-Options
b. Cache-Control
c. Content-Security-Policy
d. Authorization
Answer: c. Content-Security-Policyinvicti+1
9. What does the header ‘Strict-Transport-Security: max-age=31536000’ accomplish?
a. Forces HTTPS for one year
b. Prevents XSS attacks
c. Disables caching
d. Disallows iframe inclusion
Answer: a. Forces HTTPS for one yeardeveloper.okta+1
10. Which header should be used to prevent clickjacking?
a. X-Powered-By
b. X-Frame-Options
c. Server
d. Vary
Answer: b. X-Frame-Optionsexamradar+1
11. What is the main purpose of HTTP security headers?
a. Style web pages
b. Enhance site security
c. Increase page load speed
d. Provide search engine optimization
Answer: b. Enhance site securityinvicti+2
12. The header ‘X-Frame-Options: DENY’ means:
a. The page can be displayed in any iframe
b. Only allow from same origin
c. Disallow in all iframes
d. Allow from any domain
Answer: c. Disallow in all iframesexamradar+1
13. Which header restricts browser features to minimize attack surface?
a. Permissions-Policy
b. X-Content-Type-Options
c. Cache-Control
d. Accept-Encoding
Answer: a. Permissions-Policydeveloper.okta+1
14. What does ‘Cache-Control: no-store’ instruct browsers to do?
a. Cache indefinitely
b. Never cache the content
c. Only cache static resources
d. Allow conditional caching
Answer: b. Never cache the contentcheatsheetseries.owasp
15. What risk can insecure Host header handling lead to?
a. Clickjacking
b. Host header poisoning
c. Cross-site request forgery
d. Buffer overflow
Answer: b. Host header poisoningportswigger+1
16. The ‘Set-Cookie’ header is used to:
a. Prevent clickjacking
b. Transmit session information
c. Specify allowed image sources
d. Control caching behavior
Answer: b. Transmit session informationcheatsheetseries.owasp
17. What does the ‘Access-Control-Allow-Origin’ header control?
a. Caching
b. Cross-origin resource sharing
c. Page encoding
d. Content type
Answer: b. Cross-origin resource sharingexamradar+1
18. Which header disables browser XSS protection?
a. X-XSS-Protection: 0
b. X-Frame-Options: DENY
c. Strict-Transport-Security: 0
d. X-Content-Type-Options: NONE
Answer: a. X-XSS-Protection: 0cheatsheetseries.owasp
19. What is the recommended value for Content-Security-Policy ‘script-src’ to restrict scripts?
a. ‘none’
b. ‘*’
c. ‘self’
d. ‘unsafe-inline’
Answer: c. ‘self’developer.okta+1
20. A missing or improperly configured Cache-Control header can lead to:
a. Cross-site scripting
b. Sensitive data exposure
c. Server bypass
d. SQL injection
Answer: b. Sensitive data exposureyeswehack+1
21. What is the function of the ‘Pragma: no-cache’ header?
a. Enables caching
b. Disables caching in HTTP/1.0
c. Controls referrer policy
d. Enforces HTTPS
Answer: b. Disables caching in HTTP/1.0cheatsheetseries.owasp
22. Which header can help mitigate risks of mixed content?
a. X-Frame-Options
b. Content-Security-Policy
c. Server
d. Accept-Encoding
Answer: b. Content-Security-Policydeveloper.okta+1
23. The ‘Vary’ header helps to:
a. Set content-type
b. Prevent cache poisoning
c. Specify allowed domains
d. Block XSS
Answer: b. Prevent cache poisoningyeswehack+1
24. Why should the Server header value be minimized or removed?
a. To increase bandwidth
b. To prevent server fingerprinting
c. To enable CORS
d. To allow inline styles
Answer: b. To prevent server fingerprintingyeswehack+1
25. Which header is essential to stop cross-origin access to APIs?
a. Strict-Transport-Security
b. Access-Control-Allow-Origin
c. X-Frame-Options
d. Referrer-Policy
Answer: b. Access-Control-Allow-Originexamradar+1
26. What does the ‘Public-Key-Pins’ (HPKP) header do?
a. Set allowed image sources
b. Control caching for sensitive data
c. Pin cryptographic public keys to a certificate
d. Hide cookies
Answer: c. Pin cryptographic public keys to a certificatecheatsheetseries.owasp
27. Which header can be set to restrict browser features, such as camera access?
a. Permissions-Policy
b. X-Frame-Options
c. Content-Security-Policy
d. Accept-Encoding
Answer: a. Permissions-Policydeveloper.okta+1
28. What is a risk of improperly handled Referer header?
a. SQL injection
b. Information leakage
c. Server crash
d. DDoS
Answer: b. Information leakageexamradar+1
29. The X-Powered-By header exposes:
a. Web application framework
b. Browser version
c. Authentication type
d. Encryption method
Answer: a. Web application frameworkyeswehack+1
30. Which security header is commonly recommended for all sites, regardless of type?
a. Strict-Transport-Security
b. Content-Security-Policy
c. X-Content-Type-Options
d. All of the above
Answer: d. All of the aboveinvicti+2
31. Which header is involved in cache-poisoned denial-of-service attacks?
a. Host
b. Cache-Control
c. Vary
d. Accept-Encoding
Answer: a. Hostportswigger+1
32. What is the best way to test HTTP headers for vulnerabilities?
a. Manual browser inspection
b. Use automated scanners and fuzzing tools
c. Ignore them
d. Use only server logs
Answer: b. Use automated scanners and fuzzing toolsyeswehack
33. Which header helps prevent downgrade attacks and forces encrypted traffic?
a. Strict-Transport-Security
b. X-XSS-Protection
c. Access-Control-Allow-Origin
d. X-Frame-Options
Answer: a. Strict-Transport-Securityinvicti+1
34. The ‘X-Requested-With’ header is sometimes used to:
a. Indicate an AJAX request
b. Restrict iframe access
c. Set cookie lifetime
d. Force HTTPS
Answer: a. Indicate an AJAX requestcheatsheetseries.owasp
35. Setting the header ‘Content-Type: application/json’ is important because:
a. Prevents clickjacking
b. Ensures browsers treat the response as JSON
c. Prevents SQL injection
d. Blocks CORS
Answer: b. Ensures browsers treat the response as JSONcheatsheetseries.owasp
36. If a site lacks the Strict-Transport-Security header, what risk remains?
a. Session hijacking via HTTP
b. SQL injection
c. Buffer overflow
d. XSS only
Answer: a. Session hijacking via HTTPinvicti+1
37. The ‘Location’ header is used to:
a. Set authentication types
b. Redirect HTTP requests
c. Control browser features
d. Invalidate cookies
Answer: b. Redirect HTTP requestscheatsheetseries.owasp
38. Which header can be checked to avoid web cache poisoning?
a. Host
b. Vary
c. Server
d. X-Content-Type-Options
Answer: b. Varyyeswehack
39. The ‘Content-Disposition’ header is important for:
a. Preventing file download attacks
b. Enforcing HTTPS
c. Setting XSS protection
d. Expiring cookies
Answer: a. Preventing file download attackscheatsheetseries.owasp
40. What can happen if cookies lack the ‘Secure’ attribute?
a. They are only sent over HTTPS
b. They work in all browsers
c. They may be exposed over HTTP
d. They are automatically encrypted
Answer: c. They may be exposed over HTTPinvicti+1
41. Which header would you set to restrict search engine robots?
a. Robots-Txt
b. X-Robots-Tag
c. User-Agent
d. Server
Answer: b. X-Robots-Tagcheatsheetseries.owasp
42. ‘Access-Control-Allow-Methods’ specifies:
a. Allowed HTTP methods for CORS requests
b. Permitted robots
c. Allowed cookies
d. Supported encodings
Answer: a. Allowed HTTP methods for CORS requestscheatsheetseries.owasp
43. What is the main danger of reflected Host header values?
a. CORS issues
b. Web cache poisoning
c. SQL injection
d. DDoS
Answer: b. Web cache poisoningportswigger
44. The X-DNS-Prefetch-Control header controls:
a. Browser DNS prefetching
b. Cookie storage
c. AJAX requests
d. Trusted sources
Answer: a. Browser DNS prefetchingcheatsheetseries.owasp
45. A misconfigured Content-Security-Policy header might:
a. Prevent scripts from loading
b. Allow XSS attacks
c. Block cookies
d. Encrypt content automatically
Answer: b. Allow XSS attacksdeveloper.okta+1
46. Which header is set to limit object embedding, like Flash/Java?
a. X-Frame-Options
b. X-Content-Type-Options
c. Content-Security-Policy (object-src)
d. Permissions-Policy
Answer: c. Content-Security-Policy (object-src)developer.okta+1
47. The ‘ETag’ header is used for:
a. Client-side encryption
b. Cache validation
c. Cookie expiration
d. Disabling JS
Answer: b. Cache validationcheatsheetseries.owasp
48. Which header can help in detecting the presence of a reverse proxy?
a. Via
b. X-Powered-By
c. Host
d. Strict-Transport-Security
Answer: a. Viayeswehack+1
49. What is ‘max-age’ in the Strict-Transport-Security header?
a. Duration for browser to enforce HTTPS
b. Maximum session lifetime
c. Cookie expiry time
d. Allowed CORS duration
Answer: a. Duration for browser to enforce HTTPSinvicti+1
50. Why must the Content-Security-Policy avoid ‘unsafe-inline’ for scripts?
a. It reduces XSS risk
b. It disables cookies
c. It enables cache poisoning
d. It allows HTTP requests
Answer: a. It reduces XSS riskinvicti+2
- https://examradar.com/security-headers-and-practices-mcqs/
- https://examradar.com/security-headers-and-information-disclosure-mcqs/
- https://www.invicti.com/blog/web-security/http-security-headers
- https://developer.okta.com/blog/2021/10/18/security-headers-best-practices
- https://cheatsheetseries.owasp.org/cheatsheets/HTTP_Headers_Cheat_Sheet.html
- https://portswigger.net/web-security/host-header/exploiting
- https://portswigger.net/web-security/host-header
- https://www.yeswehack.com/learn-bug-bounty/http-header-exploitation
- https://www.sanfoundry.com/cyber-security-questions-answers-security-protocols-1/
- https://www.placementpreparation.io/mcq/cyber-security/
- https://www.scribd.com/document/488601324/Cyber-security-MCQ-NOTES
- https://testbook.com/objective-questions/mcq-on-data-network-security–64f9c10d513684ddf3ab2b0b
- https://www.yeahhub.com/40-cyber-security-mcq-answers-explanations/
- https://testbook.com/objective-questions/mcq-on-http–5eea6a0939140f30f369d901
- https://www.scribd.com/document/861544872/OWASP-MCQ
- https://allabouttesting.org/test-your-knowledge-tls-security-best-practices-with-mcqs/
- https://www.sanfoundry.com/computer-networks-mcqs-http/
- https://allabouttesting.org/owasp-top-10-mcq-with-answers/
- https://www.sanfoundry.com/html-questions-answers-http-overview/
- https://examradar.com/fundamentals-of-security-headers-in-web-application-security-mcqs/