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
2026年1月
Fetch the repository succeeded.
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
2
Star
1
Fork
1
高仿开源中国
/
ruoyiruoyi
Code
Issues
1
Pull Requests
1
Wiki
Insights
Pipelines
Service
JavaDoc
PHPDoc
Quality Analysis
Jenkins for Gitee
Tencent CloudBase
Tencent Cloud Serverless
悬镜安全
Aliyun SAE
Codeblitz
SBOM
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.
[Security] CVE-2024-56337 - Apache Tomcat 安全漏洞
新建
#I4AIB
Bug
安安
Opened this issue
2025-07-24 11:08
## 漏洞概览 (Overview) - **CVE编号**: CVE-2024-56337 - **漏洞标题**: Apache Tomcat 安全漏洞 - **危险等级**: 危急 - **CVSS3评分**: 9.8 - **发布信息**: Time-of-check Time-of-use (TOCTOU) Race Condition vulnerability in Apache Tomcat. This issue affects Apache Tomcat: from 11.0.0-M1 through 11.0.1, from 10.1.0-M1 through 10.1.33, from 9.0.0.M1 through 9.0.97. The mitigation for CVE-2024-50379 was incomplete. Users running Tomcat on a case insensitive file system with the default servlet write enabled (readonly initialisation parameter set to the non-default value of false) may need additional configuration to fully mitigate CVE-2024-50379 depending on which version of Java they are using with Tomcat: - running on Java 8 or Java 11: the system property sun.io.useCanonCaches must be explicitly set to false (it defaults to true) - running on Java 17: the system property sun.io.useCanonCaches, if set, must be set to false (it defaults to false) - running on Java 21 onwards: no further configuration is required (the system property and the problematic cache have been removed) Tomcat 11.0.3, 10.1.35 and 9.0.99 onwards will include checks that sun.io.useCanonCaches is set appropriately before allowing the default servlet to be write enabled on a case insensitive file system. Tomcat will also set sun.io.useCanonCaches to false by default where it can. ## AI分析总结 (AI Analysis) CVE-2024-56337 是 Apache Tomcat 在处理文件上传时存在的「检查时-使用时」(TOCTOU) 竞态条件漏洞。由于之前 CVE-2024-50379 的补丁不完整,在「大小写不敏感文件系统」且「DefaultServlet 写权限开启」(readonly=false) 的场景下,攻击者可在极短时间内替换被检查过的文件路径,从而绕过安全检查、写入恶意文件或覆盖系统文件。CVSS 9.8 分,属于「严重」级别,可导致远程代码执行或服务失陷。 ## 复现步骤 (Reproduction) 前提: - 操作系统文件系统大小写不敏感(Windows NTFS、macOS APFS 默认)。 - Tomcat 9.0.0.M1–9.0.97、10.1.0-M1–10.1.33、11.0.0-M1–11.0.1 中任意版本。 - 默认 DefaultServlet 允许写入(web.xml 中 readonly=false 或未显式配置)。 - 对应 Java 版本 sun.io.useCanonCaches=true(Java 8/11 默认 true;Java 17 若手动设为 true)。 步骤: 1. 部署一个存在漏洞的 Tomcat,并确认以下设置: a. 在 conf/web.xml 中 DefaultServlet 的 `<init-param><param-name>readonly</param-name><param-value>false</param-value></init-param>`。 b. 启动参数未加 `-Dsun.io.useCanonCaches=false`(Java 8/11)。 2. 构造两个并发 PUT 请求: a. 路径 A:`/uploads/test.jsp`(内容为空或无害)。 b. 路径 B:`/uploads/TEST.JSP`(内容为 WebShell)。 3. 使用脚本或 Burp Intruder 以高并发同时上传 A 与 B,使得 Tomcat 在「检查路径」时得到 A,但在「实际写入」瞬间文件已被替换为 B。 4. 若成功,大小写不敏感文件系统会把 `TEST.JSP` 与 `test.jsp` 视为同一文件,WebShell 被写入且可访问,实现远程代码执行。 ## 修复方案 (Solution) 立即修复 - 升级: - Tomcat 9.x → 9.0.99 及以上 - Tomcat 10.1.x → 10.1.35 及以上 - Tomcat 11.x → 11.0.3 及以上 升级后 Tomcat 会自动校验 sun.io.useCanonCaches 并在需要时强制设为 false。 - 临时缓解(若暂时无法升级): - Java 8/11:在启动脚本中添加 `-Dsun.io.useCanonCaches=false` - Java 17:如手动设置了 `sun.io.useCanonCaches=true`,改为 `-Dsun.io.useCanonCaches=false` - Java 21+:无需额外配置。 - 关闭 DefaultServlet 写权限:在 conf/web.xml 或应用 web.xml 中设置 ```xml <init-param> <param-name>readonly</param-name> <param-value>true</param-value> </init-param> ``` 或移除 `webdav` servlet 映射,彻底禁用 HTTP PUT/DELETE。 长期加固 - 文件系统层:在 Linux 上采用大小写敏感文件系统(ext4、xfs),或在 Windows Server 启用 NTFS 区分大小写功能 (`fsutil file setCaseSensitiveInfo`)。 - 网络层:在反向代理(Nginx、Apache httpd)或 WAF 中禁止或严格校验 HTTP PUT/DELETE 方法。 - 监控:对 webapps 目录实施文件完整性监控 (FIM),发现异常上传及时告警。 - 最小权限:Tomcat 进程以最小权限运行,限制对系统目录的写权限。 - 开发规范:禁止业务代码直接操作 webapps 目录,统一使用专门的文件服务或对象存储。 <details> <summary>技术细节 (Technical Details)</summary> - **CVSS2评分**: 0.0 - **CVSS2向量**: - **CVSS3向量**: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - **修复紧急度**: 高优先级 - **建议修复方案**: 建议用户升级版本到9.0.98,10.1.34,或11.0.2及以上。 - **参考链接**: - https://github.com/advisories/GHSA-27hp-xhwr-wr2m - https://nvd.nist.gov/vuln/detail/CVE-2024-56337 - https://lists.apache.org/thread/b2b9qrgjrz1kvo4ym8y2wkfdvwoq6qbp - https://www.cve.org/CVERecord?id=CVE-2024-50379 - https://tomcat.apache.org/security-10.html#Fixed_in_Apache_Tomcat_10.1.34 - https://tomcat.apache.org/security-11.html#Fixed_in_Apache_Tomcat_11.0.2 - https://tomcat.apache.org/security-9.html#Fixed_in_Apache_Tomcat_9.0.98 - https://security.netapp.com/advisory/ntap-20250103-0002 - https://github.com/advisories/GHSA-27hp-xhwr-wr2m </details> > 本报告由安全扫描自动生成并经AI辅助分析
## 漏洞概览 (Overview) - **CVE编号**: CVE-2024-56337 - **漏洞标题**: Apache Tomcat 安全漏洞 - **危险等级**: 危急 - **CVSS3评分**: 9.8 - **发布信息**: Time-of-check Time-of-use (TOCTOU) Race Condition vulnerability in Apache Tomcat. This issue affects Apache Tomcat: from 11.0.0-M1 through 11.0.1, from 10.1.0-M1 through 10.1.33, from 9.0.0.M1 through 9.0.97. The mitigation for CVE-2024-50379 was incomplete. Users running Tomcat on a case insensitive file system with the default servlet write enabled (readonly initialisation parameter set to the non-default value of false) may need additional configuration to fully mitigate CVE-2024-50379 depending on which version of Java they are using with Tomcat: - running on Java 8 or Java 11: the system property sun.io.useCanonCaches must be explicitly set to false (it defaults to true) - running on Java 17: the system property sun.io.useCanonCaches, if set, must be set to false (it defaults to false) - running on Java 21 onwards: no further configuration is required (the system property and the problematic cache have been removed) Tomcat 11.0.3, 10.1.35 and 9.0.99 onwards will include checks that sun.io.useCanonCaches is set appropriately before allowing the default servlet to be write enabled on a case insensitive file system. Tomcat will also set sun.io.useCanonCaches to false by default where it can. ## AI分析总结 (AI Analysis) CVE-2024-56337 是 Apache Tomcat 在处理文件上传时存在的「检查时-使用时」(TOCTOU) 竞态条件漏洞。由于之前 CVE-2024-50379 的补丁不完整,在「大小写不敏感文件系统」且「DefaultServlet 写权限开启」(readonly=false) 的场景下,攻击者可在极短时间内替换被检查过的文件路径,从而绕过安全检查、写入恶意文件或覆盖系统文件。CVSS 9.8 分,属于「严重」级别,可导致远程代码执行或服务失陷。 ## 复现步骤 (Reproduction) 前提: - 操作系统文件系统大小写不敏感(Windows NTFS、macOS APFS 默认)。 - Tomcat 9.0.0.M1–9.0.97、10.1.0-M1–10.1.33、11.0.0-M1–11.0.1 中任意版本。 - 默认 DefaultServlet 允许写入(web.xml 中 readonly=false 或未显式配置)。 - 对应 Java 版本 sun.io.useCanonCaches=true(Java 8/11 默认 true;Java 17 若手动设为 true)。 步骤: 1. 部署一个存在漏洞的 Tomcat,并确认以下设置: a. 在 conf/web.xml 中 DefaultServlet 的 `<init-param><param-name>readonly</param-name><param-value>false</param-value></init-param>`。 b. 启动参数未加 `-Dsun.io.useCanonCaches=false`(Java 8/11)。 2. 构造两个并发 PUT 请求: a. 路径 A:`/uploads/test.jsp`(内容为空或无害)。 b. 路径 B:`/uploads/TEST.JSP`(内容为 WebShell)。 3. 使用脚本或 Burp Intruder 以高并发同时上传 A 与 B,使得 Tomcat 在「检查路径」时得到 A,但在「实际写入」瞬间文件已被替换为 B。 4. 若成功,大小写不敏感文件系统会把 `TEST.JSP` 与 `test.jsp` 视为同一文件,WebShell 被写入且可访问,实现远程代码执行。 ## 修复方案 (Solution) 立即修复 - 升级: - Tomcat 9.x → 9.0.99 及以上 - Tomcat 10.1.x → 10.1.35 及以上 - Tomcat 11.x → 11.0.3 及以上 升级后 Tomcat 会自动校验 sun.io.useCanonCaches 并在需要时强制设为 false。 - 临时缓解(若暂时无法升级): - Java 8/11:在启动脚本中添加 `-Dsun.io.useCanonCaches=false` - Java 17:如手动设置了 `sun.io.useCanonCaches=true`,改为 `-Dsun.io.useCanonCaches=false` - Java 21+:无需额外配置。 - 关闭 DefaultServlet 写权限:在 conf/web.xml 或应用 web.xml 中设置 ```xml <init-param> <param-name>readonly</param-name> <param-value>true</param-value> </init-param> ``` 或移除 `webdav` servlet 映射,彻底禁用 HTTP PUT/DELETE。 长期加固 - 文件系统层:在 Linux 上采用大小写敏感文件系统(ext4、xfs),或在 Windows Server 启用 NTFS 区分大小写功能 (`fsutil file setCaseSensitiveInfo`)。 - 网络层:在反向代理(Nginx、Apache httpd)或 WAF 中禁止或严格校验 HTTP PUT/DELETE 方法。 - 监控:对 webapps 目录实施文件完整性监控 (FIM),发现异常上传及时告警。 - 最小权限:Tomcat 进程以最小权限运行,限制对系统目录的写权限。 - 开发规范:禁止业务代码直接操作 webapps 目录,统一使用专门的文件服务或对象存储。 <details> <summary>技术细节 (Technical Details)</summary> - **CVSS2评分**: 0.0 - **CVSS2向量**: - **CVSS3向量**: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - **修复紧急度**: 高优先级 - **建议修复方案**: 建议用户升级版本到9.0.98,10.1.34,或11.0.2及以上。 - **参考链接**: - https://github.com/advisories/GHSA-27hp-xhwr-wr2m - https://nvd.nist.gov/vuln/detail/CVE-2024-56337 - https://lists.apache.org/thread/b2b9qrgjrz1kvo4ym8y2wkfdvwoq6qbp - https://www.cve.org/CVERecord?id=CVE-2024-50379 - https://tomcat.apache.org/security-10.html#Fixed_in_Apache_Tomcat_10.1.34 - https://tomcat.apache.org/security-11.html#Fixed_in_Apache_Tomcat_11.0.2 - https://tomcat.apache.org/security-9.html#Fixed_in_Apache_Tomcat_9.0.98 - https://security.netapp.com/advisory/ntap-20250103-0002 - https://github.com/advisories/GHSA-27hp-xhwr-wr2m </details> > 本报告由安全扫描自动生成并经AI辅助分析
Comments (
3
)
Sign in
to comment
Status
新建
新建
测试中
Declined
Done
Doing
Assignees
Not set
Labels
Not set
Projects
Unprojected
Unprojected
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 (5)
Tags (29)
master
惹人
aaa
vvv
springboot3
v4.7.9
v4.7.8
v4.7.7
v4.7.6
v4.7.5
v4.7.4
v4.7.3
v4.7.2
v4.7.1
v4.7.0
v4.6.2
v4.6.1
v4.6.0
v4.5.1
v4.5.0
v4.4
v4.3.1
v4.3
v4.2
v4.1
v4.0
v3.4
v3.3
v3.2
v3.1
v3.0
v2.4
v2.3
v2.2
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
Duration
(hours)
参与者(1)
1
https://master.runjs.cn/gigi-two222/ruoyiruoyi.git
git@master.runjs.cn:gigi-two222/ruoyiruoyi.git
gigi-two222
ruoyiruoyi
ruoyiruoyi
Going to Help Center
Search
收不到邮件验证码?点此查看解决方案
收不到验证码?点此解决
报错500
测试编辑器的一些的自动补全
转移企业文档功能
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