The API tester prints raw exception text to anyone who opens the page #68
Loading…
Reference in a new issue
No description provided.
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?
Problem
When the API docs tester's lookup raises, the public page renders
Request error:followed byinspect/1of the exception. For Postgrex and Ecto errors that inspect carries the SQL statement, the query struct, module names and file paths, on an unauthenticated page. Every other read path in the app collapses an unknown failure to a generic error.Evidence
At
2f150f66:lib/aprsme_web/live/api_docs_live.ex:172builds{:error, "Request error: #{inspect(error)}"}in the rescue clause.lib/aprsme_web/live/api_docs_live.ex:963renders{@error}to any visitor.lib/aprsme/error_handler.ex:209shows the{:error, :unknown_error}shape used elsewhere.Expected
A generic failure message on the page and the detail in the log.
How to verify
In a LiveView test, stub
Packets.get_recent_packets/1to raise%Ecto.QueryError{}, submit a callsign, and assert the rendered text contains no module name or SQL fragment.Acceptance criteria
Effort: S
Lens: security