<div dir="ltr">Correct me if I'm wrong but couldn't *all* endpoints be man-in-the-middled?<div><br></div><div>First, using a discovery document where only the token endpoint is changed (as suggested in the OP, and in [1]), clients could possibly detect the "attack" by comparing the endpoints domain names, or even DNS registration infos and/or TLS certificate infos.</div><div>The attacker could/would then change all endpoints to proxy them all, and in this case the attack is "visible" if you look at the requests made by the user's browser, but in practice "invisible" as the malicious authorization endpoint would transparently redirect to the "honest" one.</div><div>Sending any kind of "secret" or "constant value" wouldn't change anything then, as the attacker could transparently replace it (as it'd intercept all requests).</div><div>And the keys of the client aren't of much help either as the attacker could also proxy the registration endpoint.</div><div>All of this would make the attacker more "visible", but who would notice it in practice? (or more accurately: it could intercept many requests –and grab private information and/or do harm– before being detected).<br><br>[1] <a href="http://web-in-security.blogspot.fr/2015/10/attacking-openid-connect-10-malicious.html">http://web-in-security.blogspot.fr/2015/10/attacking-openid-connect-10-malicious.html</a></div><div><br><div class="gmail_quote"><div dir="ltr">On Mon, Nov 2, 2015 at 3:26 AM John Bradley <<a href="mailto:ve7jtb@ve7jtb.com">ve7jtb@ve7jtb.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">The attack is not on the authentication, it is on intercepting the code and being able to replay it.<div><br></div><div>Using a key the client is given from registration to authenticate the request to the token endpoint won’t help because that can just be man in the middled by the attacker as well.</div><div><br></div><div>This is also not specific to dynamic client registration. It just makes it easier. I could make the client come to a site to register and give it bad endpoints as well.</div><div><br></div><div>In Connect if you do a id_token code flow the issuer in the returned token would be wrong for the request so that should actually stop the attack on a client that is validating id_token correctly in that flow. (allowing late binding per one proposal will make this vulnerable as well I think.</div><div><br></div><div>In the code only flow it is much harder to stop because the attacker can register itself and then replay any keys it gets from the real AS.</div><div>If the client provides a public key in registration that would help if we used signed requests.</div><div><br></div><div>To stop the attack you really need to send the token endpoint URI in the request to the Authorization server, or use a asymmetric pkce challenge verifier.</div><div><br></div><div>I haven’t had a chance to organize the options yet.</div><div><br></div><div>John B.</div></div><div style="word-wrap:break-word"><div><br></div><div><br></div><div><br></div><div><div><blockquote type="cite"><div>On Oct 31, 2015, at 5:14 AM, Mike Jones <<a href="mailto:Michael.Jones@microsoft.com" target="_blank">Michael.Jones@microsoft.com</a>> wrote:</div><br><div>
<div style="word-wrap:break-word;font-size:14px;font-family:Calibri,sans-serif">
<div>
<div style="font-family:Calibri,sans-serif;font-size:11pt">The other thing that can't be faked by an attacker is the OP's keys. If the ID token isn't signed by the right keys, then the RP knows that there's a problem. This points to a possible solution involving
authenticating the jwks_uri value.<br>
<br>
Remember also that the Implicit flows don't use a token endpoint. So solutions that involve authenticating the token endpoint won't work for deployments using only Implicit flows.<br>
<br>
John, Justin, and Nov, when you send in your IIW session notes, can you also please send them here?<br>
<br>
Thanks,<br>
-- Mike</div>
</div>
<div dir="ltr">
<hr>
<span style="font-family:Calibri,sans-serif;font-size:11pt;font-weight:bold">From:
</span><span style="font-family:Calibri,sans-serif;font-size:11pt"><a href="mailto:Sascha.Preibisch@ca.com" target="_blank">Preibisch, Sascha H</a></span><br>
<span style="font-family:Calibri,sans-serif;font-size:11pt;font-weight:bold">Sent:
</span><span style="font-family:Calibri,sans-serif;font-size:11pt">10/30/2015 1:00 PM</span><br>
<span style="font-family:Calibri,sans-serif;font-size:11pt;font-weight:bold">To:
</span><span style="font-family:Calibri,sans-serif;font-size:11pt"><a href="mailto:openid-specs-ab@lists.openid.net" target="_blank">openid-specs-ab@lists.openid.net</a></span><br>
<span style="font-family:Calibri,sans-serif;font-size:11pt;font-weight:bold">Subject:
</span><span style="font-family:Calibri,sans-serif;font-size:11pt">[Openid-specs-ab] Securing token requests when discovery service is used</span><br>
<br>
</div>
<div>
<div>
<div style="font-family:Consolas,monospace;font-size:12px">Hi!</div>
<div style="font-family:Consolas,monospace;font-size:12px"><br>
</div>
<div style="font-family:Consolas,monospace;font-size:12px">Now that IIW is over I would like to bring up my thoughts regarding the</div>
<div style="font-family:Consolas,monospace;font-size:12px">session we had with John regarding the discovery service issue.</div>
<div style="font-family:Consolas,monospace;font-size:12px"><br>
</div>
<div style="font-family:Consolas,monospace;font-size:12px">If I am the 'bad' discovery service provider I can fake all values within</div>
<div style="font-family:Consolas,monospace;font-size:12px">the discovery response. Except for the /token endpoint. That has to point</div>
<div style="font-family:Consolas,monospace;font-size:12px">to my system in order for me to receive the authorization_code and client</div>
<div style="font-family:Consolas,monospace;font-size:12px">credentials.</div>
<div style="font-family:Consolas,monospace;font-size:12px"><br>
</div>
<div style="font-family:Consolas,monospace;font-size:12px">Therefore I believe there are two solutions:</div>
<div style="font-family:Consolas,monospace;font-size:12px"><br>
</div>
<div style="font-family:Consolas,monospace;font-size:12px">* the discovery response to the client has to include a secret which has to be included</div>
<div style="font-family:Consolas,monospace;font-size:12px">in the initial /authorize request. The authorization server validates the</div>
<div style="font-family:Consolas,monospace;font-size:12px">value and fails the request if it is invalid. This of course has the</div>
<div style="font-family:Consolas,monospace;font-size:12px">drawback that the authorization server has to keep state. As a server guy</div>
<div style="font-family:Consolas,monospace;font-size:12px">I would not like to support this flow</div>
<div style="font-family:Consolas,monospace;font-size:12px"><br>
</div>
<div style="font-family:Consolas,monospace;font-size:12px">* The better solution I see, and as I mentioned during the discussion, is</div>
<div style="font-family:Consolas,monospace;font-size:12px">that the client should include the target /token endpoint as an additional</div>
<div style="font-family:Consolas,monospace;font-size:12px">request parameter for the initial /authorize request. The authorization</div>
<div style="font-family:Consolas,monospace;font-size:12px">server does a simple string comparison and fails if the /token endpoint is</div>
<div style="font-family:Consolas,monospace;font-size:12px">not the one as expected</div>
<div style="font-family:Consolas,monospace;font-size:12px"><br>
</div>
<div style="font-family:Consolas,monospace;font-size:12px">Regards,</div>
<div style="font-family:Consolas,monospace;font-size:12px">Sascha</div>
</div>
</div>
</div>
_______________________________________________<br>Openid-specs-ab mailing list<br><a href="mailto:Openid-specs-ab@lists.openid.net" target="_blank">Openid-specs-ab@lists.openid.net</a><br><a href="http://lists.openid.net/mailman/listinfo/openid-specs-ab" target="_blank">http://lists.openid.net/mailman/listinfo/openid-specs-ab</a><br></div></blockquote></div><br></div></div>_______________________________________________<br>
Openid-specs-ab mailing list<br>
<a href="mailto:Openid-specs-ab@lists.openid.net" target="_blank">Openid-specs-ab@lists.openid.net</a><br>
<a href="http://lists.openid.net/mailman/listinfo/openid-specs-ab" rel="noreferrer" target="_blank">http://lists.openid.net/mailman/listinfo/openid-specs-ab</a><br>
</blockquote></div></div></div>