[scan] Security attack vector mapping #2
Labels
No labels
athena
athena-gemini
audit
clotho
clotho-gemini
codex
darbs-claude
security
wiki
No milestone
No project
No assignees
1 participant
Notifications
Due date
-
Dependencies
No dependencies set.
Reference: core/php-plug-chat#2
Loading…
Add table
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?
Map every external input entry point: function, file:line, input source, flows into, validation, attack vector.
Implementation Plan (Spark)
Security Attack Vector Map
Scope
/workspace/CLAUDE.mdand all PHP sources under/workspace/src./workspace/CODEX.mdis not present in this repository, so there were no additional Codex-specific repo conventions to apply.Core\Plug\Concern\ManagesTokenscomes from the externallthn/phpdependency and is not present in this repository, so token storage/retrieval internals were not inspectable here.Primary Findings
mrkdwnfor Slack,HTMLparse mode for Telegram, unrestricted Discord content/embeds), so untrusted input can become mention/formatting injection.Webhook Validation And Webhook URL Entry Points
src/Discord/Auth.php:37withWebhook(string $webhookUrl)src/Discord/Auth.php:57$params['webhook_url']src/Discord/Auth.php:67webhook_urlstr_starts_with(..., 'https://discord.com/api/webhooks/').src/Discord/Auth.php:72webhook_urlGETagainst the supplied Discord webhook URL.src/Discord/Auth.php:80webhook_url, metadatasrc/Discord/Auth.php:90getAccount()uses the stored webhook URL directly.src/Discord/Post.php:26withWebhook(string $webhookUrl)src/Discord/Post.php:40text,media,params, stored webhook URLsrc/Discord/Post.php:99{$this->webhookUrl}?wait=true.src/Discord/Delete.php:25withWebhook(string $webhookUrl)src/Discord/Delete.php:37id, stored webhook URLsrc/Discord/Delete.php:43{$this->webhookUrl}/messages/{$id}.src/Slack/Auth.php:37withWebhook(string $webhookUrl)src/Slack/Auth.php:57$params['webhook_url']src/Slack/Auth.php:67webhook_urlstr_starts_with(..., 'https://hooks.slack.com/').src/Slack/Auth.php:72webhook_urlPOSTtest request to the supplied webhook URL.src/Slack/Auth.php:77invalid_payloadas proof that the webhook is valid.src/Slack/Auth.php:81webhook_urlsrc/Slack/Post.php:26withWebhook(string $webhookUrl)src/Slack/Post.php:40text,media,params, stored webhook URLsrc/Slack/Post.php:92Notes
Auth::requestAccessToken()for Discord and Slack. If a caller bypasses that path and injects a webhook URL throughwithWebhook()onPostorDelete, the send/delete classes do not re-validate the destination before issuing HTTP requests.Bot Token Handling Entry Points And Sinks
src/Telegram/Auth.php:39withBotToken(string $botToken)src/Telegram/Auth.php:59$params['bot_token']src/Telegram/Auth.php:69GET https://api.telegram.org/bot{token}/getMe.src/Telegram/Auth.php:83'access_token'.src/Telegram/Auth.php:93getAccount()embeds the token in the request URL.src/Telegram/Post.php:46ManagesTokens::accessToken()src/Telegram/Post.php:80/bot{token}/sendMessage.src/Telegram/Post.php:121/bot{token}/sendMediaGroup.src/Telegram/Post.php:167/bot{token}/{method}.src/Telegram/Delete.php:43accessToken()src/Telegram/Delete.php:52/bot{token}/deleteMessage.me()token readsrc/Telegram/Read.php:39accessToken()me()sinksrc/Telegram/Read.php:44/bot{token}/getMe.src/Telegram/Read.php:65accessToken()src/Telegram/Read.php:70/bot{token}/getChat.src/Telegram/Read.php:94accessToken()src/Telegram/Read.php:99/bot{token}/getUpdates.src/Telegram/Chats.php:31accessToken()src/Telegram/Chats.php:37/bot{token}/getUpdates.src/Telegram/Chats.php:73accessToken()src/Telegram/Chats.php:78/bot{token}/getChatMemberCount.src/Telegram/Chats.php:92accessToken()src/Telegram/Chats.php:97/bot{token}/getChatAdministrators.Notes
ManagesTokensis external to this repository, this review can only map token consumption sites here, not how the token is persisted or redacted elsewhere.Message Injection And Untrusted Content Sinks
src/Discord/Post.php:48$textcontentwithout mention restrictions.src/Discord/Post.php:56src/Discord/Post.php:81$params['embed']src/Discord/Post.php:86$params['username'],$params['avatar_url']src/Discord/Post.php:94$params['tts']src/Slack/Post.php:49$textmrkdwn, enabling formatting and mention expansion.src/Slack/Post.php:60src/Slack/Post.php:80$params['username'],$params['icon_emoji'],$params['icon_url']src/Telegram/Post.php:62$text,$params['parse_mode']parse_mode = HTML, so raw text is interpreted as HTML formatting.src/Telegram/Post.php:76$params['reply_to_message_id']src/Telegram/Post.php:107$text,$params['parse_mode']src/Telegram/Post.php:121src/Telegram/Post.php:158Notes
getUpdates.Remote Update Ingestion Points
src/Telegram/Read.php:92getUpdatesresponsemessage/channel_postchat objects with no schema validation beyond null checks.src/Telegram/Chats.php:29getUpdatesresponsemessage,channel_post, andmy_chat_memberchat objects with no schema validation beyond null checks.Absent Controls In This Repository
mrkdwn, Discord mentions/embeds, or Telegram HTML formatting.Security Scan: Attack Vector Map completed. Details in agent log.