projectdiscovery/katana · error

unsupported captcha provider for injection: %s

Error message

unsupported captcha provider for injection: %s

What it means

injectionScript maps a captcha.Provider to its token-injection JavaScript (reCAPTCHA, Turnstile, hCaptcha). If the provider is not one of the known cases, the switch's default returns this error. It means the library has no injection strategy for the detected provider.

Source

Thrown at pkg/engine/headless/captcha/captcha.go:81

func injectToken(page *rod.Page, solution *Solution) error {
	js, err := injectionScript(solution.Provider)
	if err != nil {
		return err
	}
	_, err = page.Eval(js, solution.Token)
	return err
}

func injectionScript(provider Provider) (string, error) {
	switch provider {
	case ProviderRecaptchaV2, ProviderRecaptchaV3, ProviderRecaptchaV2Enterprise, ProviderRecaptchaV3Enterprise:
		return captchajs.InjectRecaptchaJS, nil
	case ProviderTurnstile:
		return captchajs.InjectTurnstileJS, nil
	case ProviderHCaptcha:
		return captchajs.InjectHCaptchaJS, nil
	default:
		return "", fmt.Errorf("unsupported captcha provider for injection: %s", provider)
	}
}

View on GitHub (pinned to e3e742739c)

Solutions

  1. Update katana so the provider is covered by both the solver (taskTypes) and injectionScript switch
  2. Use a supported provider/solver combination (recaptcha v2/v3 + enterprise, turnstile, hcaptcha)
  3. If you detect an unsupported captcha, skip solving for that target instead of calling Solve
  4. Log the provider string and open an issue requesting support for that vendor
Defensive patterns

Strategy: validation

Validate before calling

supportedProviders := map[string]bool{
	"recaptchav2": true, "recaptchav3": true,
	"recaptchav2enterprise": true, "recaptchav3enterprise": true,
	"turnstile": true, "hcaptcha": true,
}
if !supportedProviders[strings.ToLower(detectedProvider)] {
	// skip captcha solving for this target
}

Prevention

When it happens

Trigger: Provider value outside {RecaptchaV2, V3, V2Enterprise, V3Enterprise, Turnstile, HCaptcha} reaches injectionScript, typically via injectToken from solveCaptcha after Identify produced an exotic/unknown provider.

Common situations: A new captcha vendor detected on a target page that the injection switch doesn't cover; custom/unknown provider constants; a solver returned a Solution with a provider the injection layer doesn't support yet.

Related errors


AI-assisted analysis of projectdiscovery/katana@e3e742739c (2026-09-03). Data as JSON: /api/errors/5bcbbb5f6e00e42f. Report an issue: GitHub.