9front - general discussion about 9front
 help / color / mirror / Atom feed
From: unobe@cpan.org
To: 9front@9front.org
Subject: [9front] Http parsing auth (Was Re: bug in Lynx' SSL certificate validation -> leaks password in clear text via SNI (under some circumstances) )
Date: Fri, 20 Aug 2021 21:40:23 -0700	[thread overview]
Message-ID: <16015ED86F00928DCC8FEBFE7D29DF94@smtp.pobox.com> (raw)
In-Reply-To: <YTXPR0101MB12291D09D7F6F1D597CB4956E8F49@YTXPR0101MB1229.CANPRD01.PROD.OUTLOOK.COM>

See below, which is a forward of a message I received a couple weeks ago.

The best I can tell is that the parser for lynx didn't understand the
authn part of the URI.  I think libhttpd doesn't have the same
problem--it just returns a bad uri, which is better than leaking.  I'm
looking at /sys/src/libhttpd/parsereq.c:/^parseuri .
/sys/src/libhttpd/parse.c parses the mime header, so it's not an issue
with requests that are sent with the authorization that way.  From
httpd(2):
     BUGS
          This is a rough implementation and many details are going to
          change.

Webfs(4) looks to handle things properly in parsing (
/sys/src/cmd/webfs/url.c ), but would still generate a URI that
libhttpd couldn't handle: /sys/src/cmd/webfs/url.c:^/Ufmt .

Questions: if my analysis is correct, should parseuri be made to parse
authuser and authpass?  Or is libhttpd not used as much and other
software is preferred?

Quoth Katherine Mcmillan <kmcmi046@uottawa.ca>:
> FYI
> 
> ________________________________
> From: Lynx-dev <lynx-dev-bounces+kmcmi046=uottawa.ca@nongnu.org> on behalf of Ariadne Conill <ariadne@dereferenced.org>
> Sent: 07 August 2021 10:17
> To: oss-security@lists.openwall.com <oss-security@lists.openwall.com>
> Cc: Axel Beckert <abe@debian.org>; lynx-dev@nongnu.org <lynx-dev@nongnu.org>; security@debian.org <security@debian.org>; 991971@bugs.debian.org <991971@bugs.debian.org>
> Subject: Re: [Lynx-dev] [oss-security] Re: bug in Lynx' SSL certificate validation -> leaks password in clear text via SNI (under some circumstances)
> 
> Attention : courriel externe | external email
> 
> Hi,
> 
> On Sat, 7 Aug 2021, Thorsten Glaser wrote:
> 
> > Axel Beckert dixit:
> >
> >> This is more severe than it initially looked like: Due to TLS Server
> >> Name Indication (SNI) the hostname as parsed by Lynx (i.e with
> >> "user:pass@" included) is sent in _clear_ text over the wire even
> >
> > I *ALWAYS* SAID SNI IS A SHIT THING ONLY USED AS BAD EXCUSE FOR NAT
> > BY PEOPLE WHO ARE TOO STUPID TO CONFIGURE THEIR SERVERS RIGHT AND AS
> > BAD EXCUSE FOR LACKING IPv6 SUPPORT, AND THEN THE FUCKING IDIOTS WENT
> > AND MADE SNI *MANDATORY* FOR TLSv1.3, AND I FEEL *SO* VINDICATED RIGHT
> > NOW! IDIOTS IN CHARGE OF SECURITY, FUCKING IDIOTS…
> 
> It turns out SNI is only marginally related to this issue.  The issue
> itself is far more severe: HTParse() does not understand the authn part of
> the URI at all.  And so, when you call:
> 
>    HTParse("https://foo:bar@example.com", "", PARSE_HOST)
> 
> It returns:
> 
>    foo:bar@example.com
> 
> Which is then handed directly to SSL_set_tlsext_host_name() or
> gnutls_server_name_set().  But it will also leak in the Host: header on
> unencrypted connections, and also probably SSL ones too.
> 
> As a workaround, I taught HTParse() how to parse the authn part of URIs,
> but Lynx itself needs to actually properly support the authn part really.
> 
> I have attached the patch Alpine is using to work around this infoleak.
> 
> Ariadne
> 


           reply	other threads:[~2021-08-21  9:10 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <YTXPR0101MB12291D09D7F6F1D597CB4956E8F49@YTXPR0101MB1229.CANPRD01.PROD.OUTLOOK.COM>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16015ED86F00928DCC8FEBFE7D29DF94@smtp.pobox.com \
    --to=unobe@cpan.org \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).