github-advanced-security[bot] commented on code in PR #44:
URL:
https://github.com/apache/sling-org-apache-sling-auth-oauth-client/pull/44#discussion_r2919074357
##########
src/main/java/org/apache/sling/auth/oauth_client/impl/JcrUserHomeOAuthTokenStore.java:
##########
@@ -152,6 +155,74 @@
}
}
+ @Override
+ public @Nullable String getIdToken(
+ @NotNull ClientConnection connection, @NotNull Session
serviceSession, @NotNull String userId)
+ throws OAuthException {
+ // Sanitize userId for safe logging (prevents log injection)
+ String safeUserId = userId.replace('\n', '_').replace('\r', '_');
+ try {
Review Comment:
## Logging should not be vulnerable to injection attacks
<!--SONAR_ISSUE_KEY:AZzdBleJtA1YQKqeIBTD-->Change this code to not log
user-controlled data. <p>See more on <a
href="https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-auth-oauth-client&issues=AZzdBleJtA1YQKqeIBTD&open=AZzdBleJtA1YQKqeIBTD&pullRequest=44">SonarQube
Cloud</a></p>
[Show more
details](https://github.com/apache/sling-org-apache-sling-auth-oauth-client/security/code-scanning/8)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]