Repository navigation
Harden bot outbound requests and bound avatar decoding - #179
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bot webhook delivery can currently connect to loopback/private services, and bot download validation checks DNS separately from the connection. Avatar uploads also decode images before checking their pixel dimensions. This PR closes those paths and updates the vulnerable dependencies found during review.
Changes
Compatibility
Webhook delivery now permits public IP destinations by default. Trusted self-hosted deployments needing internal webhooks can explicitly set
TELESRV_BOT_API_WEBHOOK_ALLOW_PRIVATE_NETWORKS=true; this grants every bot access to the server's internal network. Proxy environment variables are ignored for webhook delivery and bot download checks. The option and network behavior are documented in the Bot API guide and configuration reference.Validation
Run locally with Go 1.26.11:
go test ./... -count=1go vet ./...go test -race ./internal/safehttp ./internal/botapi -count=1go run golang.org/x/vuln/cmd/govulncheck@v1.9.0 -show verbose ./...— no vulnerabilities found, including module-only results.python3 scripts/gen_admin_panel_doc_tables.py --checkgit diff --checkPostgreSQL-dependent and live Compose tests were skipped locally because their required services are not running.
This is the security subset of the changes merged in xirogram#6, rebased onto this repository's main branch.