CVE-2022-33113 - Jfinal CMS v5.1.0 allows attackers to execute arbitrary web scripts or HTML via a crafted payload injected into the keyword text field under the publish blog module. #47
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CVE-2022-33113 - Jfinal CMS v5.1.0 allows attackers to execute arbitrary web scripts or HTML via a crafted payload injected into the keyword text field under the publish blog module.
Steps to reproduce: As per the info found in vulnerability: There is a stored XSS vulnerability in JFinal_cms 's publish blog module. An attacker can insert malicious XSS code into the Keyword field. When the user views the content of the article in the foreground, the malicious XSS code is triggered successfully. payload: onmouseover='alert(document.cookie)'
Commit: The fix here is to ensure that the input strings from the portal is sanitized properly to get rid of the html strings/tags. Here, we are making use of Apache common-lang's StringEscapeUtils APIs - escapeHtml() and unescapeHtml(). escapeHtml(): Escapes the characters in a String using HTML entities. For example: bread & butter becomes: "bread" & "butter". unescapeHtml(): Unescapes a string containing entity escapes to a string containing the actual Unicode characters corresponding to the escapes. For example, the string <Français> will become <Français>.
Fixed in AlertController and PersonController classes in com.jflyfox.modules.front.controller package. Also, HtmlUtils class will now expose two utility methods - escapeHtml() and unescapeHtml(), which can be used if required else where. The changes are added here to make use of the escapeHtml() and unescapeHtml() in HtmlUtils class for strings specified in Topic and Keyword fields.
Verified that the XSS vulnerability is no more applicable for Topic and Keyword fields. Verified the fix in Chrome, Mozilla and Firefox browsers.