[GHSA-2p9h-ccw7-33gf] cleo is vulnerable to Regular Expression Denial of Service (ReDoS)#7819
Open
levpachmanov wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates
Comments
CVE-2022-42966 (GHSA-2p9h-ccw7-33gf, CWE-1333) is an exponential ReDoS in
cleo.ui.table.Table. When rendering a cell,Tableruns a style-tag detectionregex with nested quantifiers over attacker-influenced cell content
(
Table.set_rows):The
(\w+=[\w,]+;?)*group backtracks exponentially. The fix(
b5b9a04, PR python-poetry/cleo#285) constrains the alternatives to the realstyle keys:
Evidence
All commands were run against a full mirror of
python-poetry/cleo(
/Volumes/src/ali-security/cleo-2705).Introduction and fix commits
de55578"Refactor code"is_not_styled_by_tagregex tocleo/ui/table.pyb5b9a04"Change regex string to less permissive one"Tag containment (
git tag --contains)--contains de55578):1.0.0a1 1.0.0a2 1.0.0a3 1.0.0a4 1.0.0a5 1.0.0 2.0.0 2.0.1 2.1.0 2.2.0 2.2.1--contains b5b9a04):1.0.0 2.0.0 2.0.1 2.1.0 2.2.0 2.2.11.0.0a1 … 1.0.0a50.x/v0.xtag containsde55578.