You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tooling.apache.org by "andrewmusselman (via GitHub)" <gi...@apache.org> on 2026/02/17 06:54:41 UTC

[I] Add TLS enforcement to download shell script in `atr/static/sh/download-urls.sh` (tooling-trusted-releases)

andrewmusselman opened a new issue, #686:
URL: https://github.com/apache/tooling-trusted-releases/issues/686

   **ASVS Requirements:** V12.2.1, V12.2.2
   **CWE:** CWE-295 (Improper Certificate Validation), CWE-319 (Cleartext Transmission of Sensitive Information)
   **Severity:** MEDIUM
   **File:** `atr/static/sh/download-urls.sh` (lines ~6–13)
   
   ### Description
   
   The download shell script has two issues:
   1. No `--proto '=https'` flag to restrict curl to HTTPS-only connections, meaning HTTP URLs would be silently accepted.
   2. The `${CURL_EXTRA:-}` environment variable is directly interpolated into curl commands, allowing callers to inject `--insecure` or `-k` flags that disable TLS certificate verification.
   
   ### Current code
   
   ```bash
   curl ${CURL_EXTRA:-} -fsS "$_url_of_urls" | while IFS= read -r _url_and_path
   do
     _url=${_url_and_path%% *}
     _path=${_url_and_path#* }
     curl ${CURL_EXTRA:-} --create-dirs -fsS "$_url" -o "$_path"
   done
   ```
   
   ### Recommended fix
   
   Maybe add a comment for the audit to understand this
   
   Suggestion from audit:
   Replace `CURL_EXTRA` with specific validated options, and enforce HTTPS and TLS 1.2+:
   
   ```bash
   _curl_secure() {
     curl --proto '=https' --tlsv1.2 -fsS "$@"
   }
   
   _curl_secure "$_url_of_urls" | while IFS= read -r _url_and_path
   do
     _url=${_url_and_path%% *}
     _path=${_url_and_path#* }
     _curl_secure --create-dirs "$_url" -o "$_path"
   done
   ```
   
   If proxy support is needed, validate via specific environment variables (`HTTPS_PROXY`) rather than arbitrary flag injection.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For additional commands, e-mail: dev-help@tooling.apache.org


Re: [I] Add TLS enforcement to download shell script in `atr/static/sh/download-urls.sh` (tooling-trusted-releases)

Posted by "dave2wave (via GitHub)" <gi...@apache.org>.
dave2wave commented on issue #686:
URL: https://github.com/apache/tooling-trusted-releases/issues/686#issuecomment-3937065865

   Actually `CURL_EXTRA` should become like `[URL_OF_URLS]` and be templated as appropriate according to the dev mode and not via host name inspection.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For additional commands, e-mail: dev-help@tooling.apache.org


Re: [I] Add TLS enforcement to download shell script in `atr/static/sh/download-urls.sh` (tooling-trusted-releases)

Posted by "sbp (via GitHub)" <gi...@apache.org>.
sbp closed issue #686: Add TLS enforcement to download shell script in `atr/static/sh/download-urls.sh`
URL: https://github.com/apache/tooling-trusted-releases/issues/686


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For additional commands, e-mail: dev-help@tooling.apache.org


Re: [I] Add TLS enforcement to download shell script in `atr/static/sh/download-urls.sh` (tooling-trusted-releases)

Posted by "dave2wave (via GitHub)" <gi...@apache.org>.
dave2wave commented on issue #686:
URL: https://github.com/apache/tooling-trusted-releases/issues/686#issuecomment-3937187394

   This is a curl from a template to download a curl shell script.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For additional commands, e-mail: dev-help@tooling.apache.org


Re: [I] Add TLS enforcement to download shell script in `atr/static/sh/download-urls.sh` (tooling-trusted-releases)

Posted by "dave2wave (via GitHub)" <gi...@apache.org>.
dave2wave commented on issue #686:
URL: https://github.com/apache/tooling-trusted-releases/issues/686#issuecomment-3937032431

   The script is processed in `get/download.py`. It needs to be written to provide both a dev mode with `--insecure` and the user instructions here: `templates/download_all.html` must also add `--proto '=https' --tlsv1.2`. `CURL_EXTRA` should be removed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For additional commands, e-mail: dev-help@tooling.apache.org