Skip to content

L11: bind Telegram clarify callbacks to request and originating user#83

Merged
jkyberneees merged 1 commit into
mainfrom
fix/l11-telegram-clarify-binding
Jul 19, 2026
Merged

L11: bind Telegram clarify callbacks to request and originating user#83
jkyberneees merged 1 commit into
mainfrom
fix/l11-telegram-clarify-binding

Conversation

@jkyberneees

Copy link
Copy Markdown
Contributor

Closes L11.

  • Each clarify prompt now gets a random request ID embedded in its inline-keyboard callback data (clarify:<reqID>:yes/no).
  • The callback handler validates the request ID and binds the answer to the originating Telegram user, rejecting cross-user presses and stale/expired prompts.
  • internal/telegram.Handler.OnCallbackQuery now receives the userID of the user who pressed the button.

/cc @BackendStack21/odek

- cmd/odek/telegram.go: replace global per-chat clarify channel with
  pendingClarifyReqs keyed by random request ID; embed reqID in callback
  data; verify the callback comes from the originating user; reject
  expired/unknown requests.
- internal/telegram/handler.go: pass callback user's userID into
  OnCallbackQuery so callers can enforce per-user binding.
- cmd/odek/telegram_clarify_test.go + internal/telegram/*_test.go:
  regression tests and signature updates.
- docs/SECURITY.md + AGENTS.md: document L11 mitigation.
@jkyberneees
jkyberneees merged commit 636e470 into main Jul 19, 2026
5 of 7 checks passed
@jkyberneees
jkyberneees deleted the fix/l11-telegram-clarify-binding branch July 19, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant