1. What does OWASP stand for?

A) Open Web Application Security Project
B) Online Web Application Security Program
C) Open Worldwide Application Security Protocol
D) Organization for Web Application Secure Programming

βœ… Answer: A) Open Web Application Security Project
πŸ“Œ Explanation: OWASP is an open-source project dedicated to identifying and mitigating security risks in web applications.


2. Which of the following is NOT a part of the OWASP Top 10 list?

A) Injection
B) Sensitive Data Exposure
C) Network Spoofing
D) Broken Access Control

βœ… Answer: C) Network Spoofing
πŸ“Œ Explanation: OWASP Top 10 focuses on web application vulnerabilities, while “Network Spoofing” is a broader network security concern.


3. SQL Injection falls under which OWASP category?

A) Security Misconfiguration
B) Injection
C) Broken Authentication
D) Cross-Site Scripting (XSS)

βœ… Answer: B) Injection
πŸ“Œ Explanation: SQL Injection (SQLi) is a type of Injection attack that exploits poor query handling in databases.


4. Which security risk allows attackers to take control of user accounts by stealing session tokens?

A) Broken Authentication
B) Security Misconfiguration
C) XML External Entities (XXE)
D) Cross-Site Scripting (XSS)

βœ… Answer: A) Broken Authentication
πŸ“Œ Explanation: Broken Authentication results from weak session management, allowing attackers to hijack user accounts.


5. How can SQL Injection be prevented?

A) Using string concatenation for database queries
B) Using prepared statements and parameterized queries
C) Disabling database logging
D) Obfuscating database error messages

βœ… Answer: B) Using prepared statements and parameterized queries
πŸ“Œ Explanation: Prepared statements protect against SQL Injection by ensuring user input is safely handled.


6. What is the primary risk associated with Broken Access Control?

A) Unauthorized access to sensitive data
B) Phishing attacks
C) DNS spoofing
D) Man-in-the-Middle (MITM) attacks

βœ… Answer: A) Unauthorized access to sensitive data
πŸ“Œ Explanation: Broken Access Control occurs when unauthorized users can access or modify sensitive data.


7. What is the best way to protect sensitive data in web applications?

A) Storing sensitive data in plain text
B) Using strong encryption and hashing techniques
C) Only allowing admins to view the data
D) Disabling user authentication

βœ… Answer: B) Using strong encryption and hashing techniques
πŸ“Œ Explanation: Encryption ensures that even if data is exposed, it remains unreadable.


8. Which vulnerability is exploited by attackers using malicious JavaScript?

A) SQL Injection
B) Cross-Site Scripting (XSS)
C) Server-Side Request Forgery (SSRF)
D) Broken Access Control

βœ… Answer: B) Cross-Site Scripting (XSS)
πŸ“Œ Explanation: XSS attacks occur when malicious scripts execute in a victim’s browser.


9. What is the best defense against Cross-Site Scripting (XSS)?

A) Encrypting passwords
B) Proper input validation and output encoding
C) Using HTTPS
D) Disabling browser security features

βœ… Answer: B) Proper input validation and output encoding
πŸ“Œ Explanation: Validating input and encoding output prevents malicious script execution.


10. What is a common cause of Security Misconfiguration?

A) Using well-maintained security policies
B) Exposing unnecessary services and default settings
C) Regular software updates
D) Enabling multi-factor authentication

βœ… Answer: B) Exposing unnecessary services and default settings
πŸ“Œ Explanation: Security misconfigurations arise from unused features, default credentials, and improper settings.


11. Which vulnerability allows unauthorized requests using an authenticated user’s credentials?

A) Server-Side Request Forgery (SSRF)
B) Cross-Site Request Forgery (CSRF)
C) XML External Entities (XXE)
D) Insecure Deserialization

βœ… Answer: B) Cross-Site Request Forgery (CSRF)
πŸ“Œ Explanation: CSRF tricks users into executing unwanted actions on web applications.


12. How can CSRF be prevented?

A) Disabling cookies
B) Using CSRF tokens and SameSite cookie attributes
C) Encrypting URLs
D) Using CAPTCHAs

βœ… Answer: B) Using CSRF tokens and SameSite cookie attributes
πŸ“Œ Explanation: CSRF tokens ensure only legitimate requests are processed.


13. What is XML External Entities (XXE) attack?

A) Attacking APIs through improper authentication
B) Injecting malicious XML code to exploit XML parsers
C) Modifying HTTP headers to gain unauthorized access
D) Creating multiple login attempts to bypass authentication

βœ… Answer: B) Injecting malicious XML code to exploit XML parsers
πŸ“Œ Explanation: XXE can lead to data leakage and server-side attacks.


14. Why is Insecure Deserialization a risk?

A) It allows attackers to manipulate serialized objects and execute arbitrary code
B) It enables session hijacking
C) It exposes API endpoints to unauthorized users
D) It prevents users from logging into applications

βœ… Answer: A) It allows attackers to manipulate serialized objects and execute arbitrary code
πŸ“Œ Explanation: Attackers can modify serialized objects to perform unauthorized actions.


15. What is Server-Side Request Forgery (SSRF)?

A) Exploiting a server’s ability to send unintended requests
B) Stealing credentials through a phishing attack
C) Injecting SQL queries into the database
D) Redirecting users to a fake website

βœ… Answer: A) Exploiting a server’s ability to send unintended requests
πŸ“Œ Explanation: SSRF tricks servers into accessing unauthorized internal resources.


16. What is the impact of OWASP Top 10 vulnerabilities on web applications?

A) Financial losses and data breaches
B) Faster web application performance
C) Improved network speeds
D) Reduced storage requirements

βœ… Answer: A) Financial losses and data breaches
πŸ“Œ Explanation: Security flaws can lead to stolen data, financial fraud, and reputational damage.


17. What type of attack occurs when an attacker exploits a vulnerability in a website’s database query structure?

A) Command Injection
B) SQL Injection
C) Cross-Site Request Forgery (CSRF)
D) XML External Entities (XXE)

βœ… Answer: B) SQL Injection
πŸ“Œ Explanation: SQL Injection occurs when attackers manipulate SQL queries by injecting malicious input.


18. What is a common impact of Broken Access Control?

A) Increased page load speed
B) Unauthorized access to sensitive data
C) Automatic password recovery
D) Secure API access

βœ… Answer: B) Unauthorized access to sensitive data
πŸ“Œ Explanation: Broken Access Control allows attackers to view, modify, or delete sensitive information.


19. What security measure helps prevent Broken Authentication?

A) Using weak passwords
B) Implementing Multi-Factor Authentication (MFA)
C) Disabling encryption
D) Allowing unlimited login attempts

βœ… Answer: B) Implementing Multi-Factor Authentication (MFA)
πŸ“Œ Explanation: MFA adds an extra layer of security by requiring additional authentication factors beyond a password.


20. How does improper logging and monitoring increase security risks?

A) It improves system performance
B) It prevents attackers from being detected
C) It helps users reset their passwords
D) It speeds up incident response

βœ… Answer: B) It prevents attackers from being detected
πŸ“Œ Explanation: Lack of proper logging allows attackers to remain undetected for long periods, increasing the damage potential.


21. Which of the following is NOT a way to mitigate OWASP security risks?

A) Regular security audits
B) Using parameterized queries
C) Allowing users to input raw SQL commands
D) Enforcing least privilege access

βœ… Answer: C) Allowing users to input raw SQL commands
πŸ“Œ Explanation: Allowing raw SQL inputs is a serious security risk and should be avoided.


22. Which security risk involves an attacker intercepting unencrypted sensitive information?

A) Insecure Deserialization
B) Sensitive Data Exposure
C) Broken Authentication
D) Cross-Site Scripting (XSS)

βœ… Answer: B) Sensitive Data Exposure
πŸ“Œ Explanation: Sensitive Data Exposure occurs when confidential information is transmitted or stored in an unprotected manner.


23. What is an effective way to prevent Insecure Deserialization attacks?

A) Allowing user-generated serialized objects
B) Verifying and validating serialized data before processing
C) Storing serialized objects in plain text
D) Using the same encryption key for all objects

βœ… Answer: B) Verifying and validating serialized data before processing
πŸ“Œ Explanation: Only allowing trusted serialized objects helps prevent deserialization attacks.


24. What is the primary goal of Security Misconfiguration prevention?

A) Ensuring website aesthetics
B) Preventing system instability
C) Closing unnecessary attack surfaces
D) Improving website speed

βœ… Answer: C) Closing unnecessary attack surfaces
πŸ“Œ Explanation: Security Misconfiguration occurs when default credentials, excessive permissions, or outdated software create vulnerabilities.


25. What makes Server-Side Request Forgery (SSRF) a serious risk?

A) It allows attackers to manipulate HTTP requests and access internal resources
B) It improves website performance
C) It prevents unauthorized access
D) It reduces API security risks

βœ… Answer: A) It allows attackers to manipulate HTTP requests and access internal resources
πŸ“Œ Explanation: SSRF exploits vulnerabilities in web applications that allow requests to be sent on behalf of the server.


26. Why is enforcing the Principle of Least Privilege (PoLP) important in preventing OWASP risks?

A) It grants users admin rights by default
B) It limits users to only the access they need
C) It allows attackers to exploit vulnerabilities easily
D) It makes all users equal in terms of access

βœ… Answer: B) It limits users to only the access they need
πŸ“Œ Explanation: Restricting access to only necessary privileges reduces the risk of exploitation.


27. Which HTTP security header helps prevent XSS attacks?

