Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 57541 invoked from network); 11 Sep 2005 23:22:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 Sep 2005 23:22:40 -0000 Received: (qmail 63859 invoked by uid 500); 11 Sep 2005 23:22:39 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 63742 invoked by uid 500); 11 Sep 2005 23:22:39 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 63728 invoked by uid 99); 11 Sep 2005 23:22:38 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=SPF_FAIL X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 11 Sep 2005 16:22:37 -0700 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 43D7C29D for ; Mon, 12 Sep 2005 01:22:36 +0200 (CEST) Message-ID: <200518239.1126480956243.JavaMail.jira@ajax.apache.org> Date: Mon, 12 Sep 2005 01:22:36 +0200 (CEST) From: "Alex Karasulu (JIRA)" To: dev@directory.apache.org Subject: [jira] Resolved: (DIREVE-239) Anonymous user may gain access as admin user In-Reply-To: <2113537750.1125449104827.JavaMail.jira@ajax.apache.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DIREVE-239?page=all ] Alex Karasulu resolved DIREVE-239: ---------------------------------- Fix Version: 0.9.3 Resolution: Fixed Committed in revision 280210 here: http://svn.apache.org/viewcvs.cgi?view=rev&rev=280210 > Anonymous user may gain access as admin user > -------------------------------------------- > > Key: DIREVE-239 > URL: http://issues.apache.org/jira/browse/DIREVE-239 > Project: Directory Server > Type: Bug > Versions: 0.9.3 > Reporter: Endi S. Dewata > Assignee: Alex Karasulu > Priority: Blocker > Fix For: 0.9.3 > > Anonymous user may gain access as admin user by specifying java.naming.ldap.version=3 in the JNDI client. > To show the problem, add a print statement in the AuthenticationService.java at line 369: > // perform the authentication > LdapPrincipal authorizationId = authenticator.authenticate( ctx ); > System.out.println("Authorization ID: "+authorizationId); > Start the server, then run the following program: > import junit.framework.TestCase; > import javax.naming.Context; > import javax.naming.NamingEnumeration; > import javax.naming.directory.*; > import java.util.Hashtable; > public class Test extends TestCase { > public void testAnonymousBindWithLDAPVersion3() throws Exception { > String suffix = "dc=apache,dc=org"; > Hashtable env = new Hashtable(); > env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); > env.put(Context.PROVIDER_URL, "ldap://localhost:10389/"); > // env.put("java.naming.ldap.version", "3"); > DirContext ctx = new InitialDirContext(env); > SearchControls sc = new SearchControls(); > sc.setSearchScope(SearchControls.SUBTREE_SCOPE); > NamingEnumeration ne = ctx.search(suffix, "(objectClass=*)", sc); > System.out.println("Search results:"); > int counter = 0; > while (ne.hasMore()) { > SearchResult sr = (SearchResult)ne.next(); > String rdn = sr.getName(); > System.out.println(" - "+("".equals(rdn) ? suffix : rdn+","+suffix)); > counter++; > } > System.out.println("Found "+counter+" entries."); > ctx.close(); > } > } > Without specifying java.naming.ldap.version=3, the user will remain anonymous (empty Authentication ID). However, with java.naming.ldap.version=3, the anonymous user gets authenticated as the admin user without even specifying any password. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira