mirror of
https://gitee.com/mateos/mateclaw.git
synced 2026-09-13 03:13:41 +08:00
Two SSRF hardenings on top of the private-network deployment mode: 1. Redirect / subresource re-validation. The SSRF guard previously ran only on the initial navigation URL in the tool layer, so a public page that 302s to 169.254.169.254 (or a script fetch / img to a metadata IP) reached the target unchecked — worse now that private-network mode exists. Install a per-context request interceptor (BrowserLauncher.applyContextDefaults) that re-runs UrlSafetyChecker on every http(s) request and aborts blocked ones. Non-network schemes (data:/blob:/about:) pass through; unexpected checker faults fail open so a transient error cannot wedge the page (the initial URL was already checked). 2. Allowlist can no longer open a cloud-metadata endpoint. Metadata hostnames and IPs are now checked BEFORE the allowlist short-circuits, so an operator entry like 169.254.0.0/16 or metadata.google.internal can never expose instance metadata. Ordinary private-host allowlisting is unaffected (regression-tested). Also correct the 192.0.0.192 comment (Oracle Cloud IMDS, not Azure). |
||
|---|---|---|
| .. | ||
| src | ||
| Dockerfile | ||
| pom.xml | ||
| settings.xml | ||