JAVA-026 / Beginner
Spring Boot default error page and information disclosure (/error details)
Why is this a problem?
Exception class names and paths appear in responses and provide clues for attackers.
How to fix it
java
@ExceptionHandler(Exception.class)
public ResponseEntity<ErrorDto> handle(Exception e) {
log.error("unhandled", e); // Server logs only
return ResponseEntity.status(500).body(new ErrorDto("INTERNAL_ERROR"));
}