jflyfox / jfinal_cms

jfinal cms是一个java开发的功能强大的信息咨询网站,采用了简洁强大的JFinal作为web框架,模板引擎用的是beetl,数据库用mysql,前端bootstrap框架。支持oauth2认证、帐号注册、密码加密、评论及回复,消息提示,网站访问量统计,文章评论数和浏览量统计,回复管理,支持权限管理。后台模块包含:栏目管理,栏目公告,栏目滚动图片,文章管理,回复管理,意见反馈,我的相册,相册管理,图片管理,专辑管理、视频管理、缓存更新,友情链接,访问统计,联系人管理,模板管理,组织机构管理,用户管理,角色管理,菜单管理,数据字典管理。
http://mtg.jflyfox.com/
Apache License 2.0
628 stars 285 forks source 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. #47

Open bmohanr-techie opened 2 years ago

bmohanr-techie commented 2 years ago

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.

bmohanr-techie commented 2 years ago

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

bhmohanr-techie commented 2 years ago

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

ElevenKong commented 2 years ago

您好,您的来信我已收到!谢谢! Best  Wishes!                                 ——孔祥亮

bhmohanr-techie commented 2 years ago

@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.

bhmohanr-techie commented 2 years ago

@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 commented 2 years ago

您好,您的来信我已收到!谢谢! Best  Wishes!                                 ——孔祥亮