main · last commit
13 days ago ·
7g0stsfu
ah-46h httpapi: the tools 500 path echoes err.Error() into the response body
Lined Up
bd update ah-46h --claim
bd close ah-46h
| Created by | Eugene Blikh |
| Owner | bigbes@gmail.com |
| Created | 2026-08-05T00:10:04Z |
| Updated | 2026-08-05T00:10:04Z |
Found while refreshing SPEC §15 (ah-e5l). internal/httpapi/tools.go:178 does writeToolErr(w, http.StatusInternalServerError, err.Error(), nil), unlike the 401/400 paths in the same file, which use constant strings precisely so the response echoes nothing back to the caller. Not a token leak today: the errors it can carry are Vikunja/store wraps that include method + path but no credential. It is still the one place the tools API returns internal detail to a caller that is, by design, an LLM running attacker-influenced content — and it is inconsistent with the constant-body discipline the same file applies to auth failures, which SPEC §15 now documents as the rule. Fix: log the real error at the daemon (where the operator can see it) and return a constant 500 body.
No /api/tool/* response body contains a wrapped internal error. The detail is logged instead, and a test asserts the 500 body is the constant.
No outgoing dependencies.
Nothing depends on this issue.
| id | ah-46h |
| content_hash | df6063b052e63e08cf5bf8e437f4ed6ee2b8e6f2e100d61d9f0b3cfda85ddd9b |
| title | httpapi: the tools 500 path echoes err.Error() into the response body |
| description | Found while refreshing SPEC §15 (ah-e5l). internal/httpapi/tools.go:178 does writeToolErr(w, http.StatusInternalServerError, err.Error(), nil), unlike the 401/400 paths in the same file, which use constant strings precisely so the response echoes nothing back to the caller. Not a token leak today: the errors it can carry are Vikunja/store wraps that include method + path but no credential. It is still the one place the tools API returns internal detail to a caller that is, by design, an LLM running attacker-influenced content — and it is inconsistent with the constant-body discipline the same file applies to auth failures, which SPEC §15 now documents as the rule. Fix: log the real error at the daemon (where the operator can see it) and return a constant 500 body. |
| design | |
| acceptance_criteria | No /api/tool/* response body contains a wrapped internal error. The detail is logged instead, and a test asserts the 500 body is the constant. |
| notes | |
| status | open |
| priority | 4 |
| issue_type | chore |
| assignee | NULL |
| estimated_minutes | NULL |
| created_at | 2026-08-05T00:10:04Z |
| created_by | Eugene Blikh |
| owner | bigbes@gmail.com |
| updated_at | 2026-08-05T00:10:04Z |
| closed_at | NULL |
| closed_by_session | |
| external_ref | NULL |
| spec_id | |
| compaction_level | 0 |
| compacted_at | NULL |
| compacted_at_commit | NULL |
| original_size | NULL |
| sender | |
| ephemeral | 0 |
| wisp_type | |
| pinned | 0 |
| is_template | 0 |
| mol_type | |
| work_type | |
| source_system | |
| metadata | �{} |
| source_repo | |
| close_reason | |
| event_kind | |
| actor | |
| target | |
| payload | |
| await_type | |
| await_id | |
| timeout_ns | 0 |
| waiters | |
| hook_bead | |
| role_bead | |
| agent_state | |
| last_activity | NULL |
| role_type | |
| rig | |
| due_at | NULL |
| defer_until | NULL |
| no_history | 0 |
| started_at | NULL |
| is_blocked | 0 |
| issue_id | ah-46h |
| label | milestone:v0.2.0 |
| id | 019fcf41-80c2-7524-b16e-8e3d0a992550 |
| issue_id | ah-46h |
| event_type | created |
| actor | Eugene Blikh |
| old_value | |
| new_value | |
| comment | NULL |
| created_at | 2026-08-05T03:10:04Z |
| id | 019fcf4e-4fda-753b-bdcd-faf68e638b30 |
| issue_id | ah-46h |
| event_type | label_added |
| actor | Eugene Blikh |
| old_value | NULL |
| new_value | NULL |
| comment | Added label: milestone:v0.2.0 |
| created_at | 2026-08-05T03:24:03Z |
No comments.