From ed8ad1ec77350a1b7390b89055bf01b131ad2d58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0tampar?= Date: Thu, 12 Nov 2026 17:06:31 +0100 Subject: [PATCH] Fix for --xpath over POST corrupting special characters (e.g. '+') in payloads --- lib/core/settings.py | 2 +- lib/techniques/xpath/inject.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/core/settings.py b/lib/core/settings.py index 02cab700b..cea2b5e68 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -19,7 +19,7 @@ from lib.core.enums import OS from thirdparty import six # sqlmap version (...) -VERSION = "1.10.11.62" +VERSION = "1.10.11.63" 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/techniques/xpath/inject.py b/lib/techniques/xpath/inject.py index 4df434b63..fd7362835 100644 --- a/lib/techniques/xpath/inject.py +++ b/lib/techniques/xpath/inject.py @@ -43,6 +43,7 @@ from lib.core.settings import XQUERY_HARVEST_CHARS from lib.core.settings import XQUERY_MAX_FILE_LENGTH from lib.request.connect import Connect as Request from lib.utils.xrange import xrange +from thirdparty.six.moves.urllib.parse import quote as _quote SENTINEL = randomStr(length=10, lowercase=True) @@ -154,7 +155,8 @@ def _send(place, parameter, value): time.sleep(conf.delay) old_params = conf.parameters.get(place, "") - conf.parameters[place] = _replaceSegment(place, parameter, value) + # Note: POST body is sent as-is (i.e. raw '+', '&', '%' would be misinterpreted), while GET is URL encoded later on + conf.parameters[place] = _replaceSegment(place, parameter, _quote(value, safe="") if place == PLACE.POST else value) try: kwargs = {"raise404": False, "silent": True}