nerdexam
CompTIA

PT0-001 · Question #15

A penetration tester was able to enter an SQL injection command into a text box and gain access to the information store on the database. Which of the following is the BEST recommendation that would…

The correct answer is D. Perform system hardening. System hardening is the best remediation for SQL injection because it addresses the vulnerability at multiple layers including database configuration, account privileges, and secure coding practices.

Attacks and exploits

Question

A penetration tester was able to enter an SQL injection command into a text box and gain access to the information store on the database. Which of the following is the BEST recommendation that would mitigate the vulnerability?

Options

  • ARandomize the credentials used to log in.
  • BInstall host-based intrusion detection.
  • CImplement input normalization.
  • DPerform system hardening.

How the community answered

(47 responses)
  • A
    11% (5)
  • B
    2% (1)
  • C
    4% (2)
  • D
    83% (39)

Why each option

System hardening is the best remediation for SQL injection because it addresses the vulnerability at multiple layers including database configuration, account privileges, and secure coding practices.

ARandomize the credentials used to log in.

Randomizing login credentials limits credential reuse attacks but does not prevent an attacker from submitting malicious SQL through the vulnerable input field.

BInstall host-based intrusion detection.

A host-based intrusion detection system can generate alerts on suspicious query patterns but does not sanitize input or enforce parameterized queries to stop the injection itself.

CImplement input normalization.

Input normalization standardizes encoding formats such as Unicode but does not separate SQL code from user-supplied data, which is what parameterized queries accomplish to prevent injection.

DPerform system hardening.Correct

System hardening encompasses enforcing parameterized queries, applying the principle of least privilege to database accounts, disabling dangerous built-in stored procedures, and patching the underlying OS and database engine - all of which collectively eliminate the conditions that make SQL injection exploitation possible. This multi-layer approach reduces both the probability of a successful injection and the potential damage if one occurs. It is more comprehensive than any single control because it hardens the application, database, and host simultaneously.

Concept tested: SQL injection remediation through comprehensive system hardening

Source: https://owasp.org/www-community/attacks/SQL_Injection

Topics

#SQL injection#web application security#input validation#remediation

Community Discussion

No community discussion yet for this question.

Full PT0-001 Practice