google/tsunami-security-scanner · error · NotImplementedError

Validation type not supported.

Error message

Validation type %s not supported.

What it means

_parse_payload only supports payloads whose validation_type is VALIDATION_REGEX. Any other validation type raises NotImplementedError; note the message interpolates the config's vulnerability type, which can be misleading about the actual cause.

Solutions

  1. Change the payload definition's validation_type to VALIDATION_REGEX and provide a validation_regex
  2. Check which payload matched and why its validation type is not REGEX
  3. Upgrade/align the payload proto and generator code versions
  4. Catch NotImplementedError and treat the payload as unsupported, skipping it

Example fix

// before
# payload.proto
validation_type: VALIDATION_TOKEN
// after
validation_type: VALIDATION_REGEX
validation_regex: "key-[a-z0-9]+"
Defensive patterns

Strategy: try-catch

Validate before calling

def uses_supported_validation(payload):
    return payload.validation_type == pg.PayloadValidationType.Value('VALIDATION_REGEX')

Try / catch

try:
    payload = generator.generate(config)
except NotImplementedError as e:
    logging.warning('Payload validation type unsupported: %s', e)
    payload = None

Prevention

When it happens

Trigger: A payload definition matching the config uses PayloadValidationType other than VALIDATION_REGEX (e.g. a future/unsupported enum) and is found by _find_matching_payload during generate().

Common situations: Newly introduced validation types in the proto not yet implemented in the generator; payload definitions authored with the wrong validation_type; mixed plugin/proto versions where the payload resource uses an enum the code does not handle.

Related errors


AI-assisted analysis of google/tsunami-security-scanner@363ba87b35 (2026-09-13). Data as JSON: /api/errors/2364f5a7f0744d33. Report an issue: GitHub.

Appendix: source

Thrown at plugin_server/py/plugin/payload/payload_generator.py:135

      validator = type(
          'PayloadValidator',
          (Validator,),
          {'is_executed': lambda s, _: self.tcs_client.has_oob_log(secret)},
      )()
      return Payload(
          payload_string,
          validator,
          pg.PayloadAttributes(uses_callback_server=True),
          config,
      )
    else:
      payload_string = payload.payload_string.value.replace(
          self.TOKEN_RANDOM_STRING, secret
      )
      if payload.validation_type != pg.PayloadValidationType.Value(
          'VALIDATION_REGEX'
      ):
        raise NotImplementedError(
            'Validation type %s not supported.'
            % pg.PayloadGeneratorConfig.VulnerabilityType.Name(
                config.vulnerability_type)
            )
      regex = payload.validation_regex.value.replace(
          self.TOKEN_RANDOM_STRING, secret
      )
      validator = type(
          'PayloadValidator',
          (Validator,),
          {'is_executed': _is_executed(regex)},
      )()
      return Payload(
          payload_string,
          validator,
          pg.PayloadAttributes(uses_callback_server=False),
          config,
      )

View on GitHub (pinned to 363ba87b35)