Skip to content

fix(proxy): Harden URI parsing in port forwarding proxy#269

Merged
skazantsev merged 1 commit into
1.2from
fix/proxy-uri-parsing
Jul 8, 2026
Merged

fix(proxy): Harden URI parsing in port forwarding proxy#269
skazantsev merged 1 commit into
1.2from
fix/proxy-uri-parsing

Conversation

@skazantsev

@skazantsev skazantsev commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Description of Changes

Harden createProxyRequest in the proxy server patch to use strict input
validation and the WHATWG URL constructor instead of the deprecated
url.resolve() API.

Changes:

  • Validate port is a well-formed positive integer (reject leading zeros)
  • Normalize leading slash/backslash sequences before constructing the target URL
  • Use new URL() with a base URL instead of url.resolve()
  • Verify the constructed URL's hostname and port match the intended target

Testing

  • Patch applies cleanly via prepare-src.sh
  • Dev-build compiles successfully
  • Manual verification: legitimate proxied requests (HTML, JS, JSON, nested paths,
    query params, redirects) all work correctly
  • Manual verification: malformed path inputs are rejected

Backporting

Needs backport to main, 1.1 and 1.0


By submitting this pull request, I confirm that you can use, modify, copy,
and redistribute this contribution, under the terms of your choice.

@skazantsev skazantsev added this pull request to the merge queue Jul 8, 2026
Merged via the queue into 1.2 with commit 7283bbf Jul 8, 2026
1 check passed
@skazantsev skazantsev deleted the fix/proxy-uri-parsing branch July 8, 2026 14:55
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.

2 participants