From: Romain Ouabdelkader <romain.ouabdelkader@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 37187@debbugs.gnu.org, Thomas Fitzsimmons <fitzsim@fitzsim.org>
Subject: bug#37187: 26.2; url-retrieve redirect lost Authorization headers
Date: Sat, 21 Sep 2019 02:01:24 +0200 [thread overview]
Message-ID: <CAJ8YToYw9iDOUXXZoh2K9VG1+nEPNjLCi_MwC0kSzUd5Er-fUg@mail.gmail.com> (raw)
In-Reply-To: <877e627lj1.fsf@gnus.org>
[-- Attachment #1: Type: text/plain, Size: 1772 bytes --]
Indeed, curl does the same thing:
https://curl.haxx.se/docs/CVE-2018-1000007.html
But it seems to only strip the Authorization header if the redirect is on
another host:
https://github.com/curl/curl/commit/af32cd3859336ab.patch
On Fri, Sep 20, 2019 at 10:36 PM Lars Ingebrigtsen <larsi@gnus.org> wrote:
> Romain Ouabdelkader <romain.ouabdelkader@gmail.com> writes:
>
> > I have an issue with the 'url-retrieve' function:
> > If the target url returns a redirect, the 'Authorization' header is not
> > sent on the redirect url.
>
> This is apparently on purpose:
>
> ;; Do not automatically include an authorization header in the
> ;; redirect. If needed it will be regenerated by the relevant
> ;; auth scheme when the new request happens.
> (setq url-http-extra-headers
> (cl-remove "Authorization"
> url-http-extra-headers :key 'car :test 'equal))
>
> It's from this patch:
>
> commit 325200ac1dcf5bed6918ea827d8a48d89487e083
> Author: Thomas Fitzsimmons <fitzsim@fitzsim.org>
> Date: Wed Sep 23 01:45:29 2015 -0400
>
> Do not include authorization header in an HTTP redirect
>
> * lisp/url/url-http.el (url-http-parse-headers): Do not
> automatically include Authorization header in redirect.
> (Bug#21350)
>
> And I think that makes sense -- when there's a redirect, the domain may
> be new, and the auth should perhaps not be sent there.
>
> I've had a look at the standards, but I can't see that they say anything
> about this, so I think that perhaps this works as it's supposed to. But
> I haven't checked what Firefox does, for instance.
>
> --
> (domestic pets only, the antidote for overdose, milk.)
> bloggy blog: http://lars.ingebrigtsen.no
>
[-- Attachment #2: Type: text/html, Size: 2713 bytes --]
next prev parent reply other threads:[~2019-09-21 0:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-25 22:08 bug#37187: 26.2; url-retrieve redirect lost Authorization headers Romain Ouabdelkader
2019-09-20 20:36 ` Lars Ingebrigtsen
2019-09-21 0:01 ` Romain Ouabdelkader [this message]
2019-09-21 7:41 ` Lars Ingebrigtsen
2019-09-21 8:26 ` Romain Ouabdelkader
2019-09-21 8:40 ` Lars Ingebrigtsen
2019-09-21 9:27 ` Romain Ouabdelkader
2020-07-19 20:24 ` Lars Ingebrigtsen
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAJ8YToYw9iDOUXXZoh2K9VG1+nEPNjLCi_MwC0kSzUd5Er-fUg@mail.gmail.com \
--to=romain.ouabdelkader@gmail.com \
--cc=37187@debbugs.gnu.org \
--cc=fitzsim@fitzsim.org \
--cc=larsi@gnus.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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).