<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body><div>Can you send me, off list, transcripts of the http transactions?&nbsp;</div><div><br></div><div><br></div><div><br></div><div id="composer_signature"><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><div style="font-size:85%;color:#575757">--Justin</div><div style="font-size:85%;color:#575757"><br></div><div style="font-size:85%;color:#575757">&nbsp;<i>Sent from my phone</i></div></div><div><br></div><div style="font-size:100%;color:#000000"><!-- originalMessage --><div>-------- Original message --------</div><div>From: Luiz Omori &lt;luiz.omori@duke.edu&gt; </div><div>Date: 7/10/17  9:08 AM  (GMT-05:00) </div><div>To: Justin Richer &lt;jricher@mit.edu&gt; </div><div>Cc: mitreid-connect@mit.edu </div><div>Subject: Re: [mitreid-connect] Client credentials security issue? </div><div><br></div></div>
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">I can reproduce this behaviour with
<a href="https://mitreid.org">https://mitreid.org</a>.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><o:p>&nbsp;</o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><!--[if !supportLists]--><span style="font-size:11.0pt;font-family:Calibri"><span style="mso-list:Ignore">1.<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><!--[endif]--><span style="font-size:11.0pt;font-family:Calibri">Perform Authorization Code flow to successfully acquire an access token. Not sure if it matters, but I’ve created my own client, Duke.<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><!--[if !supportLists]--><span style="font-size:11.0pt;font-family:Calibri"><span style="mso-list:Ignore">2.<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><!--[endif]--><span style="font-size:11.0pt;font-family:Calibri">Perform client credentials using the same client above. Server responded with an ID Token. My request didn’t contain any scopes.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">Yes, I had seen the exact line of code you are talking about. It could be a problem in my environment, but I didn’t see it being hit for the client credentials flow when I was debugging
 my local instance.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">Luiz<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><o:p>&nbsp;</o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-family:Calibri;color:black">From: </span>
</b><span style="font-family:Calibri;color:black">Justin Richer &lt;jricher@mit.edu&gt;<br>
<b>Date: </b>Friday, July 7, 2017 at 5:36 PM<br>
<b>To: </b>Luiz Omori &lt;luiz.omori@duke.edu&gt;<br>
<b>Cc: </b>"mitreid-connect@mit.edu" &lt;mitreid-connect@mit.edu&gt;<br>
<b>Subject: </b>Re: [mitreid-connect] Client credentials security issue?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<p class="MsoNormal">I just tried this on the&nbsp;<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__mitreid.org&amp;d=DwMFaQ&amp;c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&amp;r=R6m41WT3w_KtulQAsSIxc_C2mwuKoWSycEMpss0QQJA&amp;m=uke5BTnN2wjpd6gKBTPKqgofFvPI-7IDTsHjji5CIYU&amp;s=z5nd_a4EUNIWWgh52HcYNXOPaygCp3jwzRmSu3Qi-YE&amp;e=">mitreid.org</a>&nbsp;test
 server and I couldn’t replicate it. Then I checked the code and what you’re describing is prevented by this line in&nbsp;<span style="font-size:8.5pt;font-family:Monaco">ConnectTokenEnhancer</span>:<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:8.5pt;font-family:Monaco;color:#931A68">if</span><span style="font-size:8.5pt;font-family:Monaco"> (<span style="color:#7E504F">originalAuthRequest</span>.getScope().contains(SystemScopeService.<span style="color:#0326CC">OPENID_SCOPE</span>)<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:8.5pt;font-family:Monaco">&amp;&amp; !<span style="color:#7E504F">authentication</span>.isClientOnly()) {<o:p></o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">If you do get an ID token at all through some fluke, it should refer to the client that authenticated, as that’s the authenticated “user” in that scenario. Same deal with token introspection of access tokens.&nbsp;<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">&nbsp;— Justin<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">On Jul 7, 2017, at 4:26 PM, Luiz Omori &lt;<a href="mailto:luiz.omori@duke.edu">luiz.omori@duke.edu</a>&gt; wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:11.0pt;font-family:Calibri">Hi,</span><span style="font-family:Calibri"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:11.0pt;font-family:Calibri">&nbsp;</span><span style="font-family:Calibri"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:11.0pt;font-family:Calibri">I’ve just run by chance into a suspicious behaviour while exercising the Client Credentials flow. Along with the request I’ve sent scope=openid offline_access.
 Interesting enough, I got an id_token back. That id-token was referring to a user that I used for an Authorization Code request done immediately before the Client Credentials call. My usage of scope for the Client Credentials may or may not be legal, but in
 any case I don’t think the server should be sending an ID Token back for Client Credentials. I’m using server version 1.3.1.</span><span style="font-family:Calibri"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:11.0pt;font-family:Calibri">&nbsp;</span><span style="font-family:Calibri"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:11.0pt;font-family:Calibri">Regards,</span><span style="font-family:Calibri"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:11.0pt;font-family:Calibri">Luiz</span><span style="font-family:Calibri"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:Helvetica;background:white">_______________________________________________</span><span style="font-size:9.0pt;font-family:Helvetica"><br>
<span style="background:white">mitreid-connect mailing list</span><br>
</span><a href="mailto:mitreid-connect@mit.edu"><span style="font-size:9.0pt;font-family:Helvetica;color:#954F72;background:white">mitreid-connect@mit.edu</span></a><span style="font-size:9.0pt;font-family:Helvetica"><br>
</span><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.mit.edu_mailman_listinfo_mitreid-2Dconnect&amp;d=DwMFaQ&amp;c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&amp;r=R6m41WT3w_KtulQAsSIxc_C2mwuKoWSycEMpss0QQJA&amp;m=uke5BTnN2wjpd6gKBTPKqgofFvPI-7IDTsHjji5CIYU&amp;s=FzfiqkrzHX9g0M1w3fRW7R60mCOgNwyH6aU6jUGKmoQ&amp;e="><span style="font-size:9.0pt;font-family:Helvetica;color:#954F72;background:white">http://mailman.mit.edu/mailman/listinfo/mitreid-connect</span></a><o:p></o:p></p>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</div>
</div>
</body></html>