Looking for the vulnerability index of Invicti's legacy products?
Stack Trace Disclosure (Apache MyFaces) - Vulnerability Database

Stack Trace Disclosure (Apache MyFaces)

Description

The application exposes detailed stack traces from Apache MyFaces framework errors to end users. When exceptions occur, the application returns verbose error messages containing internal implementation details such as file system paths, code structure, framework versions, method names, and line numbers. This information disclosure vulnerability occurs when error handling mechanisms fail to sanitize exception details before displaying them to users.

Remediation

Implement proper exception handling to prevent stack traces from being displayed to end users:

1. Configure custom error pages:
In your web.xml, define error page mappings to display user-friendly error messages:

<error-page>
  <exception-type>java.lang.Exception</exception-type>
  <location>/error.jsp</location>
</error-page>
<error-page>
  <error-code>500</error-code>
  <location>/error.jsp</location>
</error-page>

2. Disable development mode in production:
Ensure MyFaces is configured for production by setting the following context parameter in web.xml:
<context-param>
  <param-name>org.apache.myfaces.PROJECT_STAGE</param-name>
  <param-value>Production</param-value>
</context-param>

3. Implement centralized exception handling:
Log detailed error information server-side for debugging purposes while displaying generic messages to users:
try {
  // Application logic
} catch (Exception e) {
  logger.error("Error processing request", e);
  return "error"; // Navigate to error page
}

4. Review and test:
Verify that stack traces are not exposed by testing error conditions in a staging environment that mirrors production configuration.

Related Vulnerabilities