{"record":{"id":"7611f41812d8e625","repo":"sqlmapproject/sqlmap","slug":"invalid-character-provided-in-option-tamper","errorCode":null,"errorMessage":"invalid character provided in option '--tamper'","messagePattern":"invalid character provided in option '--tamper'","errorType":"exception","errorClass":"SqlmapSyntaxException","httpStatus":null,"severity":"error","filePath":"lib/core/option.py","lineNumber":883,"sourceCode":"            script = safeFilepathEncode(script.strip())\n\n            try:\n                if not script:\n                    continue\n\n                elif os.path.exists(os.path.join(path, script if script.endswith(\".py\") else \"%s.py\" % script)):\n                    script = os.path.join(path, script if script.endswith(\".py\") else \"%s.py\" % script)\n\n                elif not os.path.exists(script):\n                    errMsg = \"tamper script '%s' does not exist\" % script\n                    raise SqlmapFilePathException(errMsg)\n\n                elif not script.endswith(\".py\"):\n                    errMsg = \"tamper script '%s' should have an extension '.py'\" % script\n                    raise SqlmapSyntaxException(errMsg)\n            except UnicodeDecodeError:\n                errMsg = \"invalid character provided in option '--tamper'\"\n                raise SqlmapSyntaxException(errMsg)\n\n            dirname, filename = os.path.split(script)\n            dirname = os.path.abspath(dirname)\n\n            infoMsg = \"loading tamper module '%s'\" % filename[:-3]\n            logger.info(infoMsg)\n\n            if not os.path.exists(os.path.join(dirname, \"__init__.py\")):\n                errMsg = \"make sure that there is an empty file '__init__.py' \"\n                errMsg += \"inside of tamper scripts directory '%s'\" % dirname\n                raise SqlmapGenericException(errMsg)\n\n            if dirname not in sys.path:\n                sys.path.insert(0, dirname)\n\n            try:\n                getattr(importlib, \"invalidate_caches\", lambda: None)()  # Note: py3.3+ only; a script just written into an already-scanned dir is invisible to a cached FileFinder (Windows coarse mtime)\n                module = __import__(safeFilepathEncode(filename[:-3]))","sourceCodeStart":865,"sourceCodeEnd":901,"githubUrl":"https://github.com/sqlmapproject/sqlmap/blob/0a35b20e3953d341be6c7ac75ccb0b3362540c8d/lib/core/option.py#L865-L901","documentation":"Encoding guard in _setTamperingFunctions(): processing a --tamper entry raised UnicodeDecodeError, meaning the command-line value contains bytes that cannot be decoded (non-UTF8 characters or shell formatting) and is rejected.","triggerScenarios":"Thrown at lib/core/option.py:883 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retype the --tamper value in plain ASCII","Remove quotes/special characters injected by the shell or terminal","Set a UTF-8 locale or avoid copy-pasting non-ASCII characters"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0a35b20e3953d341be6c7ac75ccb0b3362540c8d","analyzedAt":"2026-08-26T23:02:52.002Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}