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

Update UserController.java #38

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Update UserController.java #38

wants to merge 5 commits into from

Conversation

sa-ny
Copy link
Owner

@sa-ny sa-ny commented Oct 9, 2024

No description provided.

Copy link

github-actions bot commented Oct 9, 2024

Caution

Breaking Flaws identified in code!

Fixes for test/src/main/java/com/veracode/verademo/controller/UserController.java:
Falws found for this file:
CWE 117 - Improper Output Neutralization for Logs - Severity 3 on line 47 for issue 1086

Fix suggestions:

--- test/src/main/java/com/veracode/verademo/controller/UserController.java
+++ test/src/main/java/com/veracode/verademo/controller/UserController.java
@@ -11,6 +11,7 @@
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
+import org.apache.commons.text.StringEscapeUtils;
 
 /**
  * @author johnadmin
@@ -44,7 +45,7 @@
 		}
 		//...
 
-		logger.info("Entering showLogin with username " + username + " and target " + target);
+		logger.info("Entering showLogin with username " + StringEscapeUtils.escapeJava(username) + " and target " + target);
 
 		model.addAttribute("username", username);
 		model.addAttribute("target", target);

Veracode Fix Bot and others added 3 commits October 9, 2024 12:26
Copy link

github-actions bot commented Oct 9, 2024

Caution

Breaking Flaws identified in code!

Fixes for test/src/main/java/com/veracode/verademo/controller/UserController.java:
Falws found for this file:
CWE 117 - Improper Output Neutralization for Logs - Severity 3 on line 48 for issue 1086

Fix suggestions:

--- test/src/main/java/com/veracode/verademo/controller/UserController.java
+++ test/src/main/java/com/veracode/verademo/controller/UserController.java
@@ -45,7 +45,7 @@
 		}
 		//...
 
-		logger.info("Entering showLogin with username " + StringEscapeUtils.escapeJava(username) + " and target " + target);
+		logger.info("Entering showLogin with username " + StringEscapeUtils.escapeJava(StringEscapeUtils.escapeJava(username)) + " and target " + target);
 
 		model.addAttribute("username", username);
 		model.addAttribute("target", target);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant