Security

A bot protection widget is only as strong as the integration behind it. Follow these practices to get the full benefit.

Always verify on the server

The widget only produces a token. A token that is never verified protects nothing, because a bot can submit your form without running any JavaScript. Call siteverify for every protected request and reject the request when success is not true.

Keep the secret key private

  • Store it in an environment variable or secret manager.
  • Never include it in HTML, JavaScript bundles or mobile apps.
  • Rotate it from the dashboard if it may have leaked. The old key stops working immediately.

Each token works once

Tokens are single-use and expire after five minutes. Do not cache a successful verification or accept the same token twice. If the visitor's request fails for another reason, call recloud.reset() to obtain a fresh token before they retry.

Passing the visitor IP

The remoteip parameter is optional. When you send it, it must match the address the token was issued to, which adds protection against stolen tokens.

  • Behind a proxy or load balancer, read the real client address from a trusted header such as X-Forwarded-For, and only trust that header from your own proxy.
  • Visitors who switch networks between loading the page and submitting the form, for example moving from Wi-Fi to mobile data, will fail the IP check. If that matters for your audience, omit remoteip.

Decide how to fail

If the verification request itself fails, for example because of a network timeout, choose a policy deliberately. For sensitive actions such as logins and payments, fail closed and ask the visitor to retry. For low-risk forms you may fail open and log the event.

Layer your defenses

ReCloud raises the cost of automated abuse, but no single control is perfect. Combine it with rate limiting, account lockout and monitoring on sensitive endpoints.

Restrict domains and use HTTPS

  • List only the domains you own in the site's allowed domains.
  • Serve your pages over HTTPS. The widget requires a secure origin.
  • Use separate sites, and therefore separate keys, for staging and production.

Reporting a vulnerability

If you believe you have found a security issue in ReCloud Turnstile, please tell us through the contact page and choose the technical topic. Do not disclose the issue publicly until we have had a chance to respond.