Fixes #6185
Some checks are pending
/ build (macos-latest, 3.8) (push) Waiting to run
/ build (ubuntu-latest, pypy-2.7) (push) Waiting to run
/ build (windows-latest, 3.14) (push) Waiting to run

This commit is contained in:
Miroslav Štampar 2026-11-19 15:06:30 +01:00
parent 8b78b676c1
commit 5db2e62884
3 changed files with 29 additions and 1 deletions

View file

@ -19,7 +19,7 @@ from lib.core.enums import OS
from thirdparty import six
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.10.11.88"
VERSION = "1.10.11.89"
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)

View file

@ -10,6 +10,7 @@ import re
import time
import types
from lib.core.common import checkSameHost
from lib.core.common import getHostHeader
from lib.core.common import getSafeExString
from lib.core.common import logHTTPTraffic
@ -180,6 +181,10 @@ class SmartRedirectHandler(_urllib.request.HTTPRedirectHandler):
if conf.authRefresh and not authrefresh.sameOrigin(req.get_full_url(), redurl):
req.headers = authrefresh.stripHeaders(req.headers)
req.unredirected_hdrs = authrefresh.stripHeaders(req.unredirected_hdrs)
# Note: credentials are not to be forwarded to a different host (like browsers, curl and requests do) (#6185)
if not checkSameHost(req.get_full_url(), redurl):
req.headers = dict((key, value) for key, value in req.headers.items() if key.upper() not in (HTTP_HEADER.COOKIE.upper(), HTTP_HEADER.AUTHORIZATION.upper()))
result = _urllib.request.HTTPRedirectHandler.http_error_302(self, req, fp, code, msg, headers)
except _urllib.error.HTTPError as ex:
result = error = ex