Stack Trace Exposure (ARCH8127)
Ce contenu n’est pas encore disponible dans votre langue.
Key kotlin.security.stack-trace-exposure · Severity warning · Category security · CWE CWE-209
Flags exception messages or stack traces written into an HTTP response body.
Incorrect
Section titled “Incorrect”call.respond(HttpStatusCode.InternalServerError, e.stackTraceToString())Correct
Section titled “Correct”logger.error("request failed", e)call.respond(HttpStatusCode.InternalServerError, ErrorDto("internal_error"))Log the exception; answer with a generic message and a correlation id.