Mailing List Archive

Web Key Directory - HTTP Redirect?
When a client does Key Discovery using the Web Key Directory, should it
follow HTTP Redirects (HTTP Status 302) or is that not foreseen?



-Patrick
Re: Web Key Directory - HTTP Redirect? [ In reply to ]
On 16.12.2018 11:40, Patrick Brunschwig wrote:
> When a client does Key Discovery using the Web Key Directory, should it
> follow HTTP Redirects (HTTP Status 302) or is that not foreseen?

Hi Patrick, I've asked that question some time ago [0] and the answer was
"redirects should be followed".

[0]: https://lists.gt.net/gnupg/devel/83924#83924

There are some restrictions implemented recently for the Location header:
https://dev.gnupg.org/rGfa1b1eaa4241ff3f0634c8bdf8591cbc7c464144

This page gives more details:
https://www.sektioneins.de/en/advisories/advisory-012018-gnupg-wkd.html

(as a side note it's interesting because this "CRSF" in GnuPG would not send any
cookies and the attack described in the advisory shows rather an issue with the
receiving app, not GnuPG... but that's a side note...)

Kind regards,
Wiktor

--
https://metacode.biz/@wiktor

_______________________________________________
Gnupg-devel mailing list
Gnupg-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-devel
Re: Web Key Directory - HTTP Redirect? [ In reply to ]
On Mon, 17 Dec 2018 21:09, gnupg-devel@gnupg.org said:

> There are some restrictions implemented recently for the Location header:
> https://dev.gnupg.org/rGfa1b1eaa4241ff3f0634c8bdf8591cbc7c464144

Which are: If the host part of the new URL is identical to the original
one the entire new URL is used. If the host part differs only the new
host part is used and the path and query parameters of the original URL
are kept.

It might be possible to relax this insofar that certain transformations
of the path parameter are still allowed; in particular to allow a
redirection from say,

https://example.org/.well-known/openpgpkey/FOO

to

https://openpgpkey.example.org/.well-known/openpgpkey/examample.org/FOO

(different host and path but a well-known path structure)

to it easier to migrate to the new advanced scheme. But this adds some
complexity and will not cover all cases. I have doubts that this makes
sense.

> (as a side note it's interesting because this "CRSF" in GnuPG would not send any
> cookies and the attack described in the advisory shows rather an issue with the
> receiving app, not GnuPG... but that's a side note...)

The example they give is that in the internal network you have an server
which controls, say, a chemical plant. That server has only IP based
authentication and allows to open all kind of valves just be a HTTP
request. Someone inside of example.org sends a mail to an outsider and
the MUA automatically encrypts to that outsider. In the course of that
a http request is sent to the outsider's domain and that replies with a
302 and a malicious Location header. bang. A bit far-fetched, but we
better inhibit this.


Shalom-Salam,

Werner

--
Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz.
Re: Web Key Directory - HTTP Redirect? [ In reply to ]
On 18.12.2018 08:09, Werner Koch wrote:
> The example they give is that in the internal network you have an server
> which controls, say, a chemical plant. That server has only IP based
> authentication and allows to open all kind of valves just be a HTTP
> request. Someone inside of example.org sends a mail to an outsider and
> the MUA automatically encrypts to that outsider. In the course of that
> a http request is sent to the outsider's domain and that replies with a
> 302 and a malicious Location header. bang. A bit far-fetched, but we
> better inhibit this.

Yes, agreed, especially that the change doesn't break common redirects (like
bare domain to "www" subdomain etc.)

Still the "has only IP based authentication" problem strikes me as extremely
easy to mount anyway without GnuPG e.g. by embedding <img
src="http://internal/launch-nukes?confirm=yes"> in a webpage or in an e-mail.

Thanks for taking the time to explain the attack!

Kind regards,
Wiktor

--
https://metacode.biz/@wiktor

_______________________________________________
Gnupg-devel mailing list
Gnupg-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-devel