A) X-Content-Type-Options
B) X-Frame-Options
C) Content Security Policy (CSP)
D) Referrer-Policy

βœ… Answer: C) Content Security Policy (CSP)
πŸ“Œ Explanation: CSP prevents XSS by restricting the sources from which scripts can be executed.


28. What is a major difference between Reflected and Stored XSS?

A) Reflected XSS executes once, while Stored XSS remains persistent
B) Stored XSS affects users only once
C) Reflected XSS requires user authentication
D) Stored XSS is less dangerous than Reflected XSS

βœ… Answer: A) Reflected XSS executes once, while Stored XSS remains persistent
πŸ“Œ Explanation: Reflected XSS occurs when an injected script is executed immediately, while Stored XSS persists in the database.


29. Which OWASP risk is associated with hardcoded API keys and credentials?

A) Insecure API Security
B) Sensitive Data Exposure
C) Insecure Deserialization
D) Cross-Site Request Forgery (CSRF)

βœ… Answer: B) Sensitive Data Exposure
πŸ“Œ Explanation: Hardcoded credentials expose sensitive information and make applications vulnerable to attacks.


30. Which of the following best describes a supply chain attack?

A) An attack targeting third-party components or dependencies
B) An attack that manipulates search engine results
C) An attack that relies on phishing emails
D) An attack that targets Wi-Fi networks

βœ… Answer: A) An attack targeting third-party components or dependencies
πŸ“Œ Explanation: Supply chain attacks occur when an attacker compromises third-party libraries, software updates, or hardware components to inject malicious code.


31. What is a common way to prevent Broken Access Control?

A) Implementing proper role-based access control (RBAC)
B) Allowing all users to access all resources
C) Storing access control lists in plaintext
D) Enabling guest user privileges for all users

βœ… Answer: A) Implementing proper role-based access control (RBAC)
πŸ“Œ Explanation: RBAC restricts users’ access based on their roles, preventing unauthorized actions.


32. Which of the following is a real-world impact of Broken Authentication?

A) A user can log in without entering a password
B) Attackers can brute-force login credentials and gain access
C) All users are automatically logged out
D) An application runs faster

βœ… Answer: B) Attackers can brute-force login credentials and gain access
πŸ“Œ Explanation: Weak authentication mechanisms allow attackers to exploit login systems and access accounts.


33. How does a Cross-Origin Resource Sharing (CORS) misconfiguration create security risks?

A) It allows unauthorized third-party domains to access sensitive data
B) It prevents API calls from executing
C) It blocks user access to the application
D) It encrypts all user traffic

βœ… Answer: A) It allows unauthorized third-party domains to access sensitive data
πŸ“Œ Explanation: CORS misconfigurations may expose APIs and user data to malicious third-party websites.


34. What is the primary risk of allowing users to upload files without validation?

A) Slower website performance
B) File Upload Vulnerability leading to Remote Code Execution (RCE)
C) Increased bandwidth usage
D) More secure web applications

βœ… Answer: B) File Upload Vulnerability leading to Remote Code Execution (RCE)
πŸ“Œ Explanation: Unvalidated file uploads allow attackers to upload malicious scripts and execute arbitrary code.


35. Which attack method can exploit improper session management?

A) Session Hijacking
B) SQL Injection
C) DNS Spoofing
D) IP Spoofing

βœ… Answer: A) Session Hijacking
πŸ“Œ Explanation: Session Hijacking occurs when attackers steal a user’s session ID to impersonate them.


36. What type of vulnerabilities can arise from an insecure direct object reference (IDOR)?

A) Unauthorized access to data by modifying URL parameters
B) Increased website load time
C) Redirection to phishing websites
D) Faster authentication

βœ… Answer: A) Unauthorized access to data by modifying URL parameters
πŸ“Œ Explanation: IDOR occurs when users can directly access unauthorized objects by changing request parameters.


37. What does the “S” in HTTPS stand for, and why is it important?

A) Secure, it encrypts data in transit
B) Speed, it makes websites load faster
C) Server, it improves backend operations
D) Storage, it saves cookies

βœ… Answer: A) Secure, it encrypts data in transit
πŸ“Œ Explanation: HTTPS secures communication between users and servers using SSL/TLS encryption.


38. What is a major risk of not setting proper HTTP security headers?

A) Increased loading time
B) Vulnerability to Clickjacking, XSS, and data exposure
C) Reduced website traffic
D) Improved caching performance

βœ… Answer: B) Vulnerability to Clickjacking, XSS, and data exposure
πŸ“Œ Explanation: HTTP security headers (like CSP, X-Frame-Options) help protect against multiple attack vectors.


39. What is the primary cause of Server-Side Request Forgery (SSRF)?

A) Allowing untrusted user input in server-side HTTP requests
B) Weak encryption algorithms
C) Enabling multi-factor authentication
D) Implementing CAPTCHA for authentication

βœ… Answer: A) Allowing untrusted user input in server-side HTTP requests
πŸ“Œ Explanation: SSRF happens when an attacker tricks the server into making unintended requests.


40. How can an application protect itself from Cross-Site Scripting (XSS)?

A) Encoding output and sanitizing user input
B) Encrypting all stored files
C) Disabling JavaScript in browsers
D) Using multi-threading for API calls

βœ… Answer: A) Encoding output and sanitizing user input
πŸ“Œ Explanation: Proper input validation and output encoding prevent XSS attacks.


41. What is a characteristic of an insecure API?

A) Exposes excessive data
B) Uses proper authentication
C) Implements rate limiting
D) Enforces strong encryption

βœ… Answer: A) Exposes excessive data
πŸ“Œ Explanation: Insecure APIs may expose unnecessary or sensitive information, increasing security risks.


42. Which OWASP risk is associated with misconfigured cloud storage services?

A) Sensitive Data Exposure
B) SQL Injection
C) Cross-Site Scripting (XSS)
D) Insecure Deserialization

βœ… Answer: A) Sensitive Data Exposure
πŸ“Œ Explanation: Cloud misconfigurations often lead to unprotected storage, exposing sensitive data.


43. Why is security logging important in applications?

A) It helps detect and respond to security incidents
B) It increases storage space
C) It improves website performance
D) It prevents broken authentication

βœ… Answer: A) It helps detect and respond to security incidents
πŸ“Œ Explanation: Logging allows administrators to track security events and detect malicious activity.


44. What is the role of Web Application Firewalls (WAFs) in security?

A) Blocking malicious web traffic and preventing OWASP attacks
B) Storing user session data
C) Encrypting passwords
D) Improving website speed

βœ… Answer: A) Blocking malicious web traffic and preventing OWASP attacks
πŸ“Œ Explanation: WAFs help mitigate threats such as XSS, SQL Injection, and CSRF.


45. What is an effective way to prevent account takeover attacks?

A) Implementing Multi-Factor Authentication (MFA)
B) Disabling security updates
C) Allowing password reuse
D) Using public Wi-Fi for authentication

βœ… Answer: A) Implementing Multi-Factor Authentication (MFA)
πŸ“Œ Explanation: MFA requires multiple verification factors, reducing the risk of unauthorized access.


46. Why should developers avoid storing plaintext passwords?

A) They can be easily stolen in data breaches
B) It improves performance
C) It allows users to remember their passwords easily
D) It prevents XSS attacks

βœ… Answer: A) They can be easily stolen in data breaches
πŸ“Œ Explanation: Passwords should be securely hashed and salted to prevent unauthorized access.


47. What is a common symptom of an insecure deserialization attack?

A) Arbitrary code execution
B) Faster API responses
C) Increased storage usage
D) More efficient data retrieval

βœ… Answer: A) Arbitrary code execution
πŸ“Œ Explanation: Insecure deserialization allows attackers to manipulate serialized objects and execute malicious code.


48. What is the impact of a successful CSRF attack?

A) Users unknowingly perform unwanted actions
B) Website traffic increases
C) Session cookies become encrypted
D) The website loads faster

βœ… Answer: A) Users unknowingly perform unwanted actions
πŸ“Œ Explanation: CSRF tricks users into performing unauthorized actions, often leading to account compromises.


49. Why should unused features and services be disabled on a web server?

A) To reduce attack surface and prevent security misconfigurations
B) To increase system performance
C) To allow unlimited file uploads
D) To enable guest users to log in

βœ… Answer: A) To reduce attack surface and prevent security misconfigurations
πŸ“Œ Explanation: Disabling unnecessary services minimizes security risks and attack vectors.


50. What is a common attack method against JWT (JSON Web Token)?

A) Token theft and reuse
B) Brute-force attacks
C) Clickjacking
D) HTTP Smuggling

βœ… Answer: A) Token theft and reuse
πŸ“Œ Explanation: Attackers can steal JWT tokens and reuse them if they are not properly secured or expired.


51. What is a primary cause of Broken Authentication?

A) Weak password policies and session management issues
B) Using MFA for authentication
C) Disabling cookies
D) Implementing biometric authentication

βœ… Answer: A) Weak password policies and session management issues
πŸ“Œ Explanation: Weak passwords, lack of multi-factor authentication (MFA), and improper session management lead to Broken Authentication.


52. Which of the following techniques can mitigate SQL Injection attacks?

A) Using parameterized queries
B) Allowing user-generated SQL queries
C) Storing passwords in plaintext
D) Disabling database logging

βœ… Answer: A) Using parameterized queries
πŸ“Œ Explanation: Parameterized queries ensure that user input is handled safely, preventing SQL Injection attacks.


53. Which OWASP Top 10 vulnerability can be exploited using a web proxy tool like Burp Suite?

