From 65b6e7b4acb13a736614a1ab73b0908476f3c24a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0tampar?= Date: Mon, 5 Oct 2026 23:46:59 +0200 Subject: [PATCH] Fixes #6137 --- lib/core/settings.py | 2 +- lib/core/target.py | 6 +++++- tests/test_target_parsing.py | 26 ++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/lib/core/settings.py b/lib/core/settings.py index fed08b686..239002253 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -20,7 +20,7 @@ from lib.core.enums import OS from thirdparty import six # sqlmap version (...) -VERSION = "1.10.9.32" +VERSION = "1.10.10.0" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE) diff --git a/lib/core/target.py b/lib/core/target.py index f61cd56ea..87feb4d2a 100644 --- a/lib/core/target.py +++ b/lib/core/target.py @@ -561,7 +561,11 @@ def _resumeDBMS(): dbms = value.lower() dbmsVersion = [UNKNOWN_DBMS_VERSION] _ = "(%s)" % ('|'.join(SUPPORTED_DBMS)) - _ = re.search(r"\A%s (.*)" % _, dbms, re.I) + try: + # Dirty patch for a Python 3.13/3.14 re module regression (e.g. https://github.com/sqlmapproject/sqlmap/issues/6128, https://github.com/sqlmapproject/sqlmap/issues/6137) + _ = re.search(r"\A%s (.*)" % _, dbms, re.I) + except TypeError: + _ = None if _: dbms = _.group(1).lower() diff --git a/tests/test_target_parsing.py b/tests/test_target_parsing.py index 7a3c778da..f7b8897f5 100644 --- a/tests/test_target_parsing.py +++ b/tests/test_target_parsing.py @@ -51,6 +51,7 @@ from lib.core.settings import RESTORE_MERGED_OPTIONS from lib.core.settings import UNENCODED_ORIGINAL_VALUE from lib.core.threads import getCurrentThreadData from lib.utils.hashdb import HashDB +import lib.core.target as target from lib.core.target import _createDumpDir from lib.core.target import _createFilesDir from lib.core.target import _createTargetDirs @@ -354,6 +355,31 @@ class TestResumeDBMS(_TargetTestBase): with self.assertRaises(SqlmapNoneDataException): _resumeDBMS() + def test_survives_broken_re_module(self): + # a Python 3.13/3.14 're' module regression can make re.search() raise TypeError on an + # otherwise-valid pattern (#6128, #6137) - must fall back to "no match" (the stored value + # used as-is) instead of crashing the whole resume + self._new_hashdb() + conf.dbms = None + conf.offline = False + hashDBWrite(HASHDB_KEYS.DBMS, "MySQL 5.0") + + originalRe = target.re + + class _BrokenRe(object): + I = originalRe.I + + def search(self, *args, **kwargs): + raise TypeError("list.append() takes exactly one argument (2 given)") + + target.re = _BrokenRe() + try: + _resumeDBMS() + finally: + target.re = originalRe + + self.assertIsNone(Backend.getIdentifiedDbms()) + class TestResumeOS(_TargetTestBase): def test_resumes_os(self):