T05 · Unauthorized Access and Privilege Escalation
- Location
index.js:541- Finding
Telegram Callback Handler Does Not Enforce the Configured User Allowlist
- Content
View full analysis
i.id); if (view.message_id) return editExistingView(state, target, account, threadId, mode); return sendTelegramView(state, target, account, mode, threadId); } throw new Error('Unsupported callback action.'); } export default function register(api) { api.registerInteractiveHandler({ channel: 'telegram', namespace: 'gchk', handler: async ({ callback, senderId }) => { const target = String(callback.chatId || senderId); const fp = statePath(); let state; try { state = loadState(fp); } catch (err) { console.error('[grocery-checklist] state load error:', String(err)); return; } try { await ha ...[truncated 2815 chars]- Remediation
View remediation
{ const account = 'grocery'; const sender = String(senderId); if (!allowedTelegramUsers(account).has(sender)) { console.warn('[grocery-checklist] rejected unauthorized callback'); return; } // Continue processing only after authorization succeeds. } ``` ]]>
