Files
openclaw/extensions
Lewis 1234c873bc fix(msteams): add SSRF validation to file consent upload URL (#23596)
* fix(msteams): add SSRF validation to file consent upload URL

The uploadToConsentUrl() function previously accepted any URL from the
fileConsent/invoke response without validation. A malicious Teams tenant
user could craft an invoke activity with an attacker-controlled uploadUrl,
causing the bot to PUT file data to arbitrary destinations (SSRF).

This commit adds validateConsentUploadUrl() which enforces:

1. HTTPS-only protocol
2. Hostname must match a strict allowlist of Microsoft/SharePoint
   domains (sharepoint.com, graph.microsoft.com, onedrive.com, etc.)
3. DNS resolution check rejects private/reserved IPs (RFC 1918,
   loopback, link-local) to prevent DNS rebinding attacks

The CONSENT_UPLOAD_HOST_ALLOWLIST is intentionally narrower than the
existing DEFAULT_MEDIA_HOST_ALLOWLIST, excluding overly broad domains
like blob.core.windows.net and trafficmanager.net that any Azure
customer can create endpoints under.

Includes 47 tests covering IPv4/IPv6 private IP detection, protocol
enforcement, hostname allowlist matching, DNS failure handling, and
end-to-end upload validation.

* fix(msteams): validate all DNS answers for consent uploads

* fix(msteams): restore changelog header

---------

Co-authored-by: Brad Groux <bradgroux@users.noreply.github.com>
2026-04-06 09:52:56 -05:00
..
2026-04-05 21:33:04 +01:00
2026-04-05 21:33:04 +01:00
2026-04-05 21:33:04 +01:00
2026-04-06 15:20:03 +01:00
2026-04-06 14:53:55 +01:00
2026-04-05 21:33:04 +01:00
2026-04-05 21:33:04 +01:00
2026-04-06 14:53:55 +01:00
2026-04-05 21:33:04 +01:00
2026-04-05 21:33:04 +01:00
2026-04-05 21:33:04 +01:00
2026-04-05 21:33:04 +01:00
2026-04-05 21:33:04 +01:00
2026-04-05 21:33:04 +01:00
2026-04-05 21:33:04 +01:00
2026-04-05 21:33:04 +01:00
2026-04-05 21:33:04 +01:00
2026-04-05 21:33:04 +01:00
2026-04-05 21:33:04 +01:00
2026-04-05 21:33:04 +01:00
2026-04-05 21:33:04 +01:00
2026-04-05 21:33:04 +01:00