Skip to content

A Series of Simple DOS Vulnerabilities #134873

Open
@kexinoh

Description

@kexinoh

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.

def expandvars(path):

2.
def _parseparam(s):

3.
while methodname[:1] == '<':

4.
def get_phrase(value):

5.
while value and (value[0]=='\\' or value[0] not in PHRASE_ENDS):

6.
value = value[1:]

7.
value = value[1:]

8.
value = value[1:]

9.
value = value[1:]

10.
value = value[1:]

11.
value = value[1:]

12.
value = value[1:]

13.
value = value[1:]

14.
value = value[1:]

15.
value = value[1:]

16.
to_encode = to_encode[1:]

17.
def expandvars(str, vars):

18.
def expandvars(path):

19.
while True:

20.
while line and line[-1] in " \t":

21.
while platform and platform[-1] == '-':

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

Metadata

Metadata

Labels

3.10only security fixes3.11only security fixes3.12only security fixes3.13bugs and security fixes3.14bugs and security fixes3.9only security fixesstdlibPython modules in the Lib dirtopic-IDLEtopic-emailtopic-pathlibtype-securityA security issue

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions