Improve IP restriction handling - #2962
Open
robgruen wants to merge 2 commits into
Open
Conversation
robgruen
marked this pull request as ready for review
September 2, 2026 16:06
jebrans
approved these changes
Sep 2, 2026
Co-authored-by: robgruen <25374553+robgruen@users.noreply.github.com>
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.
This pull request introduces significant improvements to network security and HTTP request handling across the workflow engine and copilot plugin packages. The main focus is on centralizing and strengthening the detection and blocking of private or reserved network targets, refactoring HTTP GET logic for better security and maintainability, and updating dependencies to use shared utilities. It also enhances test coverage to ensure correct handling of edge-case IP addresses and network scenarios.
Network security and HTTP request handling:
http.gettask inbuiltinTasks.tsto use new shared utilities for resolving and validating public IP addresses, improving detection of private/reserved addresses (including edge cases like decimal, octal, and hexadecimal IPv4, IPv4-mapped IPv6, Teredo, 6to4, NAT64, and unique-local IPv6). It now blocks credentialed URLs and enforces allowed/blocked host constraints more robustly. (ts/examples/workflow/engine/src/builtinTasks.ts)workspaceServer.tswith centralized helpers from@typeagent/common-utils/network, ensuring consistent enforcement of network security across packages. (ts/packages/copilot-plugin/src/mcp/workspaceServer.ts) [1] [2] [3]Dependency and codebase updates:
@typeagent/common-utilsas a dependency in both the workflow engine and copilot plugin packages to share network security logic. (ts/examples/workflow/engine/package.json,ts/packages/copilot-plugin/package.json,ts/packages/utils/commonUtils/package.json) [1] [2] [3]Testing improvements:
ts/examples/workflow/engine/test/engine.spec.ts,ts/packages/copilot-plugin/test/workspaceServer.spec.ts) [1] [2]ts/examples/workflow/engine/test/engine.spec.ts)Internal utility improvements:
readHttpResponseBodyhelper for direct testing and use in other modules, facilitating better testability and code reuse. (ts/examples/workflow/engine/src/builtinTasks.ts,ts/examples/workflow/engine/test/engine.spec.ts)These changes collectively harden the system against SSRF and similar attacks, ensure consistent network policy enforcement, and improve maintainability by consolidating network utilities.