SECURITY: Error messages from Go errors displayed unescaped could leak internals #41
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: MEDIUM
File:
internal/handlers/app.goline 73Description
The raw Go error message (which may contain internal details like file paths, SQL errors, or stack traces) is passed directly to the template. While Go's
html/templateauto-escapes HTML, this is still an information disclosure issue — internal error details should never be shown to users.This pattern appears in
HandleAppCreatebut not in other handlers (which correctly use generic messages like "Failed to create user").Suggested Fix
Use a generic error message for the user and log the detailed error server-side: