Ir al contenido

Stack trace exposure (ARCH4127)

Esta página aún no está disponible en tu idioma.

Key java.security.stack-trace-exposure · Severity warning · Category security · CWE CWE-209

Writing exception details or stack traces to the HTTP response exposes internal implementation details such as class names, file paths, and library versions to attackers.

} catch (Exception e) {
response.getWriter().write(e.toString());
e.printStackTrace(response.getWriter());
}
} catch (Exception e) {
log.error("Request failed", e);
response.setStatus(500);
response.getWriter().write("An unexpected error occurred.");
}

Log the exception server-side and return only a generic error message to the client.