A) Broken Access Control
B) Security Misconfiguration
C) Insecure Deserialization
D) All of the above

βœ… Answer: D) All of the above
πŸ“Œ Explanation: A web proxy tool allows attackers to intercept and manipulate requests, making it useful for exploiting multiple OWASP risks.


54. What type of attack exploits a lack of input validation in file uploads?

A) Remote Code Execution (RCE)
B) Clickjacking
C) Brute force attack
D) DNS Spoofing

βœ… Answer: A) Remote Code Execution (RCE)
πŸ“Œ Explanation: Unvalidated file uploads allow attackers to upload and execute malicious scripts on the server.


55. How does a Clickjacking attack work?

A) By tricking users into clicking on invisible elements
B) By injecting malicious JavaScript
C) By modifying API requests
D) By brute-forcing login credentials

βœ… Answer: A) By tricking users into clicking on invisible elements
πŸ“Œ Explanation: Clickjacking overlays a transparent layer over a legitimate button, deceiving users into performing unintended actions.


56. Which of the following is a common example of a Security Misconfiguration?

A) Keeping default credentials for an admin panel
B) Implementing access control properly
C) Using HTTPS for secure connections
D) Enforcing strict Content Security Policy (CSP)

βœ… Answer: A) Keeping default credentials for an admin panel
πŸ“Œ Explanation: Default credentials allow attackers easy access to administrative interfaces.


57. What is the primary goal of implementing a Content Security Policy (CSP)?

A) To prevent Cross-Site Scripting (XSS) attacks
B) To block SQL Injection
C) To speed up website performance
D) To disable encryption

βœ… Answer: A) To prevent Cross-Site Scripting (XSS) attacks
πŸ“Œ Explanation: CSP restricts the sources from which scripts can be loaded, mitigating XSS risks.


58. What is the primary risk of using hardcoded credentials in source code?

A) Performance degradation
B) Exposure of credentials in public repositories
C) Increased encryption strength
D) Improved debugging capabilities

βœ… Answer: B) Exposure of credentials in public repositories
πŸ“Œ Explanation: Hardcoded credentials in repositories can be accessed by attackers, leading to data breaches.


59. Which method helps prevent credential stuffing attacks?

A) Rate limiting and account lockout mechanisms
B) Allowing unlimited login attempts
C) Storing passwords in plaintext
D) Using weak hashing algorithms

βœ… Answer: A) Rate limiting and account lockout mechanisms
πŸ“Œ Explanation: Rate limiting prevents automated login attempts, reducing the effectiveness of credential stuffing.


60. How does an attacker exploit a DOM-based XSS vulnerability?

A) By modifying the Document Object Model (DOM) in the victim’s browser
B) By injecting SQL queries into the database
C) By modifying HTTP response headers
D) By redirecting users to a phishing site

βœ… Answer: A) By modifying the Document Object Model (DOM) in the victim’s browser
πŸ“Œ Explanation: DOM-based XSS manipulates the webpage dynamically, executing malicious scripts in the user’s browser.


61. What is the impact of an improperly implemented CORS policy?

A) Unauthorized API access from malicious third-party sites
B) Increased application speed
C) Improved user authentication
D) Faster database queries

βœ… Answer: A) Unauthorized API access from malicious third-party sites
πŸ“Œ Explanation: Misconfigured CORS can allow unauthorized web pages to interact with sensitive APIs.


62. What is a key characteristic of Server-Side Request Forgery (SSRF)?

A) The server is tricked into making unauthorized requests
B) Attackers modify database records
C) Users gain admin privileges
D) Passwords are decrypted

βœ… Answer: A) The server is tricked into making unauthorized requests
πŸ“Œ Explanation: SSRF occurs when a server processes external requests on behalf of an attacker.


63. How does implementing the “SameSite” attribute in cookies enhance security?

A) It helps mitigate Cross-Site Request Forgery (CSRF) attacks
B) It speeds up website loading times
C) It encrypts cookies
D) It improves database performance

βœ… Answer: A) It helps mitigate Cross-Site Request Forgery (CSRF) attacks
πŸ“Œ Explanation: The SameSite attribute restricts cookies from being sent with cross-site requests, reducing CSRF risks.


64. What is a common symptom of an insecure deserialization attack?

A) Execution of arbitrary code on the server
B) Faster API responses
C) Increased network speed
D) More efficient logging

βœ… Answer: A) Execution of arbitrary code on the server
πŸ“Œ Explanation: Insecure deserialization allows attackers to manipulate serialized objects and execute malicious operations.


65. What is the most effective way to mitigate Broken Access Control?

A) Enforcing least privilege and implementing strong authorization controls
B) Allowing guest users full access
C) Using weak encryption
D) Hiding URLs from users

βœ… Answer: A) Enforcing least privilege and implementing strong authorization controls
πŸ“Œ Explanation: Restricting access and properly enforcing authorization rules help prevent unauthorized access.


66. Why is it dangerous to use outdated software and libraries?

A) They contain known vulnerabilities that can be exploited
B) They improve performance
C) They make debugging easier
D) They prevent XSS attacks

βœ… Answer: A) They contain known vulnerabilities that can be exploited
πŸ“Œ Explanation: Attackers often target outdated software that lacks security patches.


67. What is a common example of Sensitive Data Exposure?

A) Storing passwords in plaintext
B) Using TLS for encryption
C) Implementing proper access controls
D) Using a strong password policy

βœ… Answer: A) Storing passwords in plaintext
πŸ“Œ Explanation: Storing credentials in plaintext makes them accessible to attackers if the database is compromised.


68. Why should error messages be handled carefully in web applications?

A) To prevent information disclosure to attackers
B) To increase application speed
C) To make debugging easier
D) To improve SEO ranking

βœ… Answer: A) To prevent information disclosure to attackers
πŸ“Œ Explanation: Verbose error messages can reveal sensitive system details that attackers can exploit.


69. What is a common way to prevent XML External Entity (XXE) attacks?

A) Disabling XML external entity processing
B) Allowing all user-generated XML data
C) Encrypting XML files
D) Using weak API authentication

βœ… Answer: A) Disabling XML external entity processing
πŸ“Œ Explanation: Disabling the use of external entities in XML parsing prevents XXE exploits.


70. What is the role of a Web Application Firewall (WAF) in preventing OWASP risks?

A) Detecting and blocking malicious web traffic
B) Encrypting all web traffic
C) Managing user authentication
D) Improving database performance

βœ… Answer: A) Detecting and blocking malicious web traffic
πŸ“Œ Explanation: A WAF inspects HTTP requests and blocks threats like SQL Injection and XSS.


71. Why is it important to use HTTPS instead of HTTP?

A) It encrypts data in transit, preventing Man-in-the-Middle (MITM) attacks
B) It speeds up website performance
C) It reduces the need for authentication
D) It allows browsers to load pages faster

βœ… Answer: A) It encrypts data in transit, preventing Man-in-the-Middle (MITM) attacks
πŸ“Œ Explanation: HTTPS secures communication between clients and servers using SSL/TLS encryption.


72. What is a key risk of an improperly configured security header policy?

A) It allows attackers to exploit vulnerabilities such as Clickjacking and XSS
B) It improves page loading speed
C) It prevents security audits
D) It increases database efficiency

βœ… Answer: A) It allows attackers to exploit vulnerabilities such as Clickjacking and XSS
πŸ“Œ Explanation: Security headers like CSP, X-Frame-Options, and X-XSS-Protection mitigate common web vulnerabilities.


73. What is an effective way to prevent Brute Force Attacks on login pages?

A) Implementing account lockout after multiple failed attempts
B) Allowing unlimited login attempts
C) Storing passwords in plaintext
D) Disabling password requirements

βœ… Answer: A) Implementing account lockout after multiple failed attempts
πŸ“Œ Explanation: Locking accounts after multiple incorrect login attempts prevents attackers from guessing passwords.


74. What is the primary concern with using outdated third-party libraries in applications?

A) They may contain known vulnerabilities that attackers can exploit
B) They improve website performance
C) They make debugging easier
D) They reduce security risks

βœ… Answer: A) They may contain known vulnerabilities that attackers can exploit
πŸ“Œ Explanation: Old libraries may have security flaws that attackers can exploit if updates are not applied.


75. How can attackers exploit a vulnerable session management system?

A) By hijacking session tokens to gain unauthorized access
B) By encrypting session cookies
C) By using HTTPS
D) By blocking XSS attacks

βœ… Answer: A) By hijacking session tokens to gain unauthorized access
πŸ“Œ Explanation: Weak session management can allow attackers to steal or predict session tokens.


76. What is a common attack method against insecure API endpoints?

A) Broken Object-Level Authorization (BOLA)
B) Cross-Site Request Forgery (CSRF)
C) Command Injection
D) DNS Spoofing

βœ… Answer: A) Broken Object-Level Authorization (BOLA)
πŸ“Œ Explanation: BOLA allows unauthorized users to access or manipulate data due to weak API security controls.


77. What type of attack exploits the lack of proper authorization controls?

A) Broken Access Control
B) SQL Injection
C) Cross-Site Scripting (XSS)
D) Buffer Overflow

βœ… Answer: A) Broken Access Control
πŸ“Œ Explanation: Broken Access Control allows unauthorized users to perform actions they should not have permission for.


78. Which type of vulnerability is primarily exploited when an attacker manipulates serialized objects?

A) Insecure Deserialization
B) Clickjacking
C) XSS
D) Credential Stuffing

