Skip to main content

JS Challenge (Managed Challenge) — per-rule JavaScript challenge

JS Challenge has no per-domain on/off switch. A rule with the JS Challenge action is what turns it on. JS Challenge must be enabled for your account by VNETWORK. Each rule has its own knobs (display, delay, TTL; firewall rules also have a Block/Allow fallback for clients that cannot run JS).

JS Challenge (Managed Challenge) is a lightweight JavaScript challenge that filters out clients that are not real browsers (bots/scripts) while keeping false positives on mobile to a minimum. When a request matches a rule, VNIS returns a "Checking your browser…" page (or a JSON directive for XHR). A browser that passes receives a clearance ticket. Subsequent requests carrying the ticket pass the challenge rule until the ticket expires according to its TTL (default 30 minutes).

The challenge is not a CAPTCHA and not human verification: it only checks that the client behaves like a real browser. Bot Management also uses this challenge page for its Level 1 and Level 2 responses (see Where JS Challenge is used (and where it is not)).

Use it to: stop bots, scrapers and floods on sensitive paths (checkout, expensive APIs, frequently scraped pages) without hard-blocking browser users. Example: your search page is being scraped by scripts. Create a Firewall Rule path starts_with /search with the JS Challenge action: real browsers pass in about 1 second and are admitted for 30 minutes, while scripts that do not run JS never get a ticket.

Low assurance. The ticket only proves one valid browser exchange. It does not replace the WAF/SQLi/XSS protection, rate limiting, authentication or other abuse checks. The ticket only skips the challenge rules themselves, not other block/rate-limit rules.

Before you start​

  • The domain has been added, points to VNIS and is accessed over HTTPS (the challenge requires TLS; see how plain HTTP is handled in How each type of traffic is handled).
  • The organization is granted WAF and the domain has WAF enabled (the Firewall Rules / Rate Limit / Bot Challenge / DDoS tabs are all locked otherwise).
  • JS Challenge is enabled for your account by VNETWORK (see step 1 under How to configure). If it is not, the JS Challenge tile in the rule form is locked; contact support.
  • The domain's signing key is generated automatically when you save your first JS Challenge rule. You do not need to do anything.

How to configure​

1. Availability for your account​

JS Challenge must be enabled for your account by VNETWORK; contact support. Once it is enabled, your saved JS Challenge rules start challenging immediately after the change syncs.

When JS Challenge is not enabled for your account:

  • You cannot create new JS Challenge rules (or change another rule to JS Challenge). Existing challenge rules can still be edited, disabled and deleted.
  • Existing rules are "inert" (no effect) and do not challenge or block anyone. The rule list shows an inert badge.
  • For an enabled but inert Firewall Rule challenge only: for the requests it matches, Allow/Bypass rules with lower priority still do not apply (the inert rule still "takes the place" of the Allow/Bypass rules below it). If you need those Allow/Bypass rules to take effect, disable the challenge rule.
  • An inert rate-limit challenge → clients over the threshold get a normal 429.

Create Firewall Rule form when JS Challenge is not enabled: the "JS Challenge (Managed)" tile is locked with a warning

2. Domain JS Challenge defaults (Bot Management → "JS Challenge defaults")​

  1. Go to Domains → select a domain → Bot Challenge tab → the "JS Challenge defaults" card.
  2. Set the defaults for every challenge on the domain (rules that do not set their own value use these): Clearance TTL (seconds), Challenge display (domain default), Redirect delay (seconds), Bypass verified bots, Bypass CIDR ranges.
  3. Click Save/Create in the Bot Challenge section. This card has no on/off switch; it only holds default values.

3. Enable JS Challenge for a specific path (per rule)​

JS Challenge is turned on by a rule, in 3 places:

  • Firewall Rules: the "JS Challenge (Managed)" action. A request that matches the conditions → challenge.
  • Rate Limiting: the "JS Challenge (Managed)" action. A client over the threshold → challenge instead of 429 (By IP is required).
  • DDoS / Traffic Shield: the "Serve a JS challenge on a DDoS "Challenge" verdict" box (a separate opt-in).

Example with a Firewall Rule:

  1. Go to Domains → select a domain → Firewall Rules tab → Add rule and select the JS Challenge (Managed) tile.
  2. Adjust the rule's knobs: JS Challenge display (this rule), Redirect delay (seconds), Clearance TTL (minutes), When the visitor cannot run JS (default Block (403) — default).
  3. Add conditions that narrow the scope (path, method and so on), click Create rule and wait a few seconds for the change to sync.

