github-advanced-security[bot] commented on code in PR #19:
URL: 
https://github.com/apache/sling-org-apache-sling-auth-core/pull/19#discussion_r2018760967


##########
src/main/java/org/apache/sling/auth/core/AuthUtil.java:
##########
@@ -817,16 +807,21 @@
             return false;
         }
 
-        if (target.contains("//") || target.contains("/../") || 
target.contains("/./") || target.endsWith("/.")
-            || target.endsWith("/..")) {
+        if (target.contains("//")
+                || target.contains("/../")
+                || target.contains("/./")
+                || target.endsWith("/.")
+                || target.endsWith("/..")) {
             getLog().warn("isRedirectValid: Redirect target '{}' is not 
normalized", target);
             return false;
         }
 
         final String ctxPath = getContextPath(request);
         if (ctxPath.length() > 0 && !target.startsWith(ctxPath)) {
-            getLog().warn("isRedirectValid: Redirect target '{}' does not 
start with servlet context path '{}'",
-                target, ctxPath);
+            getLog().warn(
+                            "isRedirectValid: Redirect target '{}' does not 
start with servlet context path '{}'",
+                            target,
+                            ctxPath);

Review Comment:
   ## Logging should not be vulnerable to injection attacks
   
   <!--SONAR_ISSUE_KEY:AZXdGFAq6uXFCZjSM3NP-->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-core&issues=AZXdGFAq6uXFCZjSM3NP&open=AZXdGFAq6uXFCZjSM3NP&pullRequest=19";>SonarQube
 Cloud</a></p>
   
   [Show more 
details](https://github.com/apache/sling-org-apache-sling-auth-core/security/code-scanning/6)



##########
src/main/java/org/apache/sling/auth/core/AuthUtil.java:
##########
@@ -917,16 +913,21 @@
             return false;
         }
 
-        if (target.contains("//") || target.contains("/../") || 
target.contains("/./") || target.endsWith("/.")
-            || target.endsWith("/..")) {
+        if (target.contains("//")
+                || target.contains("/../")
+                || target.contains("/./")
+                || target.endsWith("/.")
+                || target.endsWith("/..")) {
             getLog().warn("isRedirectValid: Redirect target '{}' is not 
normalized", target);
             return false;
         }
 
         final String ctxPath = getContextPath(request);
         if (ctxPath.length() > 0 && !target.startsWith(ctxPath)) {
-            getLog().warn("isRedirectValid: Redirect target '{}' does not 
start with servlet context path '{}'",
-                target, ctxPath);
+            getLog().warn(
+                            "isRedirectValid: Redirect target '{}' does not 
start with servlet context path '{}'",
+                            target,
+                            ctxPath);

Review Comment:
   ## Logging should not be vulnerable to injection attacks
   
   <!--SONAR_ISSUE_KEY:AZXdGFAq6uXFCZjSM3NU-->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-core&issues=AZXdGFAq6uXFCZjSM3NU&open=AZXdGFAq6uXFCZjSM3NU&pullRequest=19";>SonarQube
 Cloud</a></p>
   
   [Show more 
details](https://github.com/apache/sling-org-apache-sling-auth-core/security/code-scanning/11)



-- 
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: dev-unsubscr...@sling.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to