βœ… Answer: A) Insecure Deserialization
πŸ“Œ Explanation: Insecure Deserialization allows attackers to modify serialized objects, potentially leading to remote code execution.


79. How does an attacker typically exploit an IDOR (Insecure Direct Object Reference) vulnerability?

A) By modifying request parameters to access unauthorized data
B) By injecting malicious SQL queries
C) By manipulating JavaScript in the browser
D) By performing DDoS attacks

βœ… Answer: A) By modifying request parameters to access unauthorized data
πŸ“Œ Explanation: IDOR vulnerabilities occur when an application exposes sensitive data by allowing direct access through request modifications.


80. Why is enforcing the Same-Origin Policy (SOP) important for web security?

A) It prevents malicious websites from making unauthorized requests to different origins
B) It speeds up website performance
C) It encrypts all HTTP requests
D) It blocks phishing emails

βœ… Answer: A) It prevents malicious websites from making unauthorized requests to different origins
πŸ“Œ Explanation: SOP restricts scripts from interacting with resources from a different domain unless explicitly allowed.


81. What is a key weakness of relying only on client-side validation for security?

A) Attackers can bypass validation by modifying requests
B) It increases security by preventing SQL Injection
C) It ensures that data is always validated correctly
D) It speeds up application performance

βœ… Answer: A) Attackers can bypass validation by modifying requests
πŸ“Œ Explanation: Client-side validation can be easily bypassed, so it must be reinforced with server-side validation.


82. Which OWASP vulnerability does an attacker exploit when they manipulate JWT (JSON Web Token)?

A) Broken Authentication
B) SQL Injection
C) Insecure Direct Object Reference
D) Buffer Overflow

βœ… Answer: A) Broken Authentication
πŸ“Œ Explanation: Weak JWT implementation can lead to token theft, token forgery, or replay attacks.


83. What is a secure way to store passwords in a database?

A) Hashing with bcrypt, Argon2, or PBKDF2
B) Storing passwords in plaintext
C) Encrypting passwords using symmetric encryption
D) Using base64 encoding

βœ… Answer: A) Hashing with bcrypt, Argon2, or PBKDF2
πŸ“Œ Explanation: Secure password hashing functions make it computationally expensive for attackers to brute-force stolen hashes.


84. What is a major risk of allowing unrestricted file uploads?

A) Attackers can upload malicious scripts for Remote Code Execution
B) It slows down website loading times
C) It improves the user experience
D) It prevents XSS attacks

βœ… Answer: A) Attackers can upload malicious scripts for Remote Code Execution
πŸ“Œ Explanation: Improper file validation may allow attackers to upload and execute malicious files.


85. How does rate limiting help prevent security threats?

A) It restricts the number of requests from a user, preventing brute force and DoS attacks
B) It speeds up API responses
C) It improves encryption strength
D) It allows all users to bypass authentication

βœ… Answer: A) It restricts the number of requests from a user, preventing brute force and DoS attacks
πŸ“Œ Explanation: Rate limiting helps protect against brute force login attempts and denial-of-service attacks.


86. What is a key security concern with public API keys?

A) They can be abused by attackers to access API services without authorization
B) They improve API performance
C) They prevent SQL Injection attacks
D) They increase authentication strength

βœ… Answer: A) They can be abused by attackers to access API services without authorization
πŸ“Œ Explanation: API keys exposed in public repositories or web pages can be used by attackers to access services fraudulently.


87. Which of the following is an effective way to prevent Cross-Site Request Forgery (CSRF) attacks?

A) Using CSRF tokens and the SameSite cookie attribute
B) Allowing CORS for all domains
C) Encrypting URLs
D) Disabling user authentication

βœ… Answer: A) Using CSRF tokens and the SameSite cookie attribute
πŸ“Œ Explanation: CSRF tokens and SameSite attributes ensure that only legitimate requests are processed.


88. How can an attacker exploit an open redirect vulnerability?

A) By redirecting users to malicious websites for phishing attacks
B) By injecting SQL queries
C) By modifying the HTML structure of the page
D) By tampering with user authentication tokens

βœ… Answer: A) By redirecting users to malicious websites for phishing attacks
πŸ“Œ Explanation: Open redirects allow attackers to manipulate URLs and send users to malicious sites.


89. Which method helps protect against Clickjacking attacks?

A) Using the X-Frame-Options HTTP header
B) Implementing weak authentication mechanisms
C) Allowing all JavaScript execution
D) Using symmetric encryption

βœ… Answer: A) Using the X-Frame-Options HTTP header
πŸ“Œ Explanation: The X-Frame-Options header prevents a website from being embedded in an iframe, mitigating Clickjacking risks.


90. What is an example of a business logic vulnerability?

A) Users exploiting the checkout process to get products for free
B) SQL Injection attacks
C) Encrypting sensitive data
D) Implementing strong password policies

βœ… Answer: A) Users exploiting the checkout process to get products for free
πŸ“Œ Explanation: Business logic vulnerabilities allow users to bypass intended application functionality.


91. What is the primary goal of security logging and monitoring?

A) Detect and respond to security incidents in real-time
B) Improve website performance
C) Store user session data
D) Reduce database size

βœ… Answer: A) Detect and respond to security incidents in real-time
πŸ“Œ Explanation: Security logging and monitoring allow organizations to detect and respond to threats quickly.


92. How can attackers exploit weak password policies?

A) By performing brute force and credential stuffing attacks
B) By injecting malicious scripts
C) By tampering with security headers
D) By modifying API responses

βœ… Answer: A) By performing brute force and credential stuffing attacks
πŸ“Œ Explanation: Weak passwords make it easier for attackers to guess or reuse credentials.


93. What is the risk of improper session expiration?

A) Users remain authenticated indefinitely, increasing hijacking risks
B) Increased website performance
C) Improved data encryption
D) Prevents attackers from stealing sessions

βœ… Answer: A) Users remain authenticated indefinitely, increasing hijacking risks
πŸ“Œ Explanation: If sessions do not expire, attackers can reuse old session tokens to gain unauthorized access.


94. Which of the following is NOT an OWASP Top 10 vulnerability?

A) SQL Injection
B) Cross-Site Scripting (XSS)
C) Insecure File Permissions
D) Broken Access Control

βœ… Answer: C) Insecure File Permissions
πŸ“Œ Explanation: While insecure file permissions are a security concern, they are not specifically listed in the OWASP Top 10.


95. What is a major security risk of using HTTP instead of HTTPS?

A) Data transmitted between client and server can be intercepted
B) The website loads faster
C) The website is protected from all attacks
D) Users can bypass login authentication

βœ… Answer: A) Data transmitted between client and server can be intercepted
πŸ“Œ Explanation: HTTPS encrypts data in transit, preventing attackers from capturing sensitive information.


96. What is an effective way to prevent IDOR (Insecure Direct Object Reference) vulnerabilities?

A) Implement proper access controls and validate user permissions
B) Encrypt all database queries
C) Store objects in plaintext
D) Use HTTP instead of HTTPS

βœ… Answer: A) Implement proper access controls and validate user permissions
πŸ“Œ Explanation: IDOR vulnerabilities arise when access controls are weak, allowing unauthorized users to access or modify resources.


97. Why is it dangerous to expose database error messages to users?

A) They can reveal sensitive system information to attackers
B) They improve system performance
C) They prevent SQL Injection attacks
D) They encrypt sensitive data

βœ… Answer: A) They can reveal sensitive system information to attackers
πŸ“Œ Explanation: Detailed error messages can disclose database structures, helping attackers craft more effective attacks.


98. How can attackers exploit Cross-Origin Resource Sharing (CORS) misconfigurations?

A) By accessing sensitive data from different origins without authorization
B) By injecting SQL queries
C) By modifying browser cookies
D) By encrypting API responses

βœ… Answer: A) By accessing sensitive data from different origins without authorization
πŸ“Œ Explanation: Poorly configured CORS settings may allow unauthorized domains to access restricted data.


99. What type of attack involves inserting malicious JSON objects into an API request?

A) Insecure Deserialization
B) Cross-Site Request Forgery (CSRF)
C) Server-Side Request Forgery (SSRF)
D) SQL Injection

βœ… Answer: A) Insecure Deserialization
πŸ“Œ Explanation: Insecure Deserialization allows attackers to send modified serialized objects that can be executed on the server.


100. What is an example of a race condition vulnerability?

A) Two users modifying the same resource simultaneously, causing unexpected behavior
B) An attacker injecting SQL queries into a database
C) A phishing attack targeting employees
D) An API that does not require authentication

βœ… Answer: A) Two users modifying the same resource simultaneously, causing unexpected behavior
πŸ“Œ Explanation: Race conditions occur when multiple processes attempt to modify the same resource simultaneously.


101. Why should developers avoid using default credentials in applications?

A) They are easy for attackers to guess and exploit
B) They improve system performance
C) They prevent brute force attacks
D) They encrypt passwords automatically

βœ… Answer: A) They are easy for attackers to guess and exploit
πŸ“Œ Explanation: Attackers frequently attempt to log in using default credentials, making it a significant security risk.


102. How does HTTP response splitting impact web security?

A) It allows attackers to inject malicious headers into responses
B) It prevents SQL Injection attacks
C) It speeds up website performance
D) It secures API endpoints

βœ… Answer: A) It allows attackers to inject malicious headers into responses
πŸ“Œ Explanation: HTTP response splitting enables header injection, potentially leading to security vulnerabilities.


103. What is an effective way to mitigate security risks from third-party components?

A) Regularly updating dependencies and removing outdated libraries
B) Allowing all third-party code without verification
C) Disabling authentication for external services
D) Storing API keys in plaintext

