mirror of
https://gh-proxy.org/https://github.com/klinsmaya/new-api.git
synced 2026-11-08 01:17:09 +08:00
Reuse the channel base host and plugin allowedHosts for redirected query credentials. Keep anonymous redirects working, prevent credentials from returning after an untrusted hop, and restrict body replay to trusted hosts. Preserve SSRF and redirect limits, reject HTTPS downgrades, and redact signed URLs from redirect-policy errors. Document the existing allowedHosts contract. Validation: go test ./relay/channel/task/jsplugin -count=1 Passed against clean 6347fb0aa plus this patch, without an overlay. Covers single/batch polling, 301/302/303/307/308, host and port boundaries, multi-hop credentials, SSRF, downgrade rejection, and real HTTP receivers. Related OWASP ASVS v5.0.0 controls: 14.2.3, 1.3.6, 12.3.1, 16.2.5. https://github.com/OWASP/ASVS/tree/v5.0.0/5.0/en