Bug 1235616

Summary: Parsing username works incorrectly in LdapExtLoginModule
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Ondrej Lukas <olukas>
Component: SecurityAssignee: Ivo Studensky <istudens>
Status: CLOSED WONTFIX QA Contact: Ondrej Lukas <olukas>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.4.0CC: anmiller, bdawidow, bmaxwell, darran.lofthouse, istudens, pskopek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-06-25 10:48:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ondrej Lukas 2015-06-25 10:27:47 UTC
Option parseUsername from LdapExtLoginModule works with usernameBeginString and usernameEndString which using in code is wrongly implemented in LdapExtLoginModule getUsername() method[1]. This method contains several issues related to this parsing:

1) Even if value of usernameBeginString is not found in username then first part of username with length usernameBeginString.length()-1 is removed.
2) Everything what is in username before first occurrence of usernameBeginString is removed. IMHO usernameBeginString should be first part of username and only then it should be removed.
3) End index of substring from username is obtained from first occurrence of usernameEndString value. IMHO usernameEndString should be last occurrence in username and also it should be end of username and only then it should be removed.

[1] https://github.com/picketbox/picketbox/blob/master/security-jboss-sx/jbosssx/src/main/java/org/jboss/security/auth/spi/LdapExtLoginModule.java#L946

Comment 2 JBoss JIRA Server 2015-08-18 06:41:46 UTC
Bartosz Baranowski <bbaranow> updated the status of jira JBEAP-364 to Coding In Progress

Comment 3 JBoss JIRA Server 2015-08-18 06:42:29 UTC
Bartosz Baranowski <bbaranow> updated the status of jira JBEAP-364 to Open

Comment 4 JBoss JIRA Server 2016-02-05 10:50:00 UTC
Bartosz Baranowski <bbaranow> updated the status of jira JBEAP-364 to Coding In Progress

Comment 5 JBoss JIRA Server 2016-02-05 10:50:18 UTC
Bartosz Baranowski <bbaranow> updated the status of jira JBEAP-364 to Open

Comment 6 JBoss JIRA Server 2016-02-05 10:52:12 UTC
Bartosz Baranowski <bbaranow> updated the status of jira JBEAP-364 to Resolved

Comment 7 JBoss JIRA Server 2016-02-08 11:13:37 UTC
Darran Lofthouse <darran.lofthouse> updated the status of jira JBEAP-364 to Reopened

Comment 8 JBoss JIRA Server 2016-02-09 11:52:19 UTC
Ondrej Lukas <olukas> updated the status of jira JBEAP-364 to Reopened

Comment 9 JBoss JIRA Server 2016-06-14 11:40:20 UTC
Jiri Pallich <jpallich> updated the status of jira JBEAP-364 to Closed