Open bmohanr-techie opened 2 years ago
@zcool321 This pull request #47 fixes issues #39 and #42 . Please review.
@zcool321 Can you please review this pull request #47 ? Thanks.
您好,您的来信我已收到!谢谢! Best Wishes! ——孔祥亮
@zcool321 Can you please let me know if you had a chance to review this pull request https://github.com/jflyfox/jfinal_cms/pull/47 ? Thanks.
@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.
您好,您的来信我已收到!谢谢! Best Wishes! ——孔祥亮
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.