[Teams Chatbot] Addressing SSRF vulnerability in web_fetch tool#15843
Open
Copilot wants to merge 3 commits into
Open
[Teams Chatbot] Addressing SSRF vulnerability in web_fetch tool#15843Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
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>
Copilot created this pull request from a session on behalf of
JiaqiZhang-Dev
June 3, 2026 06:52
View session
Contributor
There was a problem hiding this comment.
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.AsyncClientto 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. |
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.
Fixed an ICM issue, disabled the redirected url