<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)" class="elementToProof">
Hi Ricardo,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)" class="elementToProof">
<div><br>
</div>
<div>Thank you for discovering and reproducing the issue - it looks like JDK-8176553 was incomplete in solving how referrals are limited. At first glance the attached patch (fix + test) looks like a good change to have - I think it is PR worthy :)</div>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)" class="elementToProof">
I've logged a bug for your change - <a href="https://bugs.openjdk.org/browse/JDK-8288895" id="LPlnk116822">
https://bugs.openjdk.org/browse/JDK-8288895</a>.<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)" class="elementToProof">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)" class="elementToProof">
Best,
<div>Aleksei</div>
</div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> core-libs-dev <core-libs-dev-retn@openjdk.org> on behalf of Sean Mullan <sean.mullan@oracle.com><br>
<b>Sent:</b> Friday, June 17, 2022 3:15 PM<br>
<b>To:</b> core-libs-dev <core-libs-dev@openjdk.java.net><br>
<b>Subject:</b> Fwd: Bug JDK-8176553</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">[reposting to core-libs-dev as this is in the JNDI/LDAP component]<br>
<br>
<br>
-------- Forwarded Message --------<br>
Subject: Bug JDK-8176553<br>
Date: Fri, 17 Jun 2022 14:23:11 +0200<br>
From: Ricardo Martin Camarero <rmartinc@redhat.com><br>
To: security-dev@openjdk.org<br>
<br>
Hi!<br>
<br>
I decided to send an email to the security-dev email list as ldap is<br>
involved. Please redirect me to other list if it is not the proper audience.<br>
<br>
The last last days I have faced the same issue that is commented in<br>
JDK-8176553 [1]. Although it is cataloged as fixed in 12, the issue is<br>
not solved in the openjdk master branch yet. You can test with this<br>
simple project [2]. The project is using apache-ds and creating 12<br>
branches with redirects from one to the other. The search should be<br>
limited to 5 hops but you will see that all of them are followed (12).<br>
Therefore, If there are loops, the search hangs indefinitely. So<br>
JDK-8176553 is not fixed completely. You just need `mvn clean test` to<br>
reproduce the problem in that project.<br>
<br>
I have investigated and I think the attached little patch fixes the<br>
issue. Mainly the `LdapReferralException` is not stopping the referral<br>
loop in some situations. I have added a test in the jndi jtreg<br>
test-suite to check everything works OK; `make test<br>
TEST=jtreg:jdk/com/sun/jndi/ldap/ReferralLimitSearchTest.java`<br>
<br>
WDYT? Is the PR worthy?<br>
<br>
Thanks in advance!<br>
<br>
<br>
[1] <a href="https://bugs.openjdk.org/browse/JDK-8176553" data-auth="NotApplicable">
https://bugs.openjdk.org/browse/JDK-8176553</a><br>
[2] <br>
<a href="https://urldefense.com/v3/__https://github.com/rmartinc/apache-ds-referrals__;!!ACWV5N9M2RV99hQ!IZkp5q_gOAeIP8Y9Gvr8aniLloG51lZJwlG1yN6BRDyHHLpyr0W64TDMUPAzoPu7dOBOyJrNcKYmwaOF9REM3oA$" data-auth="NotApplicable">https://urldefense.com/v3/__https://github.com/rmartinc/apache-ds-referrals__;!!ACWV5N9M2RV99hQ!IZkp5q_gOAeIP8Y9Gvr8aniLloG51lZJwlG1yN6BRDyHHLpyr0W64TDMUPAzoPu7dOBOyJrNcKYmwaOF9REM3oA$</a>
<br>
<br>
</div>
</span></font></div>
</body>
</html>