Skip to content

A Series of Simple DOS Vulnerabilities #134873

Closed as duplicate
Closed as duplicate

Description

@kexinoh

Bug report

Update

Now, based on the specific location where the problem code appears, it has been re-split into five issues.

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

Activity

  1. added
    3.11only security fixes
    3.12only security fixes
    3.13only security fixes
    3.14bugs and security fixes
    and removed
    type-bugAn unexpected behavior, bug, or error
    on May 29, 2025
  2. johnzhou721 commented on May 29, 2025

    @johnzhou721
  3. johnzhou721 commented on May 29, 2025

    @johnzhou721
  4. johnzhou721 commented on May 29, 2025

    @johnzhou721
  5. kexinoh commented on May 29, 2025

    @kexinoh
    Author

    Okay, I will maintain a note in the issue regarding the completed repair part. I hope others can complete the remaining sections.

  6. ZeroIntensity commented on May 29, 2025

    @ZeroIntensity
    Member

    cc @sethmlarson I'm assuming you're aware of this

    After confirmation by CPython's security team

  7. 18 remaining items

  8. johnzhou721 commented on Jun 22, 2025

    @johnzhou721
    Contributor

    FYI: 19 is potentially non-exploitable if we can limit the maximum of indentwidth when loading the config (What's the difference between self.indentwidth and self.tabwidth in the editor anyways?)

  9. serhiy-storchaka commented on Jun 28, 2025

    @serhiy-storchaka
    Member

    Please open separate issue for each problem. os.path, IDLE, email -- they all are very different and need different solutions.

  10. kexinoh commented on Jun 28, 2025

    @kexinoh
    Author
  11. kexinoh commented on Jun 28, 2025

    @kexinoh
    Author

    I have added fout new issues.
    #136061
    #136063
    #136065
    #136066

  12. StanFromIreland commented on Jun 28, 2025

    @StanFromIreland
    Member

    Is there any left here or can this be closed now?

  13. picnixz commented on Jun 28, 2025

    @picnixz
  14. picnixz commented on Jun 28, 2025

    @picnixz
    Member

    Actually no, please open issues for platform and tools (or maybe it's under the os.path issue) as well.

  15. picnixz commented on Jun 28, 2025

    @picnixz
    Member

    The platform issue is actually straightforward and I can take care of it now.

  16. kexinoh commented on Jun 28, 2025

    @kexinoh
    Author

    I updated it at the top of this issue to indicate that it has been split, which will help readers understand it quickly.

    Ok. I put them in the PATH. Now it seems that it can be turned off.

  17. picnixz commented on Jun 28, 2025

    @picnixz
    Member

    No I meant, the platform one is separate from the path issues. But the checkextensions one is a path-one as it's expandvars-related

  18. kexinoh commented on Jun 28, 2025

    @kexinoh
    Author
  19. picnixz commented on Jun 28, 2025

    @picnixz
    Member

    Thanks. We'll close this issue in particular and focus on the dedicated ones instead. Thanks for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

3.10 (EOL)end of life3.11only security fixes3.12only security fixes3.13only security fixes3.14bugs and security fixes3.9 (EOL)end of lifependingThe issue will be closed if no feedback is providedstdlibStandard Library Python modules in the Lib/ directorytopic-emailtopic-pathlibtype-securityA security issue

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions