-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
A Series of Simple DOS Vulnerabilities #134873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Okay, I will maintain a note in the issue regarding the completed repair part. I hope others can complete the remaining sections. |
cc @sethmlarson I'm assuming you're aware of this
|
@ZeroIntensity Indeed, some of these have been reported to PSRT and I recommended a public issue. |
I fixed |
Among them, both 17 and 18 belong to path replacement issues. I think you can fix them together, which will accelerate the repair speed. It should be additionally noted that other problems such as the infinite loop vulnerability caused by 17 need to be handled. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
As for |
Yes, there are still some vulnerabilities. |
I may have found a new one: cpython/Lib/pathlib/__init__.py Line 144 in 5507eff
import pathlib
import time
def create_deep_path(n):
p = pathlib.PurePath("a")
for _ in range(n):
p = pathlib.PurePath(p, p) # Each iteration doubles the number of path segments
return p
start = time.time()
# 2^20 ≈ 1,000,000
deep_path = create_deep_path(20)
str(deep_path) # Path resolution is triggered, which consumes a large amount of resources
end = time.time()
print(f"Time taken: {end - start:.2f} seconds") Possible fix, replace with Now: Time taken: 0.51 seconds @barneygale Can you be confirm this? Edit: 3.14 3.15 only #130748 |
# The `_raw_paths` slot stores unjoined string paths. This is set in
# the `__init__()` method.
'_raw_paths', Note that |
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Bug description:
We have identified a series of simple quadratic complexity vulnerabilities. After confirmation by CPython's security team, since these DOS vulnerabilities pose a low threat and are relatively tedious to exploit, we can directly initiate requests in issues to seek assistance from the community for fixes.
Below are the specific locations of the different complexity issues we discovered.
1.
cpython/Lib/posixpath.py
Line 290 in f49a07b
2.
cpython/Lib/email/message.py
Line 73 in 5ab66a8
3.
cpython/Lib/idlelib/editor.py
Line 1206 in 5ab66a8
4.
cpython/Lib/email/_header_value_parser.py
Line 1424 in 5ab66a8
5.
cpython/Lib/email/_header_value_parser.py
Line 1506 in 5ab66a8
6.
cpython/Lib/email/_header_value_parser.py
Line 1688 in 5ab66a8
7.
cpython/Lib/email/_header_value_parser.py
Line 1697 in 5ab66a8
8.
cpython/Lib/email/_header_value_parser.py
Line 1847 in 5ab66a8
9.
cpython/Lib/email/_header_value_parser.py
Line 2200 in 5ab66a8
10.
cpython/Lib/email/_header_value_parser.py
Line 2231 in 5ab66a8
11.
cpython/Lib/email/_header_value_parser.py
Line 2260 in 5ab66a8
12.
cpython/Lib/email/_header_value_parser.py
Line 2411 in 5ab66a8
13.
cpython/Lib/email/_header_value_parser.py
Line 2570 in 5ab66a8
14.
cpython/Lib/email/_header_value_parser.py
Line 2642 in 5ab66a8
15.
cpython/Lib/email/_header_value_parser.py
Line 2762 in 5ab66a8
16.
cpython/Lib/email/_header_value_parser.py
Line 2965 in 5ab66a8
17.
cpython/Tools/freeze/checkextensions.py
Line 72 in e64395e
18.
cpython/Lib/ntpath.py
Line 403 in cb8a72b
19.
cpython/Lib/idlelib/editor.py
Line 1373 in 5ab66a8
20.
cpython/Lib/idlelib/editor.py
Line 1454 in 98a5b83
21.
cpython/Lib/platform.py
Line 642 in 98a5b83
Current repair status:
03/19 has been fixed. @johnzhou721
1 has been fixed. @Wulian233
2/4/5/6/7/8/9/10/11/12/13/14/15/16 has been fixed. @picnixz
1/18 has been fixed. @serhiy-storchaka
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Credits
Finder is kexinoh (Xiangfan Wu) from QI-ANXIN Technology Research Institute.
Linked PRs
posixpath
#134927_header_value_parser.py
[WIP] #134947The text was updated successfully, but these errors were encountered: