What is the primary challenge in mitigating DOM-based XSS attacks?

  • Identifying and validating user input.
  • Recognizing and neutralizing malicious scripts in the client's browser.
  • Restricting the usage of third-party libraries.
  • Sanitizing output on the server side.
The primary challenge in mitigating DOM-based XSS attacks lies in recognizing and neutralizing malicious scripts in the client's browser. Unlike traditional server-side XSS, where the server can sanitize input and output, DOM-based XSS involves scripts executing on the client side, making it crucial to detect and eliminate threats within the user's browser environment.

A common method to secure file uploads is to validate the file's ________ and size.

  • Extension
  • Hash
  • Permissions
  • Signature
Validating the file's extension and size is a common practice to enhance security during file uploads. This prevents malicious files and ensures that the file adheres to acceptable size limits.

To secure email transmissions, applications often use ________ over SMTP.

  • HTTPS
  • OAuth
  • SSL
  • TLS
Transport Layer Security (TLS) is commonly used to secure email transmissions over SMTP (Simple Mail Transfer Protocol). TLS encrypts the data during transmission, providing a secure communication channel.

The ________ attribute in HTML5 is used to ensure that a field is not left empty.

  • Mandatory
  • NotEmpty
  • Required
  • Validate
The "required" attribute in HTML5 is used to specify that a field must be filled out before submitting the form, helping ensure essential information is provided.

How does server-side validation differ from client-side validation in the context of file uploads?

  • Client-side validation is less secure than server-side validation.
  • Client-side validation is performed on the client's browser before the file is uploaded.
  • Server-side validation is not applicable to file uploads.
  • Server-side validation is performed on the server after the file is uploaded.
Server-side validation is crucial for security as it ensures that uploaded files meet specific criteria, such as file type and size, preventing malicious uploads. Client-side validation can be bypassed, making server-side validation essential for robust security.

In CodeIgniter, the method ________ is used to set custom error and exception handlers.

  • error_handler
  • exception_handler
  • set_error_handler
  • set_exception_handler
In CodeIgniter, the set_exception_handler method is used to set a custom handler for uncaught exceptions. This allows you to define your own logic for handling exceptions in your CodeIgniter application, providing more control over error management.

Which HTTP method is commonly used for sending data during the OAuth authentication process?

  • DELETE
  • GET
  • POST
  • PUT
The HTTP POST method is commonly used for sending data during the OAuth authentication process. This method allows secure transmission of sensitive information, such as access tokens, in the request body.

What is the primary function of a payment gateway in an online shopping platform?

  • Designs website layout
  • Facilitates secure online transactions
  • Manages inventory
  • Provides customer support
A payment gateway is a crucial component that facilitates secure online transactions by encrypting sensitive information such as credit card numbers, ensuring the confidentiality and integrity of the payment process. It acts as a bridge between the merchant's website and the financial institutions involved in the transaction.

What is the role of 'Entity' classes in the latest versions of CodeIgniter for working with Models?

  • Defining table schemas
  • Handling HTTP requests and responses
  • Managing database connections
  • Representing individual database rows as objects
In the latest versions of CodeIgniter, 'Entity' classes play a crucial role in representing individual database rows as objects. These classes encapsulate the properties and behavior of database records, making it convenient to work with data on an object-oriented level. This enhances code organization and readability, especially when dealing with complex data structures.

How do parameterized queries help in preventing SQL injection?

  • They concatenate user inputs directly into SQL statements
  • They encrypt the entire SQL query
  • They store user inputs in cookies for security
  • They use placeholders for user inputs, ensuring proper escaping
Parameterized queries help prevent SQL injection by using placeholders for user inputs, which are later replaced with sanitized values. This ensures that user inputs do not directly influence the structure of the SQL query, preventing injection attacks.