Skip to content

security: Internal error details exposed to API clients #58

@nfebe

Description

@nfebe

Problem

Multiple API endpoints return raw err.Error() in JSON responses:

c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})

Found at lines ~903, 918, 923, 1500, 2028, and many others in internal/api/server.go.

This leaks internal paths, database structures, Docker error details, and system information to any API caller.

Impact

Information disclosure that aids attackers in mapping the system internals.

Proposed Fix

  • Log detailed errors server-side with a correlation ID
  • Return generic error messages to clients: {"error": "internal error", "id": "abc123"}
  • Create an error mapping layer that translates known errors to safe user-facing messages

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions