task/errors
Valentin Maerten dcebbd4ed4
fix(remote): refuse a redirect that drops TLS
The scheme was only checked on the URL the user wrote. A server answering
an https URL with a redirect to http was followed by the client without
any further check, so both the HEAD probe and the download travelled in
the clear, and a network attacker could substitute the Taskfile that is
about to be executed.

CheckRedirect now refuses an https to http hop. --insecure does not
loosen it: requesting an http entrypoint is the user's decision, being
sent to one is the server's. Setting CheckRedirect also replaces Go's
default cap, so the ten-hop limit is kept explicitly.

The three call sites turned almost every client error into a generic
download failure, which would have hidden the reason; TaskfileNotSecureError
is now passed through, with wording of its own for the redirect case since
--insecure is not a way out of it.
2026-11-05 21:34:02 +01:00
..
error_taskfile_decode.go chore: bump minimum Go to 1.26 and adopt 1.26 features (#2920) 2026-08-20 12:24:04 +02:00
errors.go chore: bump minimum Go to 1.26 and adopt 1.26 features (#2920) 2026-08-20 12:24:04 +02:00
errors_task.go fix: unwrap inner TaskError code from TaskRunError (#3041) 2026-09-26 18:35:22 +02:00
errors_task_test.go fix: unwrap inner TaskError code from TaskRunError (#3041) 2026-09-26 18:35:22 +02:00
errors_taskfile.go fix(remote): refuse a redirect that drops TLS 2026-11-05 21:34:02 +01:00
errors_taskrc.go feat: recursive config search (#2166) 2025-04-19 12:20:33 +01:00