sqlmapproject/sqlmap · error · SqlmapSyntaxException

please provide a valid value (>0) for safe frequency…

Error message

please provide a valid value (>0) for safe frequency ('--safe-freq') while using safe visit features

What it means

_setSafeVisit requires --safe-freq to be a positive integer when safe-visit features (--safe-url/--safe-req) are used: sqlmap visits the safe target every N-th request. The guard `(conf.safeFreq or 0) <= 0` raises SqlmapSyntaxException when the option is unset or set to zero/negative, since a non-positive frequency makes the periodic-visit logic meaningless.

Solutions

  1. Provide a positive integer, e.g. `--safe-freq=5` to hit the safe URL every 5th request.
  2. If you do not want periodic safe visits, remove --safe-url/--safe-req entirely instead of setting --safe-freq=0.
  3. Pick a frequency appropriate to the target's session/WAF behavior (common values 3-10).
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at lib/core/option.py:1427 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sqlmapproject/sqlmap@0a35b20e39 (2026-08-26). Data as JSON: /api/errors/9ab1921b99568ccd. Report an issue: GitHub.

Appendix: source

Thrown at lib/core/option.py:1427

                post = raw[raw.find('\n\n') + 2:]

            if post and post.strip():
                kb.safeReq.post = post
            else:
                kb.safeReq.post = None
        else:
            errMsg = "invalid format of a safe request file"
            raise SqlmapSyntaxException(errMsg)
    else:
        if not re.search(r"(?i)\Ahttp[s]*://", conf.safeUrl):
            if ":443/" in conf.safeUrl:
                conf.safeUrl = "https://%s" % conf.safeUrl
            else:
                conf.safeUrl = "http://%s" % conf.safeUrl

    if (conf.safeFreq or 0) <= 0:
        errMsg = "please provide a valid value (>0) for safe frequency ('--safe-freq') while using safe visit features"
        raise SqlmapSyntaxException(errMsg)

def _setPrefixSuffix():
    if conf.prefix is not None and conf.suffix is not None:
        # Create a custom boundary object for user's supplied prefix
        # and suffix
        boundary = AttribDict()

        boundary.level = 1
        boundary.clause = [0]
        boundary.where = [1, 2, 3]
        boundary.prefix = conf.prefix
        boundary.suffix = conf.suffix

        if " like" in boundary.suffix.lower():
            if "'" in boundary.suffix.lower():
                boundary.ptype = 3
            elif '"' in boundary.suffix.lower():
                boundary.ptype = 5

View on GitHub (pinned to 0a35b20e39)