Description
Basically this is request to re-evaluate findings from #2253 (comment)
When default tldr
client requests definition cache it does download https://tldr-pages.github.io/assets/tldr.zip
Problem: The link has an unsecure/plain HTTP hop which can be seen using cURL:
$ curl -vL 'https://tldr-pages.github.io/assets/tldr.zip'
* Trying 185.199.111.153...
* TCP_NODELAY set
* Connected to tldr-pages.github.io (185.199.111.153) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* SSL stuff...
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7ff05000d800)
> GET /assets/tldr.zip HTTP/2
> Host: tldr-pages.github.io
> User-Agent: curl/7.54.0
> Accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
< HTTP/2 301
< content-type: text/html
< server: GitHub.com
< location: http://tldr.sh/assets/tldr.zip
< x-github-request-id: 15D0:08FF:4A88CE:4FC8C2:600F05FC
< accept-ranges: bytes
< date: Mon, 25 Jan 2021 18:14:51 GMT
< via: 1.1 varnish
< age: 1182
< x-served-by: cache-bma1635-BMA
< x-cache: HIT
< x-cache-hits: 1
< x-timer: S1611598492.730806,VS0,VE1
< vary: Accept-Encoding
< x-fastly-request-id: 27a137c450f28daff2f2e5216128860de8798473
< content-length: 162
The problem, obviously is location: http://tldr.sh/assets/tldr.zip
reply header.
As unsecure redirect is advised, the tldr.zip
file can be trivially MITM'ed and poisoned by unknown party to do some nefarious command suggestion or exploit a (yet unknown) Markdown processing bug. Definition cache file is not cryptographically signed, therefore a malicious file detection on client side is impossible.
Cause: Reading the discussion linked above it seems that tldr-pages.github.io
repository's settings does not have "Enforce HTTPS" checkbox value selected due to a configuration conflict with tldr.sh
domain being fronted by Cloudflare CDN.
Suggestion: Unless there's calculated benefit in using Cloudflare CDN to front apex tldr.sh
domain a security conscious choice would be to use direct A
record assignment for GitHub Pages (as described here). It would thus skip Cloudflare altogether and allow to toggle "Enforce HTTPS" in GitHub panel.