Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AM SA #201901-07] Business Logic Vulnerability #136

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* $Id: AMAccountLockout.java,v 1.10 2009/03/06 22:09:20 hengming Exp $
*
* Portions Copyrighted 2013-2016 ForgeRock AS.
* Portions Copyrighted 2023 Wren Security
*/
package com.sun.identity.authentication.service;

Expand Down Expand Up @@ -117,14 +118,8 @@ public void invalidPasswd(String username) {
if (!isAccountLockout.isLockoutEnabled()) {
DEBUG.message("Failure lockout mode disabled");
} else {
String userDN;
AMIdentity amIdentity = null;
if (isAccountLockout.getStoreInvalidAttemptsInDS() || !isAccountLockout.isMemoryLocking()) {
amIdentity = AuthD.getAuth().getIdentity(IdType.USER, username, loginState.getOrgDN());
userDN = normalizeDN(IdentityUtils.getDN(amIdentity));
} else {
userDN = normalizeDN(username);
}
AMIdentity amIdentity = AuthD.getAuth().getIdentity(IdType.USER, username, loginState.getOrgDN());
String userDN = normalizeDN(IdentityUtils.getDN(amIdentity));
if (acInfo == null) {
acInfo = isAccountLockout.getAcInfo(userDN, amIdentity);
}
Expand Down Expand Up @@ -190,13 +185,8 @@ public void resetPasswdLockout(String token, boolean resetDuration) {
// remove the hash entry for login failure for tokenID
String userDN = null;
if (token != null) {
AMIdentity amIdentity = null;
if (isAccountLockout.getStoreInvalidAttemptsInDS()) {
amIdentity = AuthD.getAuth().getIdentity(IdType.USER, token, loginState.getOrgDN());
userDN = normalizeDN(IdentityUtils.getDN(amIdentity));
} else {
userDN = normalizeDN(token);
}
AMIdentity amIdentity = AuthD.getAuth().getIdentity(IdType.USER, token, loginState.getOrgDN());
userDN = normalizeDN(IdentityUtils.getDN(amIdentity));

if (acInfo == null) {
acInfo = isAccountLockout.getAcInfo(userDN, amIdentity);
Expand Down Expand Up @@ -260,14 +250,8 @@ public boolean isLockedOut(String userName) {
private boolean isMemoryLockout(String aUserName) {
boolean locked = false;
try {
String userDN;
AMIdentity amIdentity = null;
if (isAccountLockout.getStoreInvalidAttemptsInDS()) {
amIdentity = AuthD.getAuth().getIdentity(IdType.USER, aUserName, loginState.getOrgDN());
userDN = normalizeDN(IdentityUtils.getDN(amIdentity));
} else {
userDN = aUserName;
}
AMIdentity amIdentity = AuthD.getAuth().getIdentity(IdType.USER, aUserName, loginState.getOrgDN());
String userDN = normalizeDN(IdentityUtils.getDN(amIdentity));

if (acInfo == null) {
acInfo = isAccountLockout.getAcInfo(userDN, amIdentity);
Expand Down Expand Up @@ -306,10 +290,7 @@ public boolean isAccountLocked(String aUserName) {
boolean locked = false;
try {
AMIdentity amIdentity = AuthD.getAuth().getIdentity(IdType.USER, aUserName, loginState.getOrgDN());
String userDN = normalizeDN(aUserName);
if (isAccountLockout.getStoreInvalidAttemptsInDS()) {
userDN = normalizeDN(IdentityUtils.getDN(amIdentity));
}
String userDN = normalizeDN(IdentityUtils.getDN(amIdentity));
if (acInfo == null) {
acInfo = isAccountLockout.getAcInfo(userDN, amIdentity);
}
Expand Down