summaryrefslogtreecommitdiffstats
path: root/meta-python/recipes-devtools/python/python3-sqlparse/CVE-2023-30608.patch
diff options
context:
space:
mode:
authorTrevor Gamblin <tgamblin@baylibre.com>2023-07-25 15:09:43 -0400
committerKhem Raj <raj.khem@gmail.com>2023-07-25 12:46:19 -0700
commit74e70284acb2eb2f2a47a1ab1aa5ee0928d46344 (patch)
tree8c63a764f2cff30cbefaf4095e7691895e312097 /meta-python/recipes-devtools/python/python3-sqlparse/CVE-2023-30608.patch
parent7fc427838dde831b2fcea167ab76fc2811d633e0 (diff)
downloadmeta-openembedded-74e70284acb2eb2f2a47a1ab1aa5ee0928d46344.tar.gz
python3-sqlparse: upgrade 0.4.3 -> 0.4.4
- Use python_flit_core instead of setuptools3 - Modify 0001-sqlparse-change-shebang-to-python3.patch to apply on 0.4.4 - Remove CVE-2023-30608.patch since it's now upstream: [tgamblin@megalith sqlparse]$ git tag --contains c457abd 0.4.4 Changelog (https://github.com/andialbrecht/sqlparse/blob/master/CHANGELOG): Release 0.4.4 (Apr 18, 2023) ---------------------------- Notable Changes * IMPORTANT: This release fixes a security vulnerability in the parser where a regular expression vulnerable to ReDOS (Regular Expression Denial of Service) was used. See the security advisory for details: https://github.com/andialbrecht/sqlparse/security/advisories/GHSA-rrm6-wvj7-cwh2 The vulnerability was discovered by @erik-krogh from GitHub Security Lab (GHSL). Thanks for reporting! Bug Fixes * Revert a change from 0.4.0 that changed IN to be a comparison (issue694). The primary expectation is that IN is treated as a keyword and not as a comparison operator. That also follows the definition of reserved keywords for the major SQL syntax definitions. * Fix regular expressions for string parsing. Other * sqlparse now uses pyproject.toml instead of setup.cfg (issue685). Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-python/recipes-devtools/python/python3-sqlparse/CVE-2023-30608.patch')
-rw-r--r--meta-python/recipes-devtools/python/python3-sqlparse/CVE-2023-30608.patch51
1 files changed, 0 insertions, 51 deletions
diff --git a/meta-python/recipes-devtools/python/python3-sqlparse/CVE-2023-30608.patch b/meta-python/recipes-devtools/python/python3-sqlparse/CVE-2023-30608.patch
deleted file mode 100644
index f5526c5b88..0000000000
--- a/meta-python/recipes-devtools/python/python3-sqlparse/CVE-2023-30608.patch
+++ /dev/null
@@ -1,51 +0,0 @@
1From c457abd5f097dd13fb21543381e7cfafe7d31cfb Mon Sep 17 00:00:00 2001
2From: Andi Albrecht <albrecht.andi@gmail.com>
3Date: Mon, 20 Mar 2023 08:33:46 +0100
4Subject: [PATCH] Remove unnecessary parts in regex for bad escaping.
5
6The regex tried to deal with situations where escaping in the
7SQL to be parsed was suspicious.
8
9Upstream-Status: Backport
10CVE: CVE-2023-30608
11
12Reference to upstream patch:
13https://github.com/andialbrecht/sqlparse/commit/c457abd5f097dd13fb21543381e7cfafe7d31cfb
14
15[AZ: drop changes to CHANGELOG file and adjust context whitespaces]
16Signed-off-by: Adrian Zaharia <Adrian.Zaharia@windriver.com>
17
18Adjust indentation in keywords.py.
19Signed-off-by: Joe Slater <joe.slater@windriver.com>
20---
21 sqlparse/keywords.py | 4 ++--
22 tests/test_split.py | 4 ++--
23 2 files changed, 4 insertions(+), 4 deletions(-)
24
25--- sqlparse-0.4.3.orig/sqlparse/keywords.py
26+++ sqlparse-0.4.3/sqlparse/keywords.py
27@@ -72,9 +72,9 @@ SQL_REGEX = {
28 (r'(?![_A-ZÀ-Ü])-?(\d+(\.\d*)|\.\d+)(?![_A-ZÀ-Ü])',
29 tokens.Number.Float),
30 (r'(?![_A-ZÀ-Ü])-?\d+(?![_A-ZÀ-Ü])', tokens.Number.Integer),
31- (r"'(''|\\\\|\\'|[^'])*'", tokens.String.Single),
32+ (r"'(''|\\'|[^'])*'", tokens.String.Single),
33 # not a real string literal in ANSI SQL:
34- (r'"(""|\\\\|\\"|[^"])*"', tokens.String.Symbol),
35+ (r'"(""|\\"|[^"])*"', tokens.String.Symbol),
36 (r'(""|".*?[^\\]")', tokens.String.Symbol),
37 # sqlite names can be escaped with [square brackets]. left bracket
38 # cannot be preceded by word character or a right bracket --
39--- sqlparse-0.4.3.orig/tests/test_split.py
40+++ sqlparse-0.4.3/tests/test_split.py
41@@ -18,8 +18,8 @@ def test_split_semicolon():
42
43
44 def test_split_backslash():
45- stmts = sqlparse.parse(r"select '\\'; select '\''; select '\\\'';")
46- assert len(stmts) == 3
47+ stmts = sqlparse.parse("select '\'; select '\'';")
48+ assert len(stmts) == 2
49
50
51 @pytest.mark.parametrize('fn', ['function.sql',