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

目标: 1000 元 · 已筹: 1359 元

100%

CVE-2023-41105 PoC — Python 代码问题漏洞

来源
关联漏洞
标题: Python 代码问题漏洞 (CVE-2023-41105)
Description:Python是Python基金会的一套开源的、面向对象的程序设计语言。该语言具有可扩展、支持模块和包、支持多种平台等特点。 Python 3.11版本至3.11.4版本存在安全漏洞,该漏洞源于存在路径意外截断。
Description
Example of CVE-2023-41105
介绍
# Intro
 Python 3.11 through 3.11.4, there's a problem with the os.path.normpath() function where you can cut off the path unexpectedly with `normpath()`.

 ### What is `normpath()`?

 *os.path.normpath()* method in Python is used to normalize the specified path. All redundant separator and up-level references are collapsed in the process of path normalization. 
 For example: A//B, A/B/, A/./B and A/foo/../B all will be normalized to A/B. 
 - [GeekforGeeks](https://www.geeksforgeeks.org/python-os-path-normpath-method/)


# PoC
Let's break down `example.py` to understand whats what

Importing the bult in function `path`.
```python
from os import path
```

normalizing the path but we add `\0` at first
```python
normalized_path = path.normpath('\0')
```

here we print the new path
```python
print(normalized_path)
```

and output will be

![image](https://github.com/JawadPy/CVE-2023-41105-Exploit/assets/98477272/4f684e43-21e4-47bc-9184-b12d22d6d2e9)


Now instead of using `\0` I will replace it with `\0\images\anything.png`

![image](https://github.com/JawadPy/CVE-2023-41105-Exploit/assets/98477272/3e7bbae4-75c0-4e8f-8aa5-4de5e563f264)

This directly switching the path to root path instead of normalize the specified path. It's for sure critical when it comes to websites and so on...

# Support
If you would like to support me with donation, I recommend you to give it to someone who really need it please. If you do so then consider that i earned your support.

<a href="https://www.buymeacoffee.com/jawadpy" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-green.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
文件快照

登录后查看神龙缓存的 POC 文件快照

登录查看
备注
    1. 建议优先通过来源进行访问。
    2. 本地 POC 快照面向订阅用户开放;当原始来源失效或无法访问时,本地镜像作为订阅权益的一部分提供。
    3. 持续抓取、验证、维护这份 POC 档案需要不少投入,因此本地快照已纳入付费订阅。您的订阅是让这份资料能继续走下去的关键,由衷感谢。 查看订阅方案 →