repo-criteria-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Repo-criteria-discuss] Savannah and HTTPS


From: Mike Gerwitz
Subject: Re: [Repo-criteria-discuss] Savannah and HTTPS
Date: Mon, 10 Oct 2016 22:08:23 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

On Mon, Oct 10, 2016 at 05:00:52 -0400, Richard Stallman wrote:
>   > Richard: unless there's a compelling reason not to, I think the
>   > sysadmins or Savannah hackers (whomever has the ablity) should just add
>   > a webserver rule to redirect all requests on port 80 to 443.
>
> Would this, by itself, fix the immediate problem?

Not completely, for the reason below.

>   >   For
>   > example, if the login form was loaded over HTTPS, but accidentally posts
>   > to an HTTP link,
>
> Please spell out that scenario more clearly; I do not follow you.

Let's assume that the Savannah webserver is configured to redirect all
HTTP requests to HTTPS, as suggested above.

A hypothetical situation (this isn't the case today):

  0. Alice visits https://savannah.gnu.org/account/login.php.
  
  1. Alice is presented with a login form.  This connection is secure.
  
  2. Since Alice is already using HTTPS, the login form would
     normally post its data over HTTPS.  But due to a (hypothetical)
     configuration issue or bug on Savannah, the form is instead
     instructed to post to http://savannah.gnu.org, without HTTPS.
  
  3. The request is made plaintext over HTTP, containing Alice's
     username and password.  Eve, an eavesdropper, observes the data.
  
  4. The Savannah webserver receives the request, sees that it's HTTP,
     and instructs the browser to redirect to HTTPS.
  
  5. The web browser re-submits the request to https://savannah.gnu.org,
     and Alice is none the wiser.  The login succeeds as expected.

Alice observed a secure connection the entire time, but Eve was still
able to harvest her password.[*]

Let's pretend that the above wasn't possible, and Eve doesn't have
Alice's username and password.  She's not out of luck yet.  Savannah
knows that Alice is logged in because of a session cookie stored in the
browser.  This cookie is sent to Savannah encrypted, because Alice is
using HTTPS.

If there is a single link on Savannah misconfigured to point to the HTTP
website, that cookie will be sent in plain text.  If Alice returns to
Savannah at a later time---still logged in---by typing
`savannah.gnu.org' in her browser, her request will first be served over
HTTP.  The cookie will be sent in plain text to the server before she is
redirected.

Eve can take that cookie and send it to the server herself---she will
have assumed the identity of Alice.  If I'm Alice, then Eve is now a
superuser, and can do with Savannah as she pleases.  Fortunately, I
mitigate that with the HTTPS Everywhere addon.

There are other concerns, but this is what HTTP Strict Transport
Security (HSTS) aims to prevent---it tells the web browser, via an HTTP
header, that it should _never_ request a page over HTTP, even if
explicitly instructed to by the webpage.[0]  Eve will have to find
another way.

The solution to the problem is:

  - Redirect all requests to HTTPS; _and_
  - Use the HSTS header.

Further (this is more technical; you needn't read it):

The cookie hijack attack is possible because the cookies on Savannah are
not served with a flag that tells the browser to _never_ serve the
cookie over HTTP.

  - HSTS will mitigate the issue in newer browsers, but the HTTPS-only
    cookie flag should also be set.
  - The option on the login page to "stay in secure (https) mode after
    login" should be removed---of course you'd want that.


[0]: https://en.wikipedia.org/wiki/HSTS

[*]: As a real-world example: I was logging into nature.com at work,
which uses HTTP.  One of my coworkers---who handles the systems that
monitor logs for threats---notified me that my password was plaintext in
the logs.  Fortunately, he is a good guy.  And fortunately, my Nature
account wasn't sensitive, and used a password unique to that website;
if my password were shared, accounts on other websites would effectively
be compromised.

-- 
Mike Gerwitz
Free Software Hacker+Activist | GNU Maintainer & Volunteer
GPG: 2217 5B02 E626 BC98 D7C0  C2E5 F22B B815 8EE3 0EAB
https://mikegerwitz.com

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]