security: reveal-token endpoint lacks requireLocalhost guard #411
Labels
No labels
backend
bug
chore
duplication
effort:complex
effort:medium
effort:trivial
enhancement
frontend
fullstack
priority:high
ready-for-agent
refactor
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dries/ocman#411
Loading…
Add table
Add a link
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?
Finding #2 (Medium) from a security review.
Problem
POST /api/settings/remote-access/reveal-tokenreturns the plaintext remote-access token — a credential granting full gRPC control of the instance (session mutation, tmux/opencode launch). It is gated only bys.post+requireAuth, unlike every other privileged route which usesrequireLocalhost.With auth disabled (default) and a non-loopback
-addr, any network client can fetch the credential.Refs
internal/server/routes.go:136internal/server/handlers_settings.go(handleRevealRemoteToken)Suggested fix
Wrap the handler in
requireLocalhost(like the other host-control routes), or refuse whenauth == niland the peer is non-loopback.Acceptance