nerdexam
CompTIA

SY0-501 · Question #420

Upon entering an incorrect password, the logon screen displays a message informing the user that the password does not match the username provided and is not the required length of 12 characters…

The correct answer is B. Error handling. The application's detailed error message, revealing password length and username validity, provides too much information to potential attackers. This practice violates secure coding principles related to error handling.

Submitted by jakub_pl· Mar 4, 2026Threats, vulnerabilities, and mitigations

Question

Upon entering an incorrect password, the logon screen displays a message informing the user that the password does not match the username provided and is not the required length of 12 characters. Which of the following secure coding techniques should a security analyst address with the application developers to follow security best practices?

Options

  • AInput validation
  • BError handling
  • CObfuscation
  • DData exposure

How the community answered

(40 responses)
  • A
    15% (6)
  • B
    73% (29)
  • C
    8% (3)
  • D
    5% (2)

Why each option

The application's detailed error message, revealing password length and username validity, provides too much information to potential attackers. This practice violates secure coding principles related to error handling.

AInput validation

Input validation involves checking user input against defined criteria before processing it, but the problem described is how the *error message* publicly discloses details about the validation failure, not the act of validation itself.

BError handlingCorrect

Secure error handling mandates that error messages should be generic and avoid revealing specific details that could assist an attacker, such as password length requirements or whether a username is valid. The given error message provides granular feedback that an attacker could use to deduce account policies or system vulnerabilities, which is a critical secure error handling failure.

CObfuscation

Obfuscation is the technique of making code or data difficult to understand or reverse-engineer, typically for intellectual property protection or to hinder malware analysis, and is unrelated to the content of user-facing error messages.

DData exposure

While the detailed error message *causes* data exposure, 'error handling' is the specific secure coding technique that dictates how errors should be reported to prevent such sensitive information disclosure.

Concept tested: Secure error handling practices

Source: https://cheatsheetseries.owasp.org/cheatsheets/Error_Handling_Cheat_Sheet.html

Topics

#error handling#information disclosure#secure coding#verbose errors

Community Discussion

No community discussion yet for this question.

Full SY0-501 Practice