Fix incomplete URL substring sanitization for Azure blob storage check (CodeQL #92) - #370
Draft
ed-woodfall with Copilot wants to merge 2 commits into
Draft
Fix incomplete URL substring sanitization for Azure blob storage check (CodeQL #92)#370ed-woodfall with Copilot wants to merge 2 commits into
ed-woodfall with Copilot wants to merge 2 commits into
Conversation
Co-authored-by: ed-woodfall <22744772+ed-woodfall@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix code scanning alert(s) flagged in this repository
Fix incomplete URL substring sanitization for Azure blob storage check (CodeQL #92)
Aug 13, 2026
ed-woodfall
approved these changes
Aug 13, 2026
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.
Plain substring matching on an unparsed URL can be trivially bypassed — e.g.
https://attacker.com/evil?.blob.core.windows.netwould pass the old check. Fixes the high-severity CodeQL alertpy/incomplete-url-substring-sanitization.Overview
Replaces the unsafe substring check for Azure blob storage URLs with proper
urlparse-based hostname validation.JIRA
N/A — security alert fix
Changes
urllib.parse.urlparseininteractive_session.py'.blob.core.windows.net' in link_path_strwithurlparse(link_path_str).hostname.endswith('.blob.core.windows.net'), scoping the check to the actual hostname component onlyAcceptance Criteria
Scenario 1 - Azure blob URL is correctly rejected
A valid Azure blob URL such as `https://myaccount.blob.core.windows.net/container/file` raises `ValueError`.Scenario 2 - Bypass attempt is rejected
A crafted URL such as `https://attacker.com/path?.blob.core.windows.net` does **not** trigger the Azure check (hostname is `attacker.com`, not a `.blob.core.windows.net` host).DEV
Proof this feature/patch works in this environment
AZURE
Proof this feature/patch works in this environment
Interactive Analysis
Proof this feature/patch works in this environment