Examers.io
ExamsOrganizationsHow it worksPricingHelp & FAQ
EC-Council logo

EC-CouncilCertified Application Security Engineer (.NET)

Domain 7Objective 1

Secure Exception Handling CASENET Practice Questions (Page 5)

Part of the Secure Coding: Error Handling and Logging domain, which makes up ~12% of our current practice bank. EC-Council does not publish an official question count, but from its 120-minute exam (~50–80 total, ~6–10 in this domain), expect 2–3 from this objective — we provide 45 practice questions to prepare you well beyond it. (estimate)

45questions here
9free pages
8concepts

Questions 21–25

  1. 21application · medium

    A developer is writing a method that parses user input into an integer. The method currently catches all exceptions with a single catch block and returns a default value. A security reviewer notes that this hides critical errors such as OutOfMemoryException. What is the recommended way to handle this in .NET?

    Select an answer first
  2. 22application · medium

    A developer is writing a file download feature in ASP.NET. The code uses File.ReadAllBytes and catches Exception to display a friendly message. A security reviewer points out that catching Exception also catches UnauthorizedAccessException and OutOfMemoryException, which should not be handled the same way. What is the recommended change?

    Select an answer first
  3. 23application · medium

    A .NET application logs exceptions using a third-party logging library. The security review found that exception messages sometimes contain the user's password because it is included in a custom exception's Data dictionary. You need to ensure that sensitive data is never written to the log while still capturing enough detail to diagnose issues. What is the most effective approach?

    Select an answer first
  4. 24foundation · easy

    Which of the following is a risk of exposing sensitive information in error messages?

    Select an answer first
  5. 25expert · medium

    A .NET application has a method that performs multiple operations: it reads a file, parses its content, and writes to a database. The method currently uses a single try-catch block that catches Exception, logs it, and returns a generic error. The team wants to improve the error handling so that different failure types are handled appropriately: file access errors should be logged and retried, parsing errors should be logged and reported to the user, and database errors should be logged and an alert sent to operations. What is the best way to structure the exception handling?

    Select an answer first
Finished these 5 questions?

Review the revealed explanations, or continue through the curriculum.

Free Basic Practice is a study aid with revealable answers — not a scored exam. Examers.io is independent and not affiliated with or endorsed by EC-Council. “CASENET” is a trademark of its owner, used for identification only.