βœ… Answer: A) Regularly updating dependencies and removing outdated libraries
πŸ“Œ Explanation: Keeping third-party components up to date helps protect against known vulnerabilities.


104. What security measure helps protect against an attacker stealing JWT tokens?

A) Using short token expiration times and secure storage
B) Storing tokens in local storage without encryption
C) Disabling authentication checks
D) Allowing all tokens to remain valid indefinitely

βœ… Answer: A) Using short token expiration times and secure storage
πŸ“Œ Explanation: Expiring tokens quickly and securely storing them reduces the risk of token theft.


105. How can attackers exploit Open Redirect vulnerabilities?

A) By redirecting users to malicious phishing websites
B) By injecting SQL queries
C) By modifying API headers
D) By blocking security logs

βœ… Answer: A) By redirecting users to malicious phishing websites
πŸ“Œ Explanation: Open Redirect vulnerabilities allow attackers to trick users into visiting fake or malicious websites.


106. Which of the following is a strong defense against XSS attacks?

A) Encoding user input and implementing Content Security Policy (CSP)
B) Storing credentials in plaintext
C) Using weak password policies
D) Allowing unrestricted JavaScript execution

βœ… Answer: A) Encoding user input and implementing Content Security Policy (CSP)
πŸ“Œ Explanation: Proper encoding and CSP mitigate XSS risks by restricting script execution.


107. What is an example of business logic abuse?

A) Exploiting coupon codes to get free products repeatedly
B) Using SQL Injection to access user data
C) Redirecting users to phishing websites
D) Injecting malicious JSON into API requests

βœ… Answer: A) Exploiting coupon codes to get free products repeatedly
πŸ“Œ Explanation: Business logic vulnerabilities occur when attackers manipulate application logic to gain unauthorized benefits.


108. What does a Web Application Firewall (WAF) primarily protect against?

A) Web-based attacks like SQL Injection and XSS
B) Physical network intrusions
C) Phishing emails
D) Disk encryption failures

βœ… Answer: A) Web-based attacks like SQL Injection and XSS
πŸ“Œ Explanation: A WAF filters and blocks malicious HTTP traffic targeting web applications.


109. What is a primary risk of unrestricted API access?

A) Unauthorized users can manipulate data and perform privileged actions
B) Improved website performance
C) Faster query execution
D) Secure storage of API keys

βœ… Answer: A) Unauthorized users can manipulate data and perform privileged actions
πŸ“Œ Explanation: Unrestricted API access increases the risk of data leaks and unauthorized modifications.


110. Why is input validation important in web applications?

A) It prevents malicious data from being processed and executed
B) It speeds up website loading times
C) It improves server response rates
D) It allows unrestricted file uploads

βœ… Answer: A) It prevents malicious data from being processed and executed
πŸ“Œ Explanation: Input validation helps prevent various injection attacks by ensuring data integrity.


111. What is the main risk of exposing debug mode in production applications?

A) It may reveal sensitive application details and configurations to attackers
B) It increases application performance
C) It prevents SQL Injection attacks
D) It improves authentication security

βœ… Answer: A) It may reveal sensitive application details and configurations to attackers
πŸ“Œ Explanation: Debug mode can expose stack traces, database queries, and system information that can aid attackers.


112. How can attackers exploit an application that lacks rate limiting?

A) By performing brute force or automated attacks against authentication endpoints
B) By executing encrypted SQL queries
C) By accessing API logs directly
D) By increasing database performance

βœ… Answer: A) By performing brute force or automated attacks against authentication endpoints
πŸ“Œ Explanation: Rate limiting prevents attackers from making excessive requests, reducing brute force and DoS attack risks.


113. What is a key risk of allowing users to upload unvalidated files?

A) Attackers can upload malicious files that execute code on the server
B) It speeds up website loading times
C) It prevents SQL Injection attacks
D) It increases encryption security

βœ… Answer: A) Attackers can upload malicious files that execute code on the server
πŸ“Œ Explanation: Unvalidated file uploads can lead to Remote Code Execution (RCE) and malware infections.


114. What security risk arises when developers fail to rotate encryption keys?

A) Older compromised keys can still decrypt sensitive data
B) It improves encryption strength
C) It speeds up database queries
D) It increases user authentication security

βœ… Answer: A) Older compromised keys can still decrypt sensitive data
πŸ“Œ Explanation: Regularly rotating encryption keys reduces the impact of a compromised key.


115. Why should applications implement session timeouts?

A) To prevent unauthorized access in case a user forgets to log out
B) To make sessions last indefinitely
C) To allow unlimited access to authenticated users
D) To reduce web traffic

βœ… Answer: A) To prevent unauthorized access in case a user forgets to log out
πŸ“Œ Explanation: Expiring inactive sessions helps prevent unauthorized access if an attacker hijacks a session.


116. What is an example of a user enumeration vulnerability?

A) Displaying different error messages for valid and invalid usernames during login
B) Encrypting all user data
C) Using TLS to secure authentication
D) Storing passwords with bcrypt

βœ… Answer: A) Displaying different error messages for valid and invalid usernames during login
πŸ“Œ Explanation: Attackers can determine if an account exists based on different login error messages.


117. What is a common method for preventing API key leaks in public repositories?

A) Storing API keys in environment variables instead of source code
B) Hardcoding API keys in JavaScript files
C) Disabling encryption on API requests
D) Allowing unrestricted API access

βœ… Answer: A) Storing API keys in environment variables instead of source code
πŸ“Œ Explanation: API keys should never be stored in source code; environment variables provide a more secure alternative.


118. How can developers prevent SSRF (Server-Side Request Forgery) attacks?

A) Restricting outgoing requests to trusted domains and validating input
B) Allowing all HTTP methods
C) Using base64 encoding for requests
D) Disabling SSL/TLS

βœ… Answer: A) Restricting outgoing requests to trusted domains and validating input
πŸ“Œ Explanation: SSRF attacks exploit server-side request handling; limiting outgoing requests reduces the risk.


119. What is a major risk of using weak hashing algorithms like MD5 and SHA-1 for password storage?

A) They can be cracked using modern computing power
B) They increase password security
C) They improve website speed
D) They enhance encryption strength

βœ… Answer: A) They can be cracked using modern computing power
πŸ“Œ Explanation: MD5 and SHA-1 are outdated hashing algorithms that can be easily brute-forced.


120. How does an attacker typically exploit an Open Redirect vulnerability?

A) By redirecting users to phishing sites via manipulated URLs
B) By injecting SQL commands into login fields
C) By modifying authentication tokens
D) By encrypting URL parameters

βœ… Answer: A) By redirecting users to phishing sites via manipulated URLs
πŸ“Œ Explanation: Open Redirect vulnerabilities allow attackers to trick users into visiting malicious websites.


121. Why is it important to set the Secure attribute on cookies?

A) It ensures cookies are only transmitted over HTTPS, preventing theft in plaintext HTTP requests
B) It prevents all authentication attacks
C) It speeds up login times
D) It disables cookies in browsers

βœ… Answer: A) It ensures cookies are only transmitted over HTTPS, preventing theft in plaintext HTTP requests
πŸ“Œ Explanation: The Secure attribute ensures cookies are not sent over unencrypted connections.


122. What is the best way to prevent Clickjacking attacks?

A) Implementing the X-Frame-Options header
B) Allowing iframes from all origins
C) Disabling JavaScript
D) Using weak encryption

βœ… Answer: A) Implementing the X-Frame-Options header
πŸ“Œ Explanation: The X-Frame-Options header prevents embedding of a website in an iframe, reducing Clickjacking risks.


123. What is a risk of failing to properly validate JWT tokens?

A) Attackers can forge tokens and gain unauthorized access
B) JWT authentication becomes stronger
C) The application prevents CSRF attacks
D) The user experience is improved

βœ… Answer: A) Attackers can forge tokens and gain unauthorized access
πŸ“Œ Explanation: Weak JWT validation allows attackers to manipulate authentication tokens.


124. Why is it important to implement a strong Content Security Policy (CSP)?

A) It helps prevent Cross-Site Scripting (XSS) by restricting allowed sources of scripts
B) It speeds up website rendering
C) It prevents SQL Injection
D) It improves cookie security

βœ… Answer: A) It helps prevent Cross-Site Scripting (XSS) by restricting allowed sources of scripts
πŸ“Œ Explanation: CSP restricts script execution, reducing the risk of XSS attacks.


125. What is the impact of failing to implement proper error handling?

A) Detailed error messages may reveal sensitive information to attackers
B) Improved application performance
C) Reduced attack surface
D) Enhanced security logs

βœ… Answer: A) Detailed error messages may reveal sensitive information to attackers
πŸ“Œ Explanation: Exposing detailed error messages helps attackers gather intelligence about system configurations.


126. How can security misconfigurations be mitigated?

A) Regularly updating and reviewing security settings
B) Using default passwords
C) Allowing all HTTP methods
D) Keeping debug mode enabled in production

βœ… Answer: A) Regularly updating and reviewing security settings
πŸ“Œ Explanation: Regular audits and security reviews help prevent security misconfigurations.


127. Why is it important to implement principle of least privilege (PoLP)?

A) It reduces the risk of unauthorized access and privilege escalation
B) It improves website loading times
C) It increases API request speeds
D) It allows users to bypass authentication

βœ… Answer: A) It reduces the risk of unauthorized access and privilege escalation
πŸ“Œ Explanation: PoLP limits users to only the permissions they need, reducing the impact of breaches.


