sqlmapproject/sqlmap · error · SqlmapSyntaxException

option '--csrf-token' is incompatible with option…

Error message

option '--csrf-token' is incompatible with option '--threads'

What it means

Startup mutual-exclusivity guard in _basicOptionValidation: --csrf-token forces sequential token fetching per request, so parallel requests from multiple threads would reuse stale tokens. Fires when conf.csrfToken is set while conf.threads is greater than 1.

Solutions

  1. Drop --threads (or set --threads=1) when using --csrf-token
  2. Remove --csrf-token if the endpoint does not actually require anti-CSRF tokens
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at lib/core/option.py:3004 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/af2a71af778a3665. Report an issue: GitHub.

Appendix: source

Thrown at lib/core/option.py:3004

    if conf.safeReqFile and any((conf.safeUrl, conf.safePost)):
        errMsg = "option '--safe-req' is incompatible with option '--safe-url' and option '--safe-post'"
        raise SqlmapSyntaxException(errMsg)

    if conf.csrfUrl and not conf.csrfToken:
        errMsg = "option '--csrf-url' requires usage of option '--csrf-token'"
        raise SqlmapSyntaxException(errMsg)

    if conf.csrfMethod and not conf.csrfToken:
        errMsg = "option '--csrf-method' requires usage of option '--csrf-token'"
        raise SqlmapSyntaxException(errMsg)

    if conf.csrfData and not conf.csrfToken:
        errMsg = "option '--csrf-data' requires usage of option '--csrf-token'"
        raise SqlmapSyntaxException(errMsg)

    if conf.csrfToken and conf.threads > 1:
        errMsg = "option '--csrf-token' is incompatible with option '--threads'"
        raise SqlmapSyntaxException(errMsg)

    if conf.requestFile and conf.url and conf.url != DUMMY_URL:
        errMsg = "option '-r' is incompatible with option '-u' ('--url')"
        raise SqlmapSyntaxException(errMsg)

    if conf.direct and conf.proxy:
        errMsg = "option '-d' is incompatible with option '--proxy'"
        raise SqlmapSyntaxException(errMsg)

    if conf.direct and conf.tor:
        errMsg = "option '-d' is incompatible with switch '--tor'"
        raise SqlmapSyntaxException(errMsg)

    if not conf.technique:
        errMsg = "option '--technique' can't be empty"
        raise SqlmapSyntaxException(errMsg)

    if conf.tor and conf.ignoreProxy:

View on GitHub (pinned to 0a35b20e39)