Skip to content

Allow List#2

Merged
Nick (ingalls) merged 4 commits into
mainfrom
safe-allow
Jun 7, 2026
Merged

Allow List#2
Nick (ingalls) merged 4 commits into
mainfrom
safe-allow

Conversation

@ingalls

@ingalls Nick (ingalls) commented Jun 7, 2026

Copy link
Copy Markdown
Member

This pull request enhances the SSRF-safe URL validation system by introducing an explicit allow-list mechanism, allowing callers to specify trusted origins or hostnames that should bypass SSRF checks. This is particularly useful for permitting known internal endpoints in secure environments. The changes also propagate this feature through the public API and its consumers.

SSRF-safe URL validation enhancements:

  • Added a safeUrlAllow option to the FetchInit interface in lib/fetch.ts, enabling callers to specify a list of allowed origins or hostnames that bypass SSRF checks.
  • Updated the main fetch implementation in lib/fetch.ts to pass the safeUrlAllow option to the isSafeUrl check for both the initial request and any redirects, ensuring consistent allow-list enforcement. [1] [2] [3]
  • Extended the isSafeUrl function in lib/safeurl.ts to accept a new SafeUrlOptions parameter, implementing logic to immediately allow URLs matching any entry in the provided allow-list.

Public API updates:

  • Exported the new SafeUrlOptions type from the package entry point (index.ts) for external use.

@ingalls Nick (ingalls) merged commit 695f15d into main Jun 7, 2026
1 of 2 checks passed
@ingalls Nick (ingalls) deleted the safe-allow branch June 7, 2026 00:38
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.

1 participant