Install
Works with Drupal: ^10.3 || ^11Using Composer to manage Drupal site dependencies
Alternative installation files
Release notes
Security fix: challenge tokens are now signed by the server
Sites running 1.0.0-alpha2 or earlier should update.
Tokens are now issued server-side and signed with an HMAC over their expiry, keyed on the site hash salt, and verified with hash_equals(). The challenge page hands the signed token to the client, which only stores it.
Existing tokens are invalidated by this release. Visitors will see the challenge page once more, then continue as normal.
Reported, with a patch, by @bserem
New features
- Configurable token cookie name (#3579041). Some CDNs and reverse proxies only forward cookies matching an allowlist, and would strip
botbuster_token, leaving visitors stuck in a challenge loop. The cookie name is now configurable so it can be matched to your edge configuration. The settings form warns when a proxy or CDN is detected, and the README documents Fastly, Upsun/Platform.sh, Varnish and Cloudflare.
Bug fixes
- The challenge file generator refuses to write when the
private://stream wrapper is not configured, instead of creating a strayprivate:/botbuster/directory inside the webroot (#3589562). - The middleware now honours the
enabledflag andtoken_lifetimesettings, and returns HTTP 503 for challenge responses instead of HTTP 200 (#3577682). - Token validation tolerates up to 300 seconds of clock skew between web nodes. A freshly issued token sits exactly on the expiry boundary, so on a multi-node origin a server whose clock ran even one second ahead issued tokens that every other node rejected on sight, producing a permanent challenge loop. The expiry check and the signature check are unchanged, so this costs no security.
- The challenge script no longer stores a cookie when the challenge page carries no token, which happens if
challenge.htmlpredates this release and was never regenerated. It now shows the error panel instead of storing the literal stringundefinedand looping silently.
Updating
Run database updates after deploying this release. Two update hooks run:
cookie_name_defaultsets the newddos_protection.cookie_namesetting on sites installed before it existed.signed_token_placeholderregenerateschallenge.htmlandbotbuster.json.
The regeneration is required, not cosmetic. The challenge page shipped before this release has no placeholder for the signed token, and until it is regenerated every protected path will keep serving the challenge. A cache rebuild (drush cr) also regenerates both files.