128. What is an effective way to secure sensitive API endpoints?

A) Implementing authentication, authorization, and input validation
B) Allowing unrestricted access
C) Hardcoding API keys in JavaScript files
D) Using weak encryption

βœ… Answer: A) Implementing authentication, authorization, and input validation
πŸ“Œ Explanation: Securing APIs requires robust authentication and access control mechanisms.


129. What risk does Cross-Site Scripting (XSS) pose to users?

A) Attackers can execute malicious scripts in a user’s browser
B) Increased website speed
C) Automatic database updates
D) Secure password storage

βœ… Answer: A) Attackers can execute malicious scripts in a user’s browser
πŸ“Œ Explanation: XSS allows attackers to steal data, impersonate users, or manipulate web pages.


130. What is the role of security headers in web applications?

A) They enforce security policies that help prevent attacks like XSS and Clickjacking
B) They speed up database queries
C) They encrypt all user data
D) They improve SEO rankings

βœ… Answer: A) They enforce security policies that help prevent attacks like XSS and Clickjacking
πŸ“Œ Explanation: Security headers protect against various web vulnerabilities by enforcing security measures.


131. What is the primary reason for using parameterized queries in databases?

A) To prevent SQL Injection attacks
B) To speed up query execution
C) To allow users to input raw SQL
D) To store passwords in plaintext

βœ… Answer: A) To prevent SQL Injection attacks
πŸ“Œ Explanation: Parameterized queries prevent SQL Injection by treating user inputs as data rather than executable SQL commands.


132. What is the impact of a successful Server-Side Request Forgery (SSRF) attack?

A) An attacker can force the server to make unauthorized requests
B) The website loads faster
C) The API becomes more efficient
D) All session cookies expire immediately

βœ… Answer: A) An attacker can force the server to make unauthorized requests
πŸ“Œ Explanation: SSRF attacks trick the server into sending requests to internal or external services, potentially exposing sensitive data.


133. How does implementing a WAF (Web Application Firewall) improve security?

A) It filters and blocks malicious web traffic, preventing attacks like SQL Injection and XSS
B) It speeds up website loading times
C) It replaces the need for authentication
D) It automatically encrypts all passwords

βœ… Answer: A) It filters and blocks malicious web traffic, preventing attacks like SQL Injection and XSS
πŸ“Œ Explanation: A WAF inspects HTTP requests and blocks malicious activities targeting web applications.


134. What is the best practice for handling password resets securely?

A) Sending a one-time link to the registered email for resetting passwords
B) Storing previous passwords for easy recovery
C) Allowing users to reset passwords without verification
D) Using the same reset token for all users

βœ… Answer: A) Sending a one-time link to the registered email for resetting passwords
πŸ“Œ Explanation: Secure password reset processes should use temporary, one-time-use tokens sent to verified users.


135. Why is it important to implement logging and monitoring in web applications?

A) To detect and respond to security incidents in real-time
B) To increase website speed
C) To store user preferences
D) To encrypt all API keys

βœ… Answer: A) To detect and respond to security incidents in real-time
πŸ“Œ Explanation: Logging and monitoring allow security teams to identify and mitigate threats as they occur.


136. What does the ‘Secure’ attribute in cookies do?

A) Ensures that cookies are transmitted only over HTTPS
B) Encrypts all cookie data
C) Prevents CSRF attacks
D) Increases website performance

βœ… Answer: A) Ensures that cookies are transmitted only over HTTPS
πŸ“Œ Explanation: The Secure attribute prevents cookies from being sent over unencrypted HTTP connections.


137. How does an attacker exploit a Business Logic Vulnerability?

A) By abusing application workflows to bypass restrictions or gain benefits
B) By modifying HTTP headers
C) By injecting JavaScript into an input field
D) By redirecting users to phishing websites

βœ… Answer: A) By abusing application workflows to bypass restrictions or gain benefits
πŸ“Œ Explanation: Business Logic Vulnerabilities occur when attackers manipulate application processes for unintended outcomes.


138. What is a major risk of exposing API endpoints without authentication?

A) Unauthorized users can access or manipulate sensitive data
B) API response times increase
C) Authentication logs become unreadable
D) The application becomes immune to SQL Injection

βœ… Answer: A) Unauthorized users can access or manipulate sensitive data
πŸ“Œ Explanation: Exposing APIs without authentication allows unauthorized access, leading to data breaches and manipulation.


139. What is a common cause of XML External Entity (XXE) vulnerabilities?

A) Improperly configured XML parsers allowing external entity processing
B) Using JSON instead of XML
C) Encrypting all XML files
D) Disabling all logging

βœ… Answer: A) Improperly configured XML parsers allowing external entity processing
πŸ“Œ Explanation: XXE occurs when an XML parser processes external entities, allowing attackers to read files or perform DoS attacks.


140. How can developers mitigate the risk of CSRF (Cross-Site Request Forgery) attacks?

A) Implementing CSRF tokens and SameSite cookie attributes
B) Encrypting URL parameters
C) Allowing all CORS requests
D) Using JavaScript validation only

βœ… Answer: A) Implementing CSRF tokens and SameSite cookie attributes
πŸ“Œ Explanation: CSRF tokens ensure that only legitimate user requests are processed, preventing unauthorized actions.


141. What is a common impact of an insecure API design?

A) Data exposure and unauthorized API access
B) Increased website speed
C) Enhanced user authentication
D) Faster database queries

βœ… Answer: A) Data exposure and unauthorized API access
πŸ“Œ Explanation: Poorly secured APIs can expose sensitive data and allow unauthorized actions.


142. What does the HTTP header X-XSS-Protection do?

A) Prevents reflected Cross-Site Scripting (XSS) attacks
B) Encrypts all JavaScript on a page
C) Prevents all SQL Injection attacks
D) Increases application performance

βœ… Answer: A) Prevents reflected Cross-Site Scripting (XSS) attacks
πŸ“Œ Explanation: The X-XSS-Protection header blocks XSS attacks by preventing script execution in certain browsers.


143. Why should applications implement strong password policies?

A) To reduce the risk of brute-force and credential stuffing attacks
B) To slow down website performance
C) To increase API response time
D) To prevent SQL Injection

βœ… Answer: A) To reduce the risk of brute-force and credential stuffing attacks
πŸ“Œ Explanation: Strong password policies help protect accounts from unauthorized access.


144. How can developers protect against privilege escalation attacks?

A) Implementing strict access controls and least privilege principles
B) Allowing all users to access administrative features
C) Using weak password policies
D) Disabling logging

βœ… Answer: A) Implementing strict access controls and least privilege principles
πŸ“Œ Explanation: Privilege escalation occurs when users gain higher access than intended; enforcing strict controls prevents this.


145. What is the risk of failing to validate JWT expiration?

A) Attackers can reuse expired tokens to gain access
B) The API response times increase
C) The application prevents SQL Injection
D) The authentication process speeds up

βœ… Answer: A) Attackers can reuse expired tokens to gain access
πŸ“Œ Explanation: JWT expiration validation prevents unauthorized users from reusing old tokens.


146. What security risk arises from using predictable session IDs?

A) Attackers can hijack active sessions by guessing session tokens
B) Users can log in faster
C) API requests are encrypted
D) Authentication logs become unreadable

βœ… Answer: A) Attackers can hijack active sessions by guessing session tokens
πŸ“Œ Explanation: Predictable session IDs make it easier for attackers to perform session hijacking.


147. What is a key benefit of enabling HTTP Strict Transport Security (HSTS)?

A) It enforces HTTPS connections and prevents downgrade attacks
B) It encrypts database queries
C) It speeds up JavaScript execution
D) It prevents SQL Injection

βœ… Answer: A) It enforces HTTPS connections and prevents downgrade attacks
πŸ“Œ Explanation: HSTS ensures that users always connect securely via HTTPS.


148. What does an attacker accomplish by exploiting an insecure deserialization vulnerability?

A) Arbitrary code execution on the server
B) Increased authentication speed
C) Faster database queries
D) Secure cookie storage

βœ… Answer: A) Arbitrary code execution on the server
πŸ“Œ Explanation: Insecure deserialization allows attackers to manipulate serialized objects and execute malicious code.


149. Why is it important to keep software and dependencies updated?

A) To patch known vulnerabilities and security flaws
B) To slow down website performance
C) To allow attackers to find more exploits
D) To prevent debugging

βœ… Answer: A) To patch known vulnerabilities and security flaws
πŸ“Œ Explanation: Regular updates help close security gaps that attackers might exploit.


150. How does enforcing Multi-Factor Authentication (MFA) improve security?

A) It adds an extra layer of protection beyond just passwords
B) It speeds up the login process
C) It prevents SQL Injection
D) It increases session expiration time

βœ… Answer: A) It adds an extra layer of protection beyond just passwords
πŸ“Œ Explanation: MFA makes it harder for attackers to gain unauthorized access, even if they steal credentials.


151. Why is it recommended to use bcrypt, Argon2, or PBKDF2 for password hashing?

A) These algorithms are designed to be slow, making brute-force attacks more difficult
B) They store passwords in plaintext for easy retrieval
C) They do not require salt for hashing
D) They increase website performance

βœ… Answer: A) These algorithms are designed to be slow, making brute-force attacks more difficult
πŸ“Œ Explanation: Slow hashing functions with added computational cost make it harder for attackers to crack passwords.


152. What is a major risk of storing passwords using MD5 hashing?

A) MD5 is weak and can be easily cracked using brute force or rainbow tables
B) It prevents SQL Injection
C) It encrypts passwords securely
D) It reduces database storage requirements