For Rate Limit, the knobs are similar (there is no fallback: clients that cannot run JS always get 429):

For DDoS (Traffic Shield), the Challenge group has its own knobs for this source:

Traffic Shield tab, Challenge group: the "Serve a JS challenge on a DDoS Challenge verdict" switch is on, together with JS Challenge display (this source), Redirect delay (seconds), Clearance TTL (minutes)

Configuration fields​

1. Domain defaults ("JS Challenge defaults" in the Bot Challenge tab)​

FieldDescriptionValuesDefaultNotes
Clearance TTL (seconds)How long the ticket lives before it must be validated again0 or 60–86400 seconds1800 (30 minutes)0 → default of 1800; out of range → the console disables Save
Challenge display (domain default)Default display styleInterstitial / TransparentInterstitialTransparent ⇒ the redirect delay is ignored
Redirect delay (seconds)Default time the waiting page is held0–10 seconds0Ignored with Transparent
Bypass verified botsVerified bots (Googlebot, Bingbot and others) are never challengedOn/offOnApplies to every challenge source (firewall, rate limit, DDoS, bot)
Bypass CIDR rangesIP ranges that always skip the challengeCIDRs, one per line—CIDRs broader than /8 (v4) or /16 (v6) are rejected; an invalid line → "Invalid:" and Save is disabled
Signing keyKey used to sign tickets (managed by the server)—Generated automatically when the first JS Challenge rule is savedNever displayed; only "configured ✓" plus a Rotate key button (every existing ticket holder is challenged again once)

2. Per-rule / per-source knobs​

FieldFirewallRate limitDDoSValuesDefault
JS Challenge display (this rule / this source)Domain default / Interstitial / TransparentDomain default
Redirect delay (seconds)0–10 seconds, only when the display is InterstitialDomain default
Clearance TTL (minutes)Empty = inherit from the domain, or 1–1440 minutesInherit (30 minutes)
When the visitor cannot run JS— (always 429)—Block (403) — default / Allow (pass to origin)Block

The rule lists (Firewall and Rate Limit) show a summary of each rule's knobs, for example Interstitial · TTL 15 min · no-JS: block, and an inert badge when JS Challenge is not enabled for your account.

How Clearance TTL works​

  • After passing the challenge, the client is admitted for that rule for the duration of the TTL. When the TTL expires, the next request that matches the rule is challenged again.
  • Each rule can set its own TTL. A strict rule (short TTL, for example /checkout at 5 minutes) requires revalidation sooner; a looser rule (for example static pages at 24 hours) admits for longer, on the same ticket. Freshness is calculated separately for each rule.
  • All challenge sources share one ticket: passing the challenge on any rule "refreshes" the ticket for every rule, so there are no challenge loops.
  • A ticket is valid only for the host where it was obtained: a ticket obtained on www.example.com cannot be used for static.example.com.

Tip for choosing a TTL: sensitive paths → short TTL (5–15 minutes); low-risk paths → the default of 30 minutes or longer. Do not set it too short for paths with many mobile users behind CGNAT.

How each type of traffic is handled​

This applies when JS Challenge is enabled for your account and the request does not yet have a valid ticket (requests with a valid ticket always pass, regardless of type):

Request typeResponse
HTML navigation (a browser opening a page, GET over HTTPS)The "Checking your browser…" challenge page (or a background redirect with Transparent)
Same-origin XHR / fetch (SPA)401 with the JSON directive {"vedge_challenge":{...}}. HTML is never returned to XHR
Clients that cannot run JS: native apps, video players, assets loaded from another subdomain, cross-origin calls, form submissions and other non-browser requestsFirewall: according to the rule's fallback; default Block = 403, or Allow = pass to the origin. Rate limit: 429
Plain HTTP (no TLS), HTML navigation308 → HTTPS if the domain has HTTPS redirect or HSTS enabled. Enable HTTPS redirect for domains that use JS Challenge
Verified bot (Googlebot and others) / IP in Bypass CIDRThe challenge is skipped

Who does the Block fallback (default) affect? Every request that matches the rule but cannot be challenged: native mobile apps calling APIs, video players, images/CSS/JS loaded from another subdomain, cross-origin calls and form submissions (including returns from a payment gateway). So: narrow the rule conditions (only the exact HTML paths that need protection, possibly with a method = GET condition), or choose Allow (pass to origin) if the path has non-browser clients. To measure the impact first, use the Log action for a few days before switching to JS Challenge.

Overly broad rules are blocked: the system rejects (422) a Block fallback on a rule that matches every request (no conditions, or conditions that match everything, such as path /, regex .* or a CIDR covering everything). The form shows the warning "The server refuses Block on a catch-all rule". Narrow the conditions or choose Allow.

