Skip to content

Conversation

@bmohanr-techie
Copy link

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.

…ary 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: &quot;bread&quot; &amp; &quot;butter&quot;. unescapeHtml(): Unescapes a string containing entity escapes to a string containing the actual Unicode characters corresponding to the escapes. For example, the string &lt;Fran&ccedil;ais&gt; 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.
@bmohanr-techie
Copy link
Author

@zcool321 This pull request #47 fixes issues #39 and #42 . Please review.

@bhmohanr-techie
Copy link

@zcool321 Can you please review this pull request #47 ? Thanks.

@ElevenKong
Copy link

ElevenKong commented Aug 27, 2022 via email

@bhmohanr-techie
Copy link

@zcool321 Can you please let me know if you had a chance to review this pull request #47 ? Thanks.

@bhmohanr-techie
Copy link

@zcool321 Hi George, Hope you are doing good. Could you please review the pull request #47 that I raised few weeks back, to fix a recently reported vulnerability (CVE-2022-33113, refer issue #39 )?

Please let me know, if you need any additional info, I will be happy to get you the same. Thanks.

@ElevenKong
Copy link

ElevenKong commented Sep 17, 2022 via email

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.

3 participants