fix(radar): prevent path traversal in tool parameters#278
Merged
andre-j3sus merged 2 commits intomainfrom Jan 15, 2026
Merged
Conversation
4f31b2f to
f25ee40
Compare
|
lgtm |
mschwarzl
reviewed
Jan 13, 2026
03c1156 to
7894900
Compare
Add strict input validation to prevent path traversal attacks in Radar MCP server tools. The vulnerability allowed attackers to escape the /radar/ API scope and access other Cloudflare API endpoints using the victim's token. Changes: - Add SlugParam validator (alphanumeric only) for bot and CT log slugs - Add Sha256FingerprintParam validator (64 hex chars) for CA identifiers - Add numeric regex validation to GeoIdParam for GeoNames IDs - Add defense-in-depth check in fetchRadarApi to reject '..' and '//' Affected tools: - get_bot_details: botSlug now validated with SlugParam - get_geolocation_details: geoId now validated as numeric string - get_ct_authority_details: caSlug now validated as SHA256 fingerprint - get_ct_log_details: logSlug now validated with SlugParam
Replace blocklist pattern matching with URL path normalization and allowlist validation. The URL constructor normalizes paths (resolves '..' and decodes percent-encoding), so we verify the final pathname stays within /client/v4/radar/ scope. This approach handles: - URL-encoded traversal attempts (%2e%2e, %2f) - Double encoding and other bypass techniques - Future unknown bypass patterns (allowlist vs blocklist)
7894900 to
7c3515c
Compare
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.
Add strict input validation to prevent path traversal attacks in Radar MCP server tools. The vulnerability allowed attackers to escape the /radar/ API scope and access other Cloudflare API endpoints using the victim's token.
Changes:
Affected tools: