Commit graph

8 commits

Author SHA1 Message Date
Joey Hess
138e6a7f9c
remove comment as they also asked the same thing in a forum post, and were anwsered there 2020-06-30 10:43:59 -04:00
http://templeofcrom.duckdns.org/
abc2d3c2cb Added a comment: initremote type=web 2020-06-21 02:24:09 +00:00
Joey Hess
28720c795f
limit url downloads to whitelisted schemes
Security fix! Allowing any schemes, particularly file: and
possibly others like scp: allowed file exfiltration by anyone who had
write access to the git repository, since they could add an annexed file
using such an url, or using an url that redirected to such an url,
and wait for the victim to get it into their repository and send them a copy.

* Added annex.security.allowed-url-schemes setting, which defaults
  to only allowing http and https URLs. Note especially that file:/
  is no longer enabled by default.

* Removed annex.web-download-command, since its interface does not allow
  supporting annex.security.allowed-url-schemes across redirects.
  If you used this setting, you may want to instead use annex.web-options
  to pass options to curl.

With annex.web-download-command removed, nearly all url accesses in
git-annex are made via Utility.Url via http-client or curl. http-client
only supports http and https, so no problem there.
(Disabling one and not the other is not implemented.)

Used curl --proto to limit the allowed url schemes.

Note that this will cause git annex fsck --from web to mark files using
a disallowed url scheme as not being present in the web. That seems
acceptable; fsck --from web also does that when a web server is not available.

youtube-dl already disabled file: itself (probably for similar
reasons). The scheme check was also added to youtube-dl urls for
completeness, although that check won't catch any redirects it might
follow. But youtube-dl goes off and does its own thing with other
protocols anyway, so that's fine.

Special remotes that support other domain-specific url schemes are not
affected by this change. In the bittorrent remote, aria2c can still
download magnet: links. The download of the .torrent file is
otherwise now limited by annex.security.allowed-url-schemes.

This does not address any external special remotes that might download
an url themselves. Current thinking is all external special remotes will
need to be audited for this problem, although many of them will use
http libraries that only support http and not curl's menagarie.

The related problem of accessing private localhost and LAN urls is not
addressed by this commit.

This commit was sponsored by Brett Eisenberg on Patreon.
2018-06-16 11:57:50 -04:00
Joey Hess
1a11ae9da0
comment 2016-11-07 10:43:23 -04:00
spiderbit
91ba3b804e Added a comment: update 2016-11-05 17:38:26 +00:00
spiderbit
91c7f61961 Added a comment: dont have success with other download commands 2016-11-05 17:00:54 +00:00
http://joeyh.name/
a14c8cec75 Added a comment 2013-08-17 08:59:11 +00:00
http://olivier.berger.myopenid.com/
ff8b633c7f Added a comment: Which URL prefix are supported ? 2013-08-17 08:44:07 +00:00