From c0ee625d5c5536fd4278b395c0637d2e0e2f4d40 Mon Sep 17 00:00:00 2001 From: Philip Dodds Date: Fri, 13 Jan 2023 17:31:24 -0500 Subject: [PATCH] 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. --- poetry.lock | 51 +++++++++++++++++++++----------------------------- pyproject.toml | 2 +- 2 files changed, 22 insertions(+), 31 deletions(-) diff --git a/poetry.lock b/poetry.lock index a421ddf4..c22b144d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -39,17 +39,6 @@ files = [ [package.extras] test = ["coverage", "flake8", "pexpect", "wheel"] -[[package]] -name = "atomicwrites" -version = "1.4.1" -description = "Atomic file writes." -category = "dev" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -files = [ - {file = "atomicwrites-1.4.1.tar.gz", hash = "sha256:81b2c9071a49367a7f770170e5eec8cb66567cfbbc8c73d20ce5ca4a8d71cf11"}, -] - [[package]] name = "attrs" version = "22.2.0" @@ -391,6 +380,21 @@ files = [ dnspython = ">=1.15.0" idna = ">=2.0.0" +[[package]] +name = "exceptiongroup" +version = "1.1.0" +description = "Backport of PEP 654 (exception groups)" +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ + {file = "exceptiongroup-1.1.0-py3-none-any.whl", hash = "sha256:327cbda3da756e2de031a3107b81ab7b3770a602c4d16ca618298c526f4bec1e"}, + {file = "exceptiongroup-1.1.0.tar.gz", hash = "sha256:bcb67d800a4497e1b404c2dd44fca47d3b7a5e5433dbab67f96c1a685cdfdf23"}, +] + +[package.extras] +test = ["pytest (>=6)"] + [[package]] name = "flake8" version = "6.0.0" @@ -1106,18 +1110,6 @@ icu = ["PyICU (>=2.4,<3.0)"] osv = ["openapi-spec-validator (>=0.2.1)"] ssv = ["swagger-spec-validator (>=2.4,<3.0)"] -[[package]] -name = "py" -version = "1.11.0" -description = "library with cross-python path, ini-parsing, io, code, log facilities" -category = "dev" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" -files = [ - {file = "py-1.11.0-py2.py3-none-any.whl", hash = "sha256:607c53218732647dff4acdfcd50cb62615cedf612e72d1724fb1a0cc6405b378"}, - {file = "py-1.11.0.tar.gz", hash = "sha256:51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719"}, -] - [[package]] name = "pycodestyle" version = "2.10.0" @@ -1300,25 +1292,24 @@ tests = ["pytest"] [[package]] name = "pytest" -version = "7.1.2" +version = "7.2.0" description = "pytest: simple powerful testing with Python" category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "pytest-7.1.2-py3-none-any.whl", hash = "sha256:13d0e3ccfc2b6e26be000cb6568c832ba67ba32e719443bfe725814d3c42433c"}, - {file = "pytest-7.1.2.tar.gz", hash = "sha256:a06a0425453864a270bc45e71f783330a7428defb4230fb5e6a731fde06ecd45"}, + {file = "pytest-7.2.0-py3-none-any.whl", hash = "sha256:892f933d339f068883b6fd5a459f03d85bfcb355e4981e146d2c7616c21fef71"}, + {file = "pytest-7.2.0.tar.gz", hash = "sha256:c4014eb40e10f11f355ad4e3c2fb2c6c6d1919c73f3b5a433de4708202cade59"}, ] [package.dependencies] -atomicwrites = {version = ">=1.0", markers = "sys_platform == \"win32\""} attrs = ">=19.2.0" colorama = {version = "*", markers = "sys_platform == \"win32\""} +exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} iniconfig = "*" packaging = "*" pluggy = ">=0.12,<2.0" -py = ">=1.8.2" -tomli = ">=1.0.0" +tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} [package.extras] testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "xmlschema"] @@ -1915,4 +1906,4 @@ testing = ["flake8 (<5)", "func-timeout", "jaraco.functools", "jaraco.itertools" [metadata] lock-version = "2.0" python-versions = ">=3.9, <4.0" -content-hash = "b52ee1a8fe7fdde96c29b2e0e8f95eb8bd2892a0bdd788a465d1cfd9d55844b5" +content-hash = "657632b434dda7a130de354f99eb4f68ecf2ecc856203e6a9f2bcba40ea48a01" diff --git a/pyproject.toml b/pyproject.toml index 76fa0a35..0d01bbf5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,7 @@ pydantic-yaml = ">=0.8.0,<0.9.0" [tool.poetry.group.dev.dependencies] mkdocs-material = "^9.0.3" -pytest = "7.1.2" +pytest = "7.2.0" pytest-runner = "6.0.0" mypy = "^0.991" flake8 = "^6.0.0"