Description
Feature Request
If an HTTPS client request gets downgraded by a redirect to HTTP by some host in the redirect chain, users should have the option to forbid this downgrade in the configuration of the HttpClient
.
Impacted Code
typed-rest-client/lib/HttpClient.ts
Lines 239 to 256 in c99dbbe
There is no check to see if the new redirect location is a downgrade from HTTPS to HTTP.
While not strictly a security vulnerability, this does have security implications.
Use Case
The use case for this is the GitHub Actions toolkit API. See: actions/toolkit#162
The GitHub actions toolkit is used to download other tools using the downloadTool
API. We'd like to require that users provide SHA-256 checksums for their artifacts if they end up using HTTP instead of HTTPS to prevent MITM attacks against the GH Actions supply chain.
This verification should also be required if somewhere in the redirect chain in downloading the tool, the request is downgraded from HTTPS to HTTP. Currently, the HttpClient
doesn't support this sort of check.