nerdexam
CompTIA

CS0-003 · Question #134

During the security assessment of a new application, a tester attempts to log in to the application but receives the following message incorrect password for given username. Which of the following can

The correct answer is C. Recognize that error messaging does not provide confirmation of the correct element of. The recommendation aims to prevent attackers from using error messages to enumerate valid usernames or determine if a username exists, which is achieved by providing generic error messages.

Submitted by paula_co· Mar 6, 2026Vulnerability Management

Question

During the security assessment of a new application, a tester attempts to log in to the application but receives the following message incorrect password for given username. Which of the following can the tester recommend to decrease the likelihood that a malicious attacker will receive helpful information?

Options

  • ASet the web page to redirect to an application support page when a bad password is entered.
  • BDisable error messaging for authentication
  • CRecognize that error messaging does not provide confirmation of the correct element of
  • DAvoid using password-based authentication for the application

How the community answered

(24 responses)
  • A
    4% (1)
  • B
    8% (2)
  • C
    83% (20)
  • D
    4% (1)

Why each option

The recommendation aims to prevent attackers from using error messages to enumerate valid usernames or determine if a username exists, which is achieved by providing generic error messages.

ASet the web page to redirect to an application support page when a bad password is entered.

Redirecting to a support page upon incorrect password entry still implies that the username was recognized, potentially aiding username enumeration.

BDisable error messaging for authentication

Completely disabling error messaging for authentication would provide a poor user experience as legitimate users would not know why their login failed.

CRecognize that error messaging does not provide confirmation of the correct element ofCorrect

The error message "incorrect password for given username" tells an attacker that the username is valid, confirming its existence. A better practice is to use generic error messages, such as "Invalid username or password," which do not reveal which part of the authentication attempt was incorrect, thereby preventing username enumeration and providing less helpful information to an attacker.

DAvoid using password-based authentication for the application

While multi-factor authentication or other advanced methods are stronger, eliminating password-based authentication entirely might not be feasible or desirable for all applications, and the question specifically addresses improving the existing error messaging.

Concept tested: Secure authentication error handling

Source: https://learn.microsoft.com/en-us/azure/active-directory/authentication/concept-password-less-authentication-security

Topics

#secure coding practices#authentication errors#information leakage#application security

Community Discussion

No community discussion yet for this question.

Full CS0-003 Practice