βœ… Answer: A) MD5 is weak and can be easily cracked using brute force or rainbow tables
πŸ“Œ Explanation: MD5 is outdated and should not be used for password hashing due to its vulnerabilities.


153. What is the best way to prevent XML External Entity (XXE) attacks?

A) Disable external entity processing in XML parsers
B) Use plaintext passwords
C) Implement weak authentication policies
D) Encrypt all XML files

βœ… Answer: A) Disable external entity processing in XML parsers
πŸ“Œ Explanation: Disabling external entities prevents attackers from exploiting XXE vulnerabilities.


154. What does the SameSite=Strict attribute in cookies do?

A) It prevents cookies from being sent with cross-site requests
B) It allows all cookies to be shared across different sites
C) It speeds up authentication
D) It disables CSRF tokens

βœ… Answer: A) It prevents cookies from being sent with cross-site requests
πŸ“Œ Explanation: The SameSite=Strict setting helps mitigate CSRF attacks by preventing cookies from being sent in cross-site contexts.


155. What is an example of a broken access control vulnerability?

A) A user modifying a request to access another user’s data
B) Encrypting passwords with bcrypt
C) Using HTTPS for secure connections
D) Enabling CSP security headers

βœ… Answer: A) A user modifying a request to access another user’s data
πŸ“Œ Explanation: Broken Access Control occurs when users can manipulate requests to access unauthorized data.


156. How can developers mitigate the risk of Clickjacking?

A) Implementing the X-Frame-Options HTTP header
B) Allowing all websites to frame their pages
C) Using weak password policies
D) Enabling JavaScript debugging

βœ… Answer: A) Implementing the X-Frame-Options HTTP header
πŸ“Œ Explanation: The X-Frame-Options header prevents web pages from being embedded in iframes, reducing Clickjacking risks.


157. Why should applications avoid using security questions for authentication?

A) Answers to security questions can often be guessed or obtained from social engineering
B) They improve website speed
C) They make authentication faster
D) They encrypt all passwords

βœ… Answer: A) Answers to security questions can often be guessed or obtained from social engineering
πŸ“Œ Explanation: Security questions often have predictable answers that attackers can obtain through research or social engineering.


158. How does a poorly configured CORS (Cross-Origin Resource Sharing) policy pose a security risk?

A) It allows unauthorized third-party websites to access restricted resources
B) It speeds up API responses
C) It prevents SQL Injection
D) It improves user authentication

βœ… Answer: A) It allows unauthorized third-party websites to access restricted resources
πŸ“Œ Explanation: A misconfigured CORS policy can expose sensitive APIs to unauthorized websites.


159. What is a primary goal of implementing Multi-Factor Authentication (MFA)?

A) To provide an additional layer of security beyond just passwords
B) To remove the need for passwords
C) To make authentication slower
D) To prevent DDoS attacks

βœ… Answer: A) To provide an additional layer of security beyond just passwords
πŸ“Œ Explanation: MFA enhances security by requiring additional verification factors, reducing the risk of account compromise.


160. How does improper error handling expose security risks?

A) It reveals sensitive information such as database queries, stack traces, or system paths
B) It speeds up application responses
C) It improves session management
D) It makes debugging easier

βœ… Answer: A) It reveals sensitive information such as database queries, stack traces, or system paths
πŸ“Œ Explanation: Detailed error messages can disclose system details that attackers can use to exploit vulnerabilities.


161. What is the impact of insecure deserialization?

A) It can allow attackers to execute arbitrary code on the server
B) It speeds up authentication
C) It encrypts all passwords
D) It prevents SQL Injection

βœ… Answer: A) It can allow attackers to execute arbitrary code on the server
πŸ“Œ Explanation: Insecure deserialization occurs when untrusted data is processed and executed on the server.


162. What security risk arises from improper session invalidation?

A) Users remain authenticated even after logging out, increasing session hijacking risks
B) It prevents XSS attacks
C) It encrypts API requests
D) It speeds up database queries

βœ… Answer: A) Users remain authenticated even after logging out, increasing session hijacking risks
πŸ“Œ Explanation: Proper session invalidation ensures users are logged out securely, reducing the risk of hijacking.


163. Why is it dangerous to store sensitive data in local storage?

A) Local storage is accessible via JavaScript and can be stolen by XSS attacks
B) It encrypts data securely
C) It prevents unauthorized access
D) It improves authentication security

βœ… Answer: A) Local storage is accessible via JavaScript and can be stolen by XSS attacks
πŸ“Œ Explanation: Data stored in local storage is vulnerable to client-side attacks such as XSS.


164. What does enabling HTTP Strict Transport Security (HSTS) do?

A) Forces all HTTP traffic to be redirected to HTTPS
B) Disables encryption on certain API endpoints
C) Prevents all XSS attacks
D) Increases website speed

βœ… Answer: A) Forces all HTTP traffic to be redirected to HTTPS
πŸ“Œ Explanation: HSTS ensures that all connections are encrypted, preventing downgrade attacks.


165. How can attackers exploit a misconfigured cloud storage bucket?

A) By accessing and downloading sensitive data stored in the cloud
B) By improving website performance
C) By encrypting user authentication logs
D) By preventing XSS attacks

βœ… Answer: A) By accessing and downloading sensitive data stored in the cloud
πŸ“Œ Explanation: Misconfigured cloud storage can expose sensitive data to the public, leading to data breaches.


166. What is a primary method for securing API authentication?

A) Implementing OAuth 2.0, JWTs, or API keys with proper access controls
B) Allowing unauthenticated API access
C) Storing API keys in public repositories
D) Using weak passwords for API authentication

βœ… Answer: A) Implementing OAuth 2.0, JWTs, or API keys with proper access controls
πŸ“Œ Explanation: Secure authentication mechanisms protect API endpoints from unauthorized access.


167. What is a risk of weak session tokens?

A) Attackers can predict or brute-force session tokens to hijack user sessions
B) They improve authentication security
C) They encrypt all user data
D) They increase session expiration time

βœ… Answer: A) Attackers can predict or brute-force session tokens to hijack user sessions
πŸ“Œ Explanation: Secure session tokens should be random, unique, and properly managed.


168. Why should developers avoid using wildcard characters in CORS policies?

A) It allows any origin to access APIs, increasing security risks
B) It speeds up authentication
C) It prevents XSS attacks
D) It improves API security

βœ… Answer: A) It allows any origin to access APIs, increasing security risks
πŸ“Œ Explanation: Wildcard CORS policies (*) expose APIs to unauthorized cross-origin access.


169. How can developers prevent privilege escalation attacks?

A) Implementing strict role-based access controls (RBAC)
B) Allowing all users to have admin privileges
C) Disabling authentication logs
D) Using hardcoded credentials

βœ… Answer: A) Implementing strict role-based access controls (RBAC)
πŸ“Œ Explanation: RBAC ensures that users only have the necessary permissions for their roles.


170. What is an effective way to secure JWT tokens?

A) Using short expiration times and secure storage mechanisms
B) Storing JWTs in local storage
C) Using predictable JWT signatures
D) Allowing expired tokens

βœ… Answer: A) Using short expiration times and secure storage mechanisms
πŸ“Œ Explanation: Securely storing JWTs and enforcing expiration prevents token misuse.


171. What is the impact of failing to set HTTP security headers properly?

A) It exposes web applications to vulnerabilities like XSS, Clickjacking, and data leaks
B) It improves website performance
C) It speeds up database queries
D) It prevents SQL Injection

βœ… Answer: A) It exposes web applications to vulnerabilities like XSS, Clickjacking, and data leaks
πŸ“Œ Explanation: Properly configured security headers help mitigate various web security threats.


172. What does the HttpOnly flag in cookies do?

A) Prevents client-side JavaScript from accessing cookies
B) Encrypts cookies automatically
C) Forces the cookie to expire immediately
D) Prevents all authentication attacks

βœ… Answer: A) Prevents client-side JavaScript from accessing cookies
πŸ“Œ Explanation: The HttpOnly flag helps protect cookies from being stolen via XSS attacks.


173. Why is implementing rate limiting important for authentication endpoints?

A) It helps prevent brute-force and credential stuffing attacks
B) It increases website speed
C) It reduces server logging requirements
D) It allows unlimited login attempts

βœ… Answer: A) It helps prevent brute-force and credential stuffing attacks
πŸ“Œ Explanation: Rate limiting restricts the number of login attempts, making brute-force attacks more difficult.


174. What is a major security concern with public-facing APIs?

A) They can be targeted for unauthorized access, data leaks, and abuse
B) They improve website security
C) They prevent CSRF attacks
D) They always use strong encryption

βœ… Answer: A) They can be targeted for unauthorized access, data leaks, and abuse
πŸ“Œ Explanation: APIs must be properly secured with authentication and access controls to prevent unauthorized access.


175. How can attackers exploit missing or improper authentication in an API?

A) By gaining unauthorized access to sensitive data and system functions
B) By increasing website performance
C) By encrypting API responses
D) By blocking SQL Injection

βœ… Answer: A) By gaining unauthorized access to sensitive data and system functions
πŸ“Œ Explanation: Weak API authentication allows attackers to perform unauthorized actions or access sensitive data.


176. What is a primary reason for using HTTPS instead of HTTP?

A) It encrypts data in transit, preventing eavesdropping and MITM attacks
B) It speeds up authentication
C) It prevents all hacking attempts
D) It allows websites to store passwords in plaintext

