Skip to content

[bug] API error responses expose stack traces in production #274

Description

@R-udren

bug description:
The Cap standalone server currently exposes stack traces in API error responses, which reveals internal implementation details to end users.

affects:

  • js server

to reproduce:

  • Deploy the Cap standalone server using the Docker image tiago2/cap:latest from the docs https://trycap.dev/guide/#_1-run-the-server
  • Make a request to a non-existent endpoint (e.g., GET /test)
  • Observe the error response contains a full stack trace

Example:

{
  "success": false,
  "error": "NOT_FOUND",
  "detail": {
    "name": "Error",
    "message": "NOT_FOUND",
    "stack": "Error\n    at anonymous (file:///usr/src/app/node_modules/elysia/dist/compose.mjs:12:33)\n    at composeGeneralHandler (/usr/src/app/node_modules/elysia/dist/compose.mjs:1187:3)\n    at compile (/usr/src/app/node_modules/elysia/dist/index.mjs:1878:119)\n    at \u003Canonymous\u003E (/usr/src/app/node_modules/elysia/dist/adapter/bun/index.mjs:201:29)\n    at processTicksAndRejections (unknown:7:39)",
    "code": "NOT_FOUND"
  }
}

expected behavior:
Deployment by following docs guide does not include stack trace in details.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions