# Git通过错误的配置引用执行任意代码
## 漏洞概述
Git在处理配置文件时,读取配置值时会删除末尾的CRLF,但在写入配置时不会对末尾有CR的值进行引号处理,导致CR在后续读取时丢失。如果子模块路径末尾存在CR,则会导致子模块被检出到错误的位置,可能意外执行子模块中的可执行post-checkout钩子脚本。
## 影响版本
- v2.43.7 之前版本
- v2.44.4 之前版本
- v2.45.4 之前版本
- v2.46.4 之前版本
- v2.47.3 之前版本
- v2.48.2 之前版本
- v2.49.1 之前版本
- v2.50.1 之前版本
## 细节
当Git初始化子模块时,如果子模块路径中包含尾随的CR(回车符),读取路径时会导致CR被删除,这样子模块将会被检出到一个不同的位置。如果在这个新的路径上存在一个指向子模块钩子目录的符号链接,且子模块内包含一个可执行的post-checkout钩子脚本,则在检出后脚本可能会被无意中执行。
## 影响
该问题会导致子模块被错误地检出到另一个位置,如果符号链接的存在,可能导致恶意的post-checkout钩子脚本被意外执行,存在安全风险。该漏洞已在v2.43.7, v2.44.4, v2.45.4, v2.46.4, v2.47.3, v2.48.2, v2.49.1, 和 v2.50.1版本中被修复。
是否为 Web 类漏洞: 否
判断理由:
| # | POC 描述 | 源链接 | 神龙链接 |
|---|---|---|---|
| 1 | Breaking git with a carriage return and cloning RCE | https://github.com/acheong08/CVE-2025-48384 | POC详情 |
| 2 | for CVE-2025-48384 test | https://github.com/fishyyh/CVE-2025-48384 | POC详情 |
| 3 | None | https://github.com/kallydev/cve-2025-48384-hook | POC详情 |
| 4 | None | https://github.com/fishyyh/CVE-2025-48384-POC | POC详情 |
| 5 | None | https://github.com/liamg/CVE-2025-48384-submodule | POC详情 |
| 6 | PoC for CVE-2025-48384 | https://github.com/liamg/CVE-2025-48384 | POC详情 |
| 7 | None | https://github.com/ppd520/CVE-2025-48384 | POC详情 |
| 8 | 漏洞测试 | https://github.com/NigelX/CVE-2025-48384 | POC详情 |
| 9 | None | https://github.com/greatyy/CVE-2025-48384-p | POC详情 |
| 10 | CVE-2025-48384 | https://github.com/testdjshan/CVE-2025-48384 | POC详情 |
| 11 | None | https://github.com/altm4n/cve-2025-48384 | POC详情 |
| 12 | None | https://github.com/altm4n/cve-2025-48384-hub | POC详情 |
| 13 | None | https://github.com/p1026/CVE-2025-48384 | POC详情 |
| 14 | PoC dockerfile image for CVE-2025-48384 | https://github.com/vinieger/vinieger-CVE-2025-48384-Dockerfile | POC详情 |
| 15 | None | https://github.com/ECHO6789/CVE-2025-48384-submodule | POC详情 |
| 16 | None | https://github.com/nguyentranbaotran/cve-2025-48384-poc | POC详情 |
| 17 | None | https://github.com/admin-ping/CVE-2025-48384-RCE | POC详情 |
| 18 | None | https://github.com/simplyfurious/CVE-2025-48384-submodule_test | POC详情 |
| 19 | None | https://github.com/Anezatraa/CVE-2025-48384-submodule | POC详情 |
| 20 | CVE-2025-48384 PoC | https://github.com/IK-20211125/CVE-2025-48384 | POC详情 |
| 21 | None | https://github.com/elprogramadorgt/CVE-2025-48384 | POC详情 |
| 22 | None | https://github.com/rtefx/CVE-2025-48384 | POC详情 |
| 23 | test for CVE-2025-48384 | https://github.com/f1shh/CVE-2025-48384 | POC详情 |
| 24 | PoC for CVE-2025-48384 | https://github.com/fluoworite/CVE-2025-48384 | POC详情 |
| 25 | None | https://github.com/fluoworite/CVE-2025-48384-sub | POC详情 |
| 26 | None | https://github.com/beishanxueyuan/CVE-2025-48384 | POC详情 |
| 27 | None | https://github.com/beishanxueyuan/CVE-2025-48384-test | POC详情 |
| 28 | None | https://github.com/jideasn/cve-2025-48384 | POC详情 |
| 29 | None | https://github.com/testtianmaaaa/CVE-2025-48384 | POC详情 |
| 30 | None | https://github.com/replicatorbot/CVE-2025-48384 | POC详情 |
| 31 | None | https://github.com/replicatorbot/CVE-2025-48384-POC | POC详情 |
| 32 | PoC | https://github.com/eliox01/CVE-2025-48384 | POC详情 |
| 33 | test | https://github.com/wzx5002/CVE-2025-48384 | POC详情 |
| 34 | sub for CVE-2025-48384 | https://github.com/wzx5002/totallynotsuspicious | POC详情 |
| 35 | Breaking git with a carriage return and cloning RCE | https://github.com/butyraldehyde/CVE-2025-48384-PoC | POC详情 |
| 36 | RCE hook | https://github.com/butyraldehyde/CVE-2025-48384-PoC-Part2 | POC详情 |
| 37 | PoC for CVE-2025-48384 | https://github.com/jacobholtz/CVE-2025-48384-poc | POC详情 |
| 38 | None | https://github.com/jacobholtz/CVE-2025-48384-submodule | POC详情 |
| 39 | None | https://github.com/arun1033/CVE-2025-48384 | POC详情 |
| 40 | CVE-2025-48384 Scanner | https://github.com/EdwardYeIntrix/CVE-2025-48384-Scanner | POC详情 |
| 41 | GIT vulnerability | Carriage Return and RCE on cloning | https://github.com/s41r4j/CVE-2025-48384 | POC详情 |
| 42 | CVE-2025-48384-submodule | https://github.com/s41r4j/CVE-2025-48384-submodule | POC详情 |
| 43 | might delete later | https://github.com/airkewld/cve-2025-48384 | POC详情 |
| 44 | will delete later | https://github.com/airkewld/cve-2025-48384-submodule | POC详情 |
| 45 | None | https://github.com/mukesh-610/cve-2025-48384-exploit | POC详情 |
| 46 | None | https://github.com/mukesh-610/cve-2025-48384 | POC详情 |
| 47 | None | https://github.com/MarcoTondolo/cve-2025-48384-poc | POC详情 |
| 48 | None | https://github.com/zr0n/CVE-2025-48384-sub | POC详情 |
| 49 | A proof of concept of remote code execution | https://github.com/zr0n/CVE-2025-48384-main | POC详情 |
| 50 | GIT vulnerability | Carriage Return and RCE on cloning | https://github.com/vignesh21-git/CVE-2025-48384 | POC详情 |
| 51 | Test | https://github.com/vignesh21-git/CVE-2025-48384-submodule | POC详情 |
标题: Arbitrary code execution through broken config quoting · Advisory · git/git · GitHub -- 🔗来源链接
标签:x_refsource_CONFIRM
神龙速读:
### 关键漏洞信息
#### 漏洞标题
- **Arbitrary code execution through broken config quoting**
#### 严重性
- **Severity**: High (8.1/10)
#### 影响版本
- **Affected versions**: <= v2.50.0
#### 修复版本
- **Patched versions**: >= v2.43.7, v2.44.4, v2.45.4, v2.46.4, v2.47.3, v2.48.2, v2.49.1, and v2.50.1
#### 描述与影响
- **Impact**:
- 当读取配置值时,Git会剥离任何尾随的回车和换行符(CRLF)。在写入配置条目时,带有尾随CR的值未被引用,导致在稍后读取配置时丢失CR。当初始化子模块时,如果子模块路径包含尾随CR,则修改后的路径将被读取,导致子模块被检出到错误的位置。如果存在指向修改后路径的符号链接,并且子模块包含可执行的post-checkout钩子脚本,则该脚本可能在检出后无意中执行。
#### 解决方案
- **Workarounds**:
- 升级到最新版本的Git,或避免在不受信任的存储库中递归克隆子模块。
#### 其他信息
- **CVE ID**: CVE-2025-48384
- **CVSS v3 base metrics**:
- Attack vector: Network
- Attack complexity: High
- Privileges required: Low
- User interaction: Required
- Scope: Changed
- Confidentiality: High
- Integrity: High
- Availability: High
暂无评论