Skip to content

[Teams Chatbot] Addressing SSRF vulnerability in web_fetch tool#15843

Open
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-ssrf-vulnerability
Open

[Teams Chatbot] Addressing SSRF vulnerability in web_fetch tool#15843
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-ssrf-vulnerability

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 3, 2026

Fixed an ICM issue, disabled the redirected url

Copilot AI and others added 3 commits June 3, 2026 05:46
Co-authored-by: JiaqiZhang-Dev <194873822+JiaqiZhang-Dev@users.noreply.github.com>
…st helper

Co-authored-by: JiaqiZhang-Dev <194873822+JiaqiZhang-Dev@users.noreply.github.com>
Co-authored-by: JiaqiZhang-Dev <194873822+JiaqiZhang-Dev@users.noreply.github.com>
@JiaqiZhang-Dev JiaqiZhang-Dev changed the title Addressing SSRF vulnerability in web_fetch tool [Teams Chatbot] Addressing SSRF vulnerability in web_fetch tool Jun 3, 2026
@JiaqiZhang-Dev JiaqiZhang-Dev marked this pull request as ready for review June 3, 2026 07:22
Copilot AI review requested due to automatic review settings June 3, 2026 07:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR mitigates an SSRF bypass vector in the Teams Chatbot’s web_fetch tool by preventing HTTP redirect-following, ensuring URL allowlisting is not circumvented after initial validation.

Changes:

  • Disable redirect following in httpx.AsyncClient to prevent redirect-based SSRF bypass (CWE-918).
  • Treat all 3xx responses as errors and return a clear message instructing callers to provide the final URL.
  • Add an async unit test that verifies redirects are blocked and only the initial request is issued.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tools/sdk-ai-bots/azure-sdk-qa-bot-agent/tools/web_tools.py Disables redirect following and returns an explicit error for 3xx responses to prevent SSRF via redirects.
tools/sdk-ai-bots/azure-sdk-qa-bot-agent/tests/web_tools_test.py Adds coverage ensuring follow_redirects=False is used and redirect targets are never fetched.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants