登录
注册
开源
企业版
高校版
搜索
帮助中心
使用条款
关于我们
开源
企业版
高校版
私有云
模力方舟
AI 队友
登录
注册
dasdas
代码拉取完成,页面将自动刷新
捐赠
捐赠前请先登录
取消
前往登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
Watch
不关注
关注所有动态
仅关注版本发行动态
关注但不提醒动态
2
Star
1
Fork
1
高仿开源中国
/
ruoyiruoyi
代码
Issues
1
Pull Requests
1
Wiki
统计
流水线
服务
JavaDoc
PHPDoc
质量分析
Jenkins for Gitee
腾讯云托管
腾讯云 Serverless
悬镜安全
阿里云 SAE
Codeblitz
SBOM
我知道了,不再自动展开
更新失败,请稍后重试!
移除标识
内容风险标识
本任务被
标识为内容中包含有代码安全 Bug 、隐私泄露等敏感信息,仓库外成员不可访问
[Security] CVE-2024-56337 - Apache Tomcat 安全漏洞
新建
#I4AIB
缺陷
安安
创建于
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辅助分析
评论 (
3
)
登录
后才可以发表评论
状态
新建
新建
测试中
已拒绝
已完成
进行中
负责人
未设置
标签
未设置
项目
未立项任务
未立项任务
里程碑
未关联里程碑
未关联里程碑
Pull Requests
未关联
未关联
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
未关联
分支 (5)
标签 (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
开始日期   -   截止日期
-
置顶选项
不置顶
置顶等级:高
置顶等级:中
置顶等级:低
优先级
不指定
严重
主要
次要
不重要
预计工期
(小时)
参与者(1)
1
https://master.runjs.cn/gigi-two222/ruoyiruoyi.git
git@master.runjs.cn:gigi-two222/ruoyiruoyi.git
gigi-two222
ruoyiruoyi
ruoyiruoyi
点此查找更多帮助
搜索帮助
收不到邮件验证码?点此查看解决方案
收不到验证码?点此解决
报错500
测试编辑器的一些的自动补全
转移企业文档功能
评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册