What the challenge page shows​

The interstitial page uses the same style as the VNIS 429 courtesy page, with:

  • A "Checking your browser…" line plus a manual Retry button (no infinite auto-loop).
  • Footer: Request ID and Client IP (for matching against logs when you need support).
  • It works in WebViews, private browsing mode and with content blockers (cookies must be enabled).
  • Every challenge, verification and fallback response has Cache-Control: no-store, so it is never cached.

Configuration examples​

Example 1 — Protect the search page from scraping (short TTL, GET only).

  • Firewall Rule: http_request_uri_path starts_with /search AND http_request_method eq GET, action JS Challenge (Managed), display Interstitial, Clearance TTL = 10 minutes, fallback Block (403).
  • Result: real browsers pass once and can access /search for 10 minutes; scripts that do not run JS get the challenge page (HTML) or 403 (non-browsers).

Example 2 — A path used by both browsers and mobile apps → Allow fallback.

  • Firewall Rule path starts_with /news, action JS Challenge, fallback Allow (pass to origin).
  • Result: browsers are challenged; native apps and video players calling the same path go to the origin (no 403). Requests that cannot be challenged on this path are not protected by the challenge, so combine it with Rate Limiting or Token V2 for APIs.

Example 3 — Safe rollout.

  • Step 1: create a rule with the same conditions and the Log action for a few days, and check WAF Reports to see how many requests match and from which clients.
  • Step 2: change the action to JS Challenge, starting with a narrow scope and expanding gradually.

Example 4 — Rate limit for a listing page.

  • Rate Limit rule /products*, By IP, action JS Challenge (Managed): browsers over the threshold get the challenge page and, once they pass, are admitted (still counted); XHR/API over the threshold get 429.

Where JS Challenge is used (and where it is not)​

WhereBehavior when JS Challenge is enabledPage
Firewall Rules, JS Challenge (Managed) actionMatch → challenge; cannot run JS → fallback Block 403 (default) / AllowFirewall Rules
Rate Limiting, JS Challenge (Managed) actionOver the threshold → challenge for page navigations; otherwise 429; By IP is requiredRate Limiting
DDoS / Traffic Shield, "Serve a JS challenge on a DDoS Challenge verdict"Challenge verdict → challenge for page navigations; a Block verdict still blocksDDoS
Bot Management (rate-based escalation)Level 1 and Level 2 → JS challenge, Level 3 → 403Bot Management
Login protectionNo challenge: blocks directly, 429 + Retry-After by IP, 423 by usernameLogin protection
WAF AI rulesNo challenge: only block or logWAF AI Profiles
Adaptive RulesNo challenge: actions Log only / Add to threat score / Block / Timed blockAdaptive Rules
ATSNo challenge: clients over the score threshold are blockedATS

Quick check​

# Browser-style request to a path with a JS Challenge rule → challenge page (HTML)
curl -sk -D- -o /dev/null -H "Accept: text/html" -H "Sec-Fetch-Mode: navigate" -H "Sec-Fetch-Dest: document" \
https://example.com/path-with-rule
# Same-origin XHR → 401 + JSON directive (not HTML)
curl -sk -D- -H "Accept: application/json" -H "Sec-Fetch-Mode: cors" -H "Sec-Fetch-Site: same-origin" -H "Sec-Fetch-Dest: empty" \
https://example.com/path-with-rule
# Non-browser client → the rule's fallback (default 403)
curl -skI https://example.com/path-with-rule

Troubleshooting​

SymptomCommon causeFix
The JS Challenge tile is lockedJS Challenge is not enabled for your accountContact support; in the meantime you can create a rule with the Log action to measure first
A rule has an inert badge and no challenge appearsJS Challenge is not enabled for your accountSame as above: the rule is kept and starts working automatically once JS Challenge is enabled
Saving a rule returns an error when JS Challenge is selectedJS Challenge is not enabled for your account (new challenge rules cannot be created), or a Block fallback on a rule that matches every request (422)Contact support; narrow the conditions or choose Allow (pass to origin)
Mobile apps, video players or images from another subdomain get 403A firewall challenge rule matches those requests with a Block fallbackNarrow the conditions (exclude API/media paths, add method = GET), or change the fallback to Allow
The payment return flow (from the payment gateway) gets 403The return request cannot be challenged → Block fallbackExclude the callback path from the rule conditions
http:// requests are redirected with 308 to https://The domain has HTTPS redirect/HSTS enabled; the challenge requires HTTPSThis is expected; use HTTPS
An Allow/Bypass rule below has no effectAn enabled firewall challenge rule (even if inert) matches firstDisable the challenge rule or give the Allow/Bypass rule a lower priority number
An API client (SPA) receives HTMLThe Sec-Fetch-* / Accept: application/json headers are missingMake sure XHR sends the correct headers; valid XHR gets a 401 directive
Users complain about "being checked over and over"Clearance TTL is too shortIncrease the TTL on that rule (or let it inherit the 30-minute default)
Googlebot is challengedBypass verified bots has been turned offTurn it back on in "JS Challenge defaults"
Saving the TTL returns an errorThe TTL is out of rangeDomain: 0 or 60–86400 seconds; rule: empty or 1–1440 minutes

