Skip to content

ReDoS in py library when used with subversion

High severity GitHub Reviewed Published Oct 16, 2022 to the GitHub Advisory Database • Updated Aug 17, 2023

Package

pip py (pip)

Affected versions

<= 1.11.0

Patched versions

None

Description

The py library through 1.11.0 for Python allows remote attackers to conduct a ReDoS (Regular expression Denial of Service) attack via a Subversion repository with crafted info data, because the InfoSvnCommand argument is mishandled.

The particular codepath in question is the regular expression at py._path.svnurl.InfoSvnCommand.lspattern and is only relevant when dealing with subversion (svn) projects. Notably the codepath is not used in the popular pytest project. The developers of the pytest package have released version 7.2.0 which removes their dependency on py. Users of pytest seeing alerts relating to this advisory may update to version 7.2.0 of pytest to resolve this issue. See pytest-dev/py#287 (comment) for additional context.

References

Published by the National Vulnerability Database Oct 16, 2022
Published to the GitHub Advisory Database Oct 16, 2022
Reviewed Oct 18, 2022
Last updated Aug 17, 2023

Severity

High
7.5
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Weaknesses

CVE ID

CVE-2022-42969

GHSA ID

GHSA-w596-4wvx-j9j6

Source code

Credits

Checking history
See something to contribute? Suggest improvements for this vulnerability.