Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2022-45299 PoC — webbrowser 路径遍历漏洞

Source
Associated Vulnerability
Title:webbrowser 路径遍历漏洞 (CVE-2022-45299)
Description:webbrowser是Amod Malviya个人开发者的一个用于在平台上可用的 Web 浏览器中打开 URL 的 Rust 库。 rust-lang webbrowser-rs v0.8.2版本存在安全漏洞,该漏洞源于其IpFile参数允许攻击者通过精心制作的URL实现访问任意文件。
Description
CVE 2022-45299
Readme
# CVE-2022-45299
#Affected Library :

webbrowser.rs before version 0.8.3
https://github.com/amodm/webbrowser-rs

#Summary:

The library fails to validate that the provided input is actually an URL. An attacker in control of an unfiltered URL passed to webbrowser::open(URL) can, therefore, provide a local file path that will be opened in the default explorer or pass one argument to the underlying open command to execute arbitrary registered system commands.

#Details:

webbrowser::open internally calls shellExecuteW passing in the URL as an arg to open for Windows.On windows, the attacker controls the lpFile argument to shellExecuteW which may allow opening arbitrary local files.
If an attacker manages to pass in an URL that is actually a command line switch to open, they may be able to launch arbitrary commands (or do whatever open allows them to do with one argument). For example, webbrowser::open(".") will open Finder in the current working dir. Also you can execute python scripts by just providing the path to the scriptand I managed to do that with any other language compiled or scripting. I couldn't reproduce the issue on linux but local files like /etc/passwd can be loaded by just providing the path to the file.

#vuln code:
![vuln_code](https://user-images.githubusercontent.com/110370549/212315121-08c4d980-d9cc-45ef-8072-9de18cfb312a.png)

#POC:
![rev_shell](https://user-images.githubusercontent.com/110370549/212315100-351e70c4-f58d-472f-aab8-a883469dbafd.png)

File Snapshot

[4.0K] /data/pocs/4a0b9b553498cba8826910fdc6361230cef6c04c ├── [ 34K] LICENSE └── [1.5K] README.md 0 directories, 2 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. If the original source is unavailable, please email f.jinxu#gmail.com for a local snapshot (replace # with @).
    3. Shenlong has snapshotted the POC code for you. To support long-term maintenance, please consider donating. Thank you for your support.