T05 · Unauthorized Access and Privilege Escalation
- Location
src/alerters/telegram.ts:228- Finding
Telegram approval callbacks do not authenticate the requesting user or chat
- Content
View full analysis
; }; if (!data.ok || !data.result?.length) return; for (const update of data.result) { this.lastUpdateId = Math.max(this.lastUpdateId, update.update_id); const cbq = update.callback_query; if (!cbq?.data) continue; const pending = this.pendingCallbacks.get(cbq.data); if (!pending) continue; // Answer the callback query to remove loading state try { await fetch(`${TELEGRAM_API}/bot${telegram.callbackBotToken}/answerCallbackQuery`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ callback_query_id: cbq.id, text: 'Processing...' }), }); } catch { /* ignore */ } // Remove handler and execute this.pendingCallbacks.delete(cbq.data); console.log(`[${nowIso()}] [TelegramAlerter] Callback received: ${cbq.data}`); pending.handler().catch(err => { console.error(`[TelegramAlerter] Callback handler erro ...[truncated 5737 chars]- Remediation
View remediation