βœ… Answer: A) It encrypts data in transit, preventing eavesdropping and MITM attacks
πŸ“Œ Explanation: HTTPS ensures secure communication between users and servers.


177. What security measure helps prevent IDOR (Insecure Direct Object Reference) vulnerabilities?

A) Implementing proper authorization and access controls
B) Storing user data in plaintext
C) Allowing unrestricted user input
D) Using weak password policies

βœ… Answer: A) Implementing proper authorization and access controls
πŸ“Œ Explanation: IDOR occurs when users can directly access unauthorized objects by modifying request parameters.


178. How does an attacker exploit a poorly configured Cross-Origin Resource Sharing (CORS) policy?

A) By making unauthorized API requests from a malicious website
B) By injecting SQL queries
C) By modifying browser session cookies
D) By performing privilege escalation

βœ… Answer: A) By making unauthorized API requests from a malicious website
πŸ“Œ Explanation: A weak CORS policy allows malicious websites to interact with an application’s API.


179. What is a key risk of allowing unvalidated redirects and forwards?

A) Attackers can redirect users to phishing or malicious websites
B) It increases website performance
C) It prevents SQL Injection
D) It improves user authentication

βœ… Answer: A) Attackers can redirect users to phishing or malicious websites
πŸ“Œ Explanation: Open redirects allow attackers to manipulate URLs and send users to harmful destinations.


180. Why should developers avoid hardcoding credentials in source code?

A) Hardcoded credentials can be easily extracted and used by attackers
B) They improve API authentication
C) They prevent SQL Injection
D) They increase website performance

βœ… Answer: A) Hardcoded credentials can be easily extracted and used by attackers
πŸ“Œ Explanation: Hardcoded credentials in code repositories expose sensitive access keys to attackers.


181. What is a common technique for preventing brute force attacks on user accounts?

A) Implementing account lockout after multiple failed login attempts
B) Allowing unlimited login attempts
C) Using weak passwords
D) Storing user credentials in plaintext

βœ… Answer: A) Implementing account lockout after multiple failed login attempts
πŸ“Œ Explanation: Locking accounts after repeated failed attempts reduces the effectiveness of brute-force attacks.


182. Why is it important to use input validation in web applications?

A) It helps prevent injection attacks such as SQL Injection and XSS
B) It speeds up database queries
C) It allows all user input to be processed without filtering
D) It disables security logs

βœ… Answer: A) It helps prevent injection attacks such as SQL Injection and XSS
πŸ“Œ Explanation: Input validation ensures that user data does not contain malicious code.


183. What security risk arises from using outdated software and libraries?

A) Attackers can exploit known vulnerabilities to gain access
B) It improves website performance
C) It increases website security
D) It prevents SQL Injection

βœ… Answer: A) Attackers can exploit known vulnerabilities to gain access
πŸ“Œ Explanation: Outdated software often contains unpatched security flaws that attackers can exploit.


184. What type of attack is prevented by the X-Frame-Options: DENY header?

A) Clickjacking
B) SQL Injection
C) Server-Side Request Forgery (SSRF)
D) Broken Authentication

βœ… Answer: A) Clickjacking
πŸ“Œ Explanation: The X-Frame-Options: DENY header prevents a page from being embedded in an iframe, mitigating Clickjacking attacks.


185. How does the use of CAPTCHA improve security?

A) It helps prevent automated bot attacks and credential stuffing
B) It speeds up authentication
C) It encrypts database queries
D) It prevents SQL Injection

βœ… Answer: A) It helps prevent automated bot attacks and credential stuffing
πŸ“Œ Explanation: CAPTCHA challenges block automated scripts from performing malicious actions.


186. What is the primary risk of using predictable session IDs?

A) Attackers can hijack user sessions by guessing or brute-forcing session tokens
B) It prevents CSRF attacks
C) It speeds up API responses
D) It improves authentication security

βœ… Answer: A) Attackers can hijack user sessions by guessing or brute-forcing session tokens
πŸ“Œ Explanation: Session hijacking occurs when attackers gain unauthorized access to user sessions.


187. Why should developers use prepared statements for database queries?

A) To prevent SQL Injection attacks by separating SQL logic from user input
B) To make queries execute faster
C) To allow dynamic SQL injection
D) To improve database indexing

βœ… Answer: A) To prevent SQL Injection attacks by separating SQL logic from user input
πŸ“Œ Explanation: Prepared statements prevent attackers from injecting malicious SQL commands.


188. What is an example of an authentication bypass vulnerability?

A) Allowing users to access restricted resources without verifying credentials
B) Using strong password policies
C) Implementing two-factor authentication
D) Encrypting all API requests

βœ… Answer: A) Allowing users to access restricted resources without verifying credentials
πŸ“Œ Explanation: Authentication bypass vulnerabilities allow attackers to access protected resources without logging in.


189. What is the impact of not implementing proper session expiration?

A) Attackers can reuse session tokens to gain unauthorized access
B) It prevents SQL Injection
C) It increases API response times
D) It improves user authentication

βœ… Answer: A) Attackers can reuse session tokens to gain unauthorized access
πŸ“Œ Explanation: Expired sessions should be invalidated to prevent unauthorized access.


190. What is the best way to secure API authentication?

A) Using OAuth, API keys, and token-based authentication with proper access controls
B) Allowing public access to all APIs
C) Using hardcoded credentials
D) Encrypting API responses only

βœ… Answer: A) Using OAuth, API keys, and token-based authentication with proper access controls
πŸ“Œ Explanation: Secure authentication methods prevent unauthorized access to API endpoints.


191. What is the primary security risk of using default credentials in applications?

A) Attackers can easily gain unauthorized access using commonly known default credentials
B) It speeds up authentication
C) It improves application security
D) It prevents brute force attacks

βœ… Answer: A) Attackers can easily gain unauthorized access using commonly known default credentials
πŸ“Œ Explanation: Default credentials are widely known and can be exploited in brute force attacks or unauthorized access attempts.


192. What is the best way to prevent privilege escalation attacks?

A) Implementing the principle of least privilege and strict access controls
B) Allowing all users administrative privileges
C) Disabling authentication logs
D) Using hardcoded credentials

βœ… Answer: A) Implementing the principle of least privilege and strict access controls
πŸ“Œ Explanation: Restricting user privileges ensures that even if an attacker gains access, they cannot escalate their permissions easily.


193. What does the Secure attribute in cookies do?

A) Ensures cookies are only transmitted over HTTPS connections
B) Encrypts cookies by default
C) Prevents all CSRF attacks
D) Allows cookies to be accessed by JavaScript

βœ… Answer: A) Ensures cookies are only transmitted over HTTPS connections
πŸ“Œ Explanation: The Secure flag ensures that cookies are not sent over insecure HTTP connections, reducing the risk of interception.


194. What is the risk of storing JWT tokens in local storage?

A) They can be accessed by JavaScript and stolen via XSS attacks
B) They are more secure than session cookies
C) They improve authentication speed
D) They prevent brute force attacks

βœ… Answer: A) They can be accessed by JavaScript and stolen via XSS attacks
πŸ“Œ Explanation: Local storage is accessible by JavaScript, making JWT tokens vulnerable to theft if an XSS attack occurs.


195. Why should security patches and updates be applied regularly?

A) To fix known vulnerabilities and protect against new security threats
B) To increase website speed
C) To improve database indexing
D) To reduce CPU usage

βœ… Answer: A) To fix known vulnerabilities and protect against new security threats
πŸ“Œ Explanation: Regular updates patch security vulnerabilities that attackers could exploit.


196. How can developers mitigate the risk of open redirect vulnerabilities?

A) Validate and restrict user-supplied redirect URLs
B) Allow users to input any URL
C) Disable all redirects
D) Encrypt URL parameters

βœ… Answer: A) Validate and restrict user-supplied redirect URLs
πŸ“Œ Explanation: Open redirects allow attackers to redirect users to malicious websites; proper validation prevents this.


197. What is a common impact of a successful Cross-Site Scripting (XSS) attack?

A) An attacker can steal cookies, session tokens, or perform unauthorized actions on behalf of the user
B) The website loads faster
C) The database performance improves
D) Users are logged out automatically

βœ… Answer: A) An attacker can steal cookies, session tokens, or perform unauthorized actions on behalf of the user
πŸ“Œ Explanation: XSS attacks allow attackers to execute scripts in the victim’s browser, leading to data theft or account hijacking.


198. What is a major risk of not logging and monitoring security events?

A) Attacks and breaches can go undetected for long periods
B) It speeds up application performance
C) It prevents SQL Injection
D) It encrypts all network traffic

βœ… Answer: A) Attacks and breaches can go undetected for long periods
πŸ“Œ Explanation: Without proper logging and monitoring, security incidents may not be detected or mitigated in time.


199. Why is it important to implement proper session expiration?

A) It reduces the risk of session hijacking by limiting the lifetime of a session
B) It improves login speed
C) It prevents SQL Injection
D) It encrypts session cookies automatically

βœ… Answer: A) It reduces the risk of session hijacking by limiting the lifetime of a session
πŸ“Œ Explanation: Expiring sessions properly ensures that even if an attacker steals a session token, it cannot be used indefinitely.


200. What is an effective way to prevent sensitive data exposure?

A) Encrypting sensitive data in transit and at rest
B) Storing all data in plaintext
C) Using HTTP instead of HTTPS
D) Allowing unrestricted access to sensitive files

βœ… Answer: A) Encrypting sensitive data in transit and at rest
πŸ“Œ Explanation: Encrypting data ensures that even if it is intercepted or stolen, it remains unreadable to attackers.