nerdexam
CompTIA

CAS-002 · Question #576

A web administrator develops a web form for users to respond to the company via a web page. Which of the following should be practiced to avoid a security risk?

The correct answer is D. Input validation. Input validation is the security practice that should be implemented on web forms to prevent attackers from injecting malicious data that could lead to SQL injection, XSS, or other attacks.

Enterprise Security

Question

A web administrator develops a web form for users to respond to the company via a web page. Which of the following should be practiced to avoid a security risk?

Options

  • ASQL injection
  • BXSS scripting
  • CClick jacking
  • DInput validation

How the community answered

(24 responses)
  • B
    4% (1)
  • C
    8% (2)
  • D
    88% (21)

Why each option

Input validation is the security practice that should be implemented on web forms to prevent attackers from injecting malicious data that could lead to SQL injection, XSS, or other attacks.

ASQL injection

SQL injection is an attack technique and vulnerability class, not a security practice - it describes what the developer should protect against, not what should be implemented.

BXSS scripting

XSS (cross-site scripting) is also an attack category and vulnerability, not a defensive practice that can be implemented on a web form.

CClick jacking

Clickjacking is a UI redress attack technique, not a security control or practice that a web form developer would implement.

DInput validationCorrect

Input validation ensures that data submitted through web forms is checked for type, length, format, and range before being processed or stored. By sanitizing and validating all user-supplied input, the developer removes the attack surface for injection-based vulnerabilities such as SQL injection and cross-site scripting at the source.

Concept tested: Input validation to prevent web application injection attacks

Source: https://owasp.org/www-project-proactive-controls/v3/en/c5-validate-inputs

Topics

#input validation#web security#XSS#SQL injection

Community Discussion

No community discussion yet for this question.

Full CAS-002 Practice