FAQ​

  • Where do I turn on JS Challenge for a domain? There is no per-domain switch. Create a rule with the JS Challenge action (Firewall / Rate Limit) or check the DDoS challenge box; that rule is what turns it on. The "JS Challenge defaults" card only holds default values.
  • How do I measure the impact before enforcing? Use a Firewall Rule with the Log action (for Rate Limit: start with a high threshold).
  • How often do visitors have to pass the challenge again? According to Clearance TTL: 30 minutes by default (change it in "JS Challenge defaults"), and it can be set per rule (the "Clearance TTL (minutes)" box).
  • Is JS Challenge a CAPTCHA? No, it is low assurance. For stronger abuse protection, combine it with rate limiting, tokens or block rules.
  • What if the client has JavaScript disabled or blocks cookies? It cannot get a ticket (it sees a message and a Retry button, not a loop).
  • Can tickets be shared between visitors? No. Tickets are only issued on no-store responses and are never cached.
  • Does login protection have a JS Challenge? No. Login protection always blocks directly (429 + Retry-After / 423) or only logs. See Login protection.

JS Challenge on mobile devices and mobile apps (important for operations)​

1. Native mobile apps calling APIs depend on the rule's fallback​

Native apps (iOS/Android, React Native, Flutter and so on) and HLS/AVPlayer/ExoPlayer players cannot run JS, so they cannot be challenged:

  • With a Firewall Rule Block fallback (default): app requests that match the rule get 403.
  • With the Allow (pass to origin) fallback: the app goes straight to the origin.
  • With Rate Limit: apps over the threshold get 429 as usual.
  • Recommendation: do not let JS Challenge rules match the app's API/media paths (narrow the conditions), or use the Allow fallback. Protect app APIs with Token V2 / X-Vtoken / Rate Limiting.

2. Mobile browsers and WebViews (challenged and pass normally)​

  • A mobile browser opening a page → gets "Checking your browser…", passes in about 1 second and is admitted for the Clearance TTL.
  • A WebView inside an app is also a browser → it is challenged and passes normally (JS + cookies are required).

3. SPAs on mobile (fetch/XHR)​

  • Same-origin GET XHR/fetch → gets 401 + a JSON directive, which the SPA handles itself; the UI is not broken by HTML.
  • Requests sending data (POST/PUT…) without a ticket → the rule's fallback (default 403). Users who have already passed the challenge (and have a ticket) can POST normally. If a form can be submitted before the user opens any challenged page, set the fallback to Allow or exclude the form path from the rule.

4. Payment return pages​

Payment gateways usually return to the site with a request from another domain, and this request cannot be challenged. If a firewall challenge rule matches the callback path, the payment flow gets 403 with the Block fallback. Exclude the payment callback path from the rule conditions (or use the Allow fallback).

5. Operational notes for mobile​

SituationImpactRecommendation
CGNAT (many people sharing one IP) + a TTL that is too shortVisitors are challenged often and some may get a temporary error (a retryable 429), without getting stuck in a loopDo not set the TTL too short for paths with many mobile users
An unusual client sends Accept: text/html but does not run JSTreated as a browser → gets the challenge page but cannot solve itExclude it with rule conditions, add a Bypass CIDR, or turn on Bypass verified bots
Assets (images/video) from another subdomain share the ruleClients loading assets from another subdomain cannot complete the challenge → fallback (default 403)Do not apply challenge rules to asset hosts/paths
http:// access308 to HTTPS (if the domain has HTTPS redirect/HSTS enabled)Make sure the site runs on HTTPS

Summary for operations: JS Challenge is turned on per rule, once VNETWORK has enabled it for your account. For Firewall Rules, the default Block fallback blocks every client that cannot run JS. Always narrow the conditions to the exact HTML pages that need protection, or choose Allow when the path is shared with apps, players or assets.