<div dir="ltr"><br><br><div class="gmail_quote">On Wed, Apr 29, 2015 at 10:00 AM Herbert Valerio Riedel <<a href="mailto:hvriedel@gmail.com">hvriedel@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 2015-04-28 at 18:13:47 +0200, Michael Snoyman wrote:<br>
<br>
[...]<br>
<br>
> Your analysis is accurate. There are some interesting approaches we could<br>
> take to further mitigate things. For example: newer versions of<br>
> cabal-install could automatically set an incorrect username/password in the<br>
> ~/.cabal/config file, and create a new set of fields<br>
> (ssl-username/ssl-password?) that it would recognize.<br>
<br>
Now that you mention that; the typical default config entry looks like:<br>
<br>
remote-repo: hackage.haskell.org:http://<a href="http://hackage.haskell.org/packages/archive" target="_blank">hackage.haskell.org/packages/archive</a><br>
<br>
For a TLS-capable cabal-install (for which I'll assume it'll use digest-auth), I'd suggest (as a strawman proposal -<br>
so please criticize!) that it<br>
<br>
a) when creating a default-config, write<br>
<br>
remote-repo: hackage.haskell.org:https://<a href="http://hackage.haskell.org/packages/archive" target="_blank">hackage.haskell.org/packages/archive</a><br>
<br>
b) if a cabal upload operation is performed,<br>
<br>
1) if remote-repo points to a http:// url, Warn the user in a<br>
visible scary way that can't easily be ignored that he/she<br>
should switch to a https:// url; however,<br>
proceed w/ the requested operation using digest-auth<br>
<br>
2) if remote-repo points to a https:// url, operate w/o warning<br>
(could use basic-auth instead of digest-auth, if we wanted to<br>
avoid an additional round-trip at the HTTP-layer)<br>
<br>
c) for non-authorised operations, emit less-scary warnings as a<br>
friendly reminder to update the repo-url to a https:// capable one<br>
<br>
So once a the cabal-config file points to a https://, url, the risk of<br>
older non-TLS-capable cabal-installs leaking credentials via unencrypted<br>
HTTP would be solved (at the expense of older cabal-install versions not<br>
being able to communicate via https:// urls at all...)<br>
<br>
<br>
Cheers,<br>
hvr<br></blockquote><div><br></div><div>I'd probably be more aggressive, and simply rewrite the cabal.config for users (with a message) to change <a href="http://hackage.">http://hackage.</a>.. to <a href="https://hackage">https://hackage</a>. But I'm OK with just give a bunch of warnings to encourage the user to do it him/herself. </div></div></div>