Skip to content
Open
Show file tree
Hide file tree
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 @@ -164,6 +164,15 @@
return "user/home";
}

@GetMapping("/xss")
@ResponseBody
public ResponseEntity<String> getUserContent(@Param("keywords") String keywords) {

String retContent = "User search using: " + keywords;

return ResponseEntity.ok().body(retContent);

Check failure

Code scanning / Fortify on Demand

Cross-Site Scripting: Reflected Critical

The method getUserContent() in UserController.java sends unvalidated data to a web browser on line 173, which can result in the browser executing malicious code. More information
}

@GetMapping(value = {"/profile"})
public String userProfile(Model model, Principal principal) {
CustomUserDetails user = (CustomUserDetails) ((Authentication) principal).getPrincipal();
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/user/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<h1 class="display-4">Hello, <span th:text="${fullname}"></span></h1>
<p class="lead">
Welcome back to IWA Pharmacy Direct. This is your home page where you can check the status of your orders,
view any messages and update your profile.</p>
view any messages and update your <a th:href="@{/user/xss}">profile</a>.</p>
<hr class="my-4">

<div class="col-md-12">
Expand Down
Loading