-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
kadraman
committed
Nov 4, 2024
1 parent
d4e4f19
commit 934f055
Showing
2 changed files
with
11 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,6 +97,15 @@ public ResponseEntity<String> getKeywordsContent(@Param("keywords") String keywo | |
return ResponseEntity.ok().body(retContent); | ||
} | ||
|
||
@GetMapping("/xss-test") | ||
@ResponseBody | ||
public ResponseEntity<String> getSearchResults(@Param("keywords") String keywords) { | ||
|
||
String retContent = "Product search using: " + keywords; | ||
|
||
return ResponseEntity.ok().body(retContent); | ||
Check warning Code scanning / Fortify on Demand Cross-Site Scripting: Reflected Warning
The method getKeywordsContent() in ProductController.java sends unvalidated data to a web browser on line 97, which can result in the browser executing malicious code. More information
|
||
} | ||
|
||
@GetMapping(value = {"", "/"}) | ||
public String index(Model model, @Param("keywords") String keywords, @Param("limit") Integer limit, Principal principal) { | ||
log.debug("Searching for products using keywords: " + ((keywords == null || keywords.isEmpty()) ? "none" : keywords)); | ||
|