feat(jans-auth-server): sanitized log in AuthenticationService #12958 by yuriyz · Pull Request #12959 · JanssenProject/jans (original) (raw)

422-423: Potential incomplete sanitization: keyValue might be sensitive.

The keyValue parameter in this debug log likely contains a username and should be sanitized for consistency with the PR's security objectives.

🔒 Suggested sanitization


572-573: Potential incomplete sanitization: attributeValue might contain sensitive data.

The attributeValue in getUserByAttribute could be a username when the attributeName is a username field (like "uid"). Consider sanitizing for completeness.

🔒 Suggested sanitization


605-605: Inconsistent sanitization: userId logged without sanitization.

The user.getUserId() is logged in this warning message without sanitization, while similar userId logging elsewhere in the file has been sanitized.

🔒 Suggested sanitization


641-641: Inconsistent sanitization: userId logged without sanitization.

The user.getUserId() is logged in this error message without sanitization, while similar userId logging elsewhere has been sanitized.

🔒 Suggested sanitization


653-653: Inconsistent sanitization: sessionAuthUser (username) logged without sanitization.

The sessionAuthUser variable contains a username from session attributes and should be sanitized for consistency.

🔒 Suggested sanitization


669-669: Inconsistent sanitization: userId logged without sanitization.

The user.getUserId() is logged without sanitization, while similar logging has been sanitized elsewhere in this file.

🔒 Suggested sanitization


740-741: Consider sanitizing clientInum for consistency.

The clientInum variable comes from credentials.getUsername() (line 739) and is logged without sanitization. While this appears to be for client authentication rather than user authentication, consider sanitizing it for consistency with the security objectives of this PR.

🔒 Suggested sanitization


1-905: Multiple instances of unsanitized username logging require sanitization.

The code contains several log statements that expose usernames and user identifiers without proper sanitization:

Wrap these values with sanitizeUsernameForLog() to prevent usernames from appearing in logs, consistent with existing sanitization at lines 120, 155, 222, 234, 376, 396, 427, 482, and 767.