Skip to content

Commit

Permalink
#2992 Prevent XSS for body request:
Browse files Browse the repository at this point in the history
- added cases test to BodyXssUtilsTest;
  • Loading branch information
Limraj committed Sep 27, 2024
1 parent da8df63 commit d5f0a2a
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/org/scada_lts/web/security/BodyXssUtilsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,14 @@ public static Collection<Object[]> data() {
" font-size: 2em !important;\n" +
" display: inline-block !important;\n" +
" line-height: 1 !important; \n" +
"}", true},
{"#top-description-container {\n" +
" display: flex;\n" +
" align-items: flex-end;\n" +
" justify-content: center;\n" +
"}", true},
{"#top-description-container {\n" +
" display: flex;\n" +
"}", true}
});
}
Expand Down
30 changes: 30 additions & 0 deletions test/org/scada_lts/web/security/XssUtilsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,36 @@ public static Collection<Object[]> data() {
{"param1=document.location</script>", false},
{"param1=document.location/script>", false},
{"param1=document.location</script", false},
{"#top-description-container {\n" +
" display: flex;\n" +
" align-items: flex-end;\n" +
" justify-content: center;\n" +
"} \n" +
"\n" +
"#top-description-prefix { \n" +
" color: red !important;\n" +
" font-size: 2em !important;\n" +
" margin-left: 0.5em !important;\n" +
" margin-right: 0.5em !important;\n" +
" display: inline-block !important;\n" +
" vertical-align: bottom !important;\n" +
" line-height: 1 !important;\n" +
"} \n" +
"\n" +
"#top-description {\n" +
" color: #39B54A !important;\n" +
" font-size: 2em !important;\n" +
" display: inline-block !important;\n" +
" line-height: 1 !important; \n" +
"}", false},
{"#top-description-container {\n" +
" display: flex;\n" +
" align-items: flex-end;\n" +
" justify-content: center;\n" +
"}", false},
{"#top-description-container {\n" +
" display: flex;\n" +
"}", false}
});
}

Expand Down

0 comments on commit d5f0a2a

Please sign in to comment.