Skip to content

fix(github-http): validate release asset metadata URLs - #4438

Open
WOLIKIMCHENG wants to merge 1 commit into
github:mainfrom
WOLIKIMCHENG:fix/validate-release-asset-metadata-urls
Open

fix(github-http): validate release asset metadata URLs#4438
WOLIKIMCHENG wants to merge 1 commit into
github:mainfrom
WOLIKIMCHENG:fix/validate-release-asset-metadata-urls

Conversation

@WOLIKIMCHENG

Copy link
Copy Markdown
Contributor

Description

Harden GitHub release-asset resolution so release metadata can replace a browser download URL only when the metadata URL:

  • uses the derived GitHub or GHES API origin, including the expected scheme and effective port
  • identifies the same owner and repository case-insensitively
  • matches the exact release-asset REST path with a numeric asset ID
  • contains no malformed percent escapes, raw whitespace or control characters, query or fragment delimiters, path parameters, or invalid authority components

This preserves public GitHub and GHES behavior, including custom ports, equivalent IPv6 literals, loopback HTTP, direct API-asset passthrough, and fallback to the original browser download URL.

Testing

  • uvx ruff@0.15.0 check src tests — all checks passed
  • .venv/bin/python -m pytest tests/test_github_http.py -q — 78 passed
  • git diff --check — passed

Require metadata asset URLs to match the derived API origin, repository
identity, and exact numeric release-asset endpoint.

Reject malformed metadata URLs while preserving direct passthrough and
browser-download fallback behavior.
@WOLIKIMCHENG
WOLIKIMCHENG requested a review from mnriem as a code owner September 4, 2026 06:44
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