Site check bot
When a business applies to take payments with OnCharge, OnCharge checks its website: what it sells, its policy pages and support contact details, and, for research-use-only (RUO) stores, the claims its pages, posts and product descriptions make and whether the OnCharge shopper gate covers the store. The check runs when you move past the step where you enter your website in onboarding, when you submit your application, whenever you choose Scan again, and during periodic reviews. This page describes the bot so you can recognise it, verify it and let it through your firewall.
How to recognise it#
- User agent:
OnchargeUnderwritingBot/1.0 (+https://oncharge.io). Match on the tokenOnchargeUnderwritingBot. - Signed requests: requests to your store carry an
OnCharge-Scanheader that proves they come from OnCharge. See Verify a request. - What it reads: pages an anonymous visitor can open, with
GETandHEADonly, and your store's public feeds:robots.txtand the sitemaps it lists, the WooCommerce Store API (/wp-json/wc/store/v1/products), Shopify's/products.json, WordPress posts and pages (/wp-json/wp/v2/posts,/wp-json/wp/v2/pages) and your RSS feed (/feed/). It never submits forms, adds to a cart, signs in or pays. - Pace: one page at a time with a pause between requests (up to about 120 requests a minute) and at most about 60 pages per check. A check takes under a minute.
- IP addresses: the check runs on cloud infrastructure and has no fixed IP addresses. Allow it by user agent and, where your firewall supports it, by the signed header, not by IP address.
What the check looks for#
- Products OnCharge cannot support, or can support only in a specific programme.
- Terms, privacy, refund, shipping and contact pages, and a support email address or phone number.
- For research-use-only stores:
- claims of the kinds FDA cites in warning letters to research-use-only sellers: human-use language, dosing and administration, clinical or human-study results presented as benefits, disease and treatment claims, weight-loss, muscle, libido and tanning claims, comparisons with approved drugs and "pharmaceutical grade", and personal-use testimonials;
- compounds the programme excludes, including products renamed with codes whose addresses give the compound away;
- the OnCharge shopper gate covering the store.
Onboarding shows each finding with the page, the passage, the rule and how to fix it. Fix them on your site, then choose Scan again: the automatic decision always uses the latest check.
Verify a request#
A user agent can be copied. To be sure a request comes from OnCharge, check its signature:
OnCharge-Scan: v=1; t=<unix seconds>; kid=<key id>; sig=<signature>- Read the
;-separatedname=valuepairs. Whitespace around them is allowed, their order is free and unknown names are ignored. A name given twice, or a part without=, makes the header invalid.vmust be1. - Reject the request if
tis more than 300 seconds away from your server's clock. - Build the signed message (UTF-8):
"v1\n" + t + "\n" + host + "\n" + pathAndQuery.hostis the request'sHostin lower case without a trailing dot, with the port only when it is not the scheme's default (443 for HTTPS, 80 for HTTP).pathAndQueryis the request target exactly as received: the raw path (percent-encoding as sent,/when empty), then?and the query when the query is not empty. - Fetch the public keys from
https://app.oncharge.io/.well-known/oncharge-scan-keys.json, a JSON Web Key Set of Ed25519 keys (ktyOKP,crvEd25519), and take the key whosekidmatches. Cache the file for up to an hour, and refetch it at most once every five minutes when a request names a key you do not have. sigis the Ed25519 signature in base64url without padding (86 characters). Verify it over the message with that key.
Node.js (18 or later):
import { createPublicKey, verify } from 'node:crypto';
const KEYS_URL = 'https://app.oncharge.io/.well-known/oncharge-scan-keys.json';
let cache = { at: 0, tried: 0, keys: null };
async function loadKeys() {
cache.tried = Date.now();
try {
const res = await fetch(KEYS_URL, { signal: AbortSignal.timeout(3000) });
const body = res.ok ? await res.json() : null;
if (Array.isArray(body?.keys)) cache = { ...cache, at: Date.now(), keys: body.keys };
} catch {
// Keep the keys already held.
}
}
async function scanKey(kid) {
const find = () => (cache.keys ?? []).find((k) => k.kid === kid && k.kty === 'OKP' && k.crv === 'Ed25519');
const stale = Date.now() - cache.at > 3_600_000;
// Fetch when the copy is over an hour old or lacks this key, at most once every five minutes.
if ((stale || !find()) && Date.now() - cache.tried > 300_000) await loadKeys();
return find() ?? null;
}
function signedHost(host, scheme) {
const match = String(host ?? '').trim().toLowerCase().match(/^(\[[^\]]+\]|[^:]*)(?::(\d+))?$/);
if (!match) return '';
const name = match[1].replace(/\.$/, '');
const port = match[2] ?? '';
const isDefault = (scheme === 'https' && port === '443') || (scheme === 'http' && port === '80');
return port && !isDefault ? `${name}:${port}` : name;
}
function signedTarget(target) {
let value = String(target ?? '').split('#')[0];
if (value.startsWith('?')) value = `/${value}`;
if (value.endsWith('?')) value = value.slice(0, -1);
return value || '/';
}
/**
* True when the OnCharge-Scan header is valid for this request.
* host: the Host header. target: the raw request target (path and query as received).
* scheme: 'https' or 'http', as the request arrived.
*/
export async function isOnChargeScan(header, host, target, scheme = 'https') {
const params = new Map();
for (const piece of String(header ?? '').split(';')) {
const part = piece.trim();
if (!part) continue;
const at = part.indexOf('=');
if (at <= 0) return false;
const name = part.slice(0, at).trim().toLowerCase();
if (params.has(name)) return false;
params.set(name, part.slice(at + 1).trim());
}
const t = params.get('t') ?? '';
const kid = params.get('kid') ?? '';
const sig = params.get('sig') ?? '';
if (params.get('v') !== '1' || !/^\d{1,12}$/.test(t) || !kid || !/^[A-Za-z0-9_-]{86}$/.test(sig)) return false;
if (Math.abs(Math.floor(Date.now() / 1000) - Number(t)) > 300) return false;
const jwk = await scanKey(kid);
if (!jwk) return false;
try {
const key = createPublicKey({ key: { kty: 'OKP', crv: 'Ed25519', x: jwk.x }, format: 'jwk' });
const message = `v1\n${t}\n${signedHost(host, scheme)}\n${signedTarget(target)}`;
return verify(null, Buffer.from(message, 'utf8'), key, Buffer.from(sig, 'base64url'));
} catch {
return false;
}
}Call it with the OnCharge-Scan header, the Host header, the raw request target and the scheme (for example req.headers.host, req.originalUrl and req.protocol in Express, with trust proxy set when TLS ends at a proxy).
The OnCharge shopper gate#
Research-use-only stores keep their catalogue behind the OnCharge shopper gate: shoppers sign in and accept the research-use terms before they see products or prices. The check looks for the gate's markers on the pages it reads (<meta name="oncharge-gate" content="v1">, an element with data-oncharge-gate="v1", the gate script or frame from app.oncharge.io/gate/v1/, or an OnCharge-Gate: v1 response header). The gate checks the OnCharge-Scan signature itself and shows the check your store as a visitor who has passed the gate would see it, so you do not need a firewall exception for the gate.
Let the check through your firewall#
If the check meets a security challenge or block page, onboarding names the firewall it found and shows that firewall's steps, which are the same as below. Every exception should only switch off bot detection, JavaScript or captcha challenges and rate limiting for the check: keep injection and attack rules on, because a user agent can be copied. Then choose Scan again in onboarding.
Cloudflare#
- In the Cloudflare dashboard, open your domain and go to Security > Security rules > Create rule > Custom rules.
- Use the expression (http.user_agent contains "OnchargeUnderwritingBot"). To be stricter, add: and len(http.request.headers["oncharge-scan"]) > 0
- Under Choose action, pick Skip and tick All Super Bot Fight Mode rules, All rate limiting rules and Browser Integrity Check. Tick All remaining custom rules only if your own rules block bots. Put the rule first, then Deploy.
- If Bot Fight Mode is on, turn it off under Security > Settings (filter by Bot traffic).
- If Under Attack mode is on, turn it off in your domain's Overview (Quick Actions), or add a configuration rule (Rules > Overview > Create rule > Configuration Rule) with the same expression that sets I'm Under Attack off.
Note: Bot Fight Mode runs outside your rules: Skip, Bypass and Allow have no effect on it, and only an IP address rule can exempt a visitor. Our check has no fixed IP addresses, so Bot Fight Mode has to be off. Super Bot Fight Mode (Pro and above) can be skipped by the rule above.
Cloudflare documentation: https://developers.cloudflare.com/waf/custom-rules/skip/
Vercel Firewall#
- In Vercel, open the project that serves your store and go to Firewall, then Configure > Add New > Rule.
- Condition: User Agent, Contains, "OnchargeUnderwritingBot". To be stricter, add AND Request Header "OnCharge-Scan", Exists.
- Then: Bypass. Save the rule and move it above any Deny or Challenge rule.
- Choose Review Changes > Publish.
- If Attack Mode is on, disable it from the Firewall menu while the check runs (it also switches itself off after the time you chose).
Note: Bypass skips your custom rules and the Bot Protection and AI Bots rulesets, but not Vercel's platform DDoS mitigations. If the check is still blocked with Attack Mode off, ask Vercel support.
Vercel Firewall documentation: https://vercel.com/docs/vercel-firewall/vercel-waf/custom-rules
Bunny Shield#
- In the bunny.net dashboard, go to CDN, select your pull zone, then Edge Rules > Add Edge Rule.
- Condition: Request Header, User-Agent, matching "\OnchargeUnderwritingBot\".
- Actions: Disable Shield Bot Detection, Disable Shield Challenge and Disable Shield Rate Limiting. Add Disable Shield Access Lists only if you block countries or networks. Do not use Disable WAF or Disable Shield.
- Save the rule. Bunny Shield's event logs show whether a request was still blocked.
Note: Bunny Shield's own WAF rules can only block, log or challenge, and its access lists match IP addresses, networks and countries only, so the edge rule is the way to let the check through.
Bunny Shield documentation: https://bunny.net/docs/cdn/edge-rules/
Sucuri Website Firewall#
- In the Sucuri dashboard, open the Website Firewall for your site and go to Access Control > Block User Agents. Remove any entry that matches the check.
- Under Security, turn off Enable Emergency DDOS protection unless you are under attack: it blocks every visitor without JavaScript except major search engines.
- Under Audit Trails, find the blocked request and note its Block ID.
- Open a support ticket asking Sucuri to allowlist the user agent "OnchargeUnderwritingBot", and include the Block ID.
Note: Sucuri has no user-agent allowlist in its dashboard. Allow URL Paths opens a path to every visitor and does not skip JavaScript challenges.
Sucuri Website Firewall documentation: https://docs.sucuri.net/website-firewall/configuration/security-options/
Wordfence#
- In WordPress, go to Wordfence > Tools > Live Traffic, find the requests from "OnchargeUnderwritingBot" and read why they were blocked.
- Go to Wordfence > Firewall > Blocking and delete any Custom Pattern rule whose Browser User Agent matches the check (for example \bot\).
- Go to Wordfence > Firewall > All Firewall Options > Rate Limiting. Set "If anyone's requests exceed" and "If a crawler's page views exceed" to Unlimited, or at least 240 per minute with throttle, and raise "If a crawler's pages not found (404s) exceed".
- Check that "Immediately block IPs that access these URLs" lists none of your store's pages, then Save Changes.
Note: Wordfence cannot allowlist a user agent, only IP addresses and a fixed list of services, and our check has no fixed IP addresses. Its rate limits count per IP address; the check makes up to about 120 requests a minute.
Wordfence documentation: https://www.wordfence.com/help/firewall/rate-limiting/
Akamai#
- In Akamai Control Center, open the security configuration that protects your site (this needs Bot Manager).
- Create a custom bot category, and add a custom-defined bot to it with a Request Header condition: User-Agent matches "\OnchargeUnderwritingBot\".
- In the security policy's Bot Management settings, set that category's action to Allow (or Monitor).
- Save and activate the configuration, on staging first and then production.
- If App & API Protector still denies the check, look up the "Reference #" from the block page in Akamai's error translator and add an exception, or ask your Akamai account team.
Note: Akamai's own guides need a sign-in, so these menu names come from partner guides and may differ in your account. Your Akamai account team can make the change for you.
Fastly Next-Gen WAF#
- In manage.fastly.com, go to Security > Next-Gen WAF > Rules, choose the workspace and Add workspace rule (in the older console: Rules > Site Rules > Add site rule).
- Type: Request. Condition: User agent, Contains, "OnchargeUnderwritingBot". To be stricter, add AND Request header "OnCharge-Scan", Exists.
- Action: Allow. Save the rule.
- If you also use Fastly Bot Management, check its logs: it verifies bots by IP address, and our check has no fixed IP addresses.
Note: An Allow rule overrides blocking rules. Fastly does not document whether it also overrides rate limits and Bot Management challenges.
Fastly Next-Gen WAF documentation: https://www.fastly.com/documentation/guides/next-gen-waf/rules/working-with-request-rules/
AWS WAF#
- In the AWS WAF console, open the web ACL (protection pack) attached to your CloudFront distribution or load balancer, and go to its rules.
- Edit the Bot Control rule group (AWSManagedRulesBotControlRuleSet) and add a scope-down statement: NOT (header "user-agent" contains "OnchargeUnderwritingBot").
- Add the same scope-down to your rate-based rules and to the Anonymous IP list rule group, whose HostingProviderIPList rule blocks requests from cloud providers.
- Save, then check the logs' terminatingRule field to confirm the check is no longer stopped.
Note: An Allow rule ranked above the managed rule groups also works, but it skips every later rule, including the core attack rules, so the scope-down is narrower. Bot Control's targeted level challenges clients without a browser token, which our check cannot pass.
AWS WAF documentation: https://docs.aws.amazon.com/waf/latest/developerguide/waf-bot-control-example-user-agent-exception.html
Netlify#
- In Netlify, go to Project configuration > Security > Firewall traffic rules and make sure the baseline and country rules do not block the check. These rules match only IP addresses and locations.
- Under Project configuration > Security > Rate limiting, make sure no rule limits the check. On Enterprise you can add a Header condition that leaves out its user agent.
- If you use Netlify's Web Application Firewall (Enterprise), set the rule that matches the check to Log, or add an exclusion.
- If a User Agent Blocker extension or your own edge function blocks bots, allow "OnchargeUnderwritingBot" there.
Note: Netlify has no user-agent allow rule. Its platform DDoS protection is handled by Netlify support.
Netlify documentation: https://docs.netlify.com/manage/security/secure-access-to-sites/traffic-rules/
Imperva#
- In the Imperva Cloud Security Console, open your website's Bot Access Control settings.
- Add an exception for the user agent "OnchargeUnderwritingBot/1.0 (+https://oncharge.io)".
- If the check is still challenged, turn off Challenge suspected bots and keep Block bad bots on.
- If DDoS protection is set to always on, switch it to automatic or adaptive, or ask Imperva support: DDoS exceptions cannot match a user agent.
Note: Imperva's guides need a browser session to read, so menu names may differ in your console. Advanced Bot Protection is a separate product: ask Imperva to allow the user agent there.
Kinsta#
- In MyKinsta, go to Sites, select your site and open Bot protection.
- Under Exceptions, add: Allow, User agent, "OnchargeUnderwritingBot".
- If the check is still challenged, set Protection level to Block malicious traffic (the default): the Block automations, Challenge bots and Challenge everyone levels stop it.
- Exceptions are set per environment, so add it to each environment the check visits. For rules Kinsta manages, contact Kinsta Support.
Note: Bot protection is not available when your site sits behind another CDN or proxy; follow that provider's steps instead.
Kinsta documentation: https://kinsta.com/docs/wordpress-hosting/mykinsta-tools/wordpress-tools-bot-protection/
WP Engine#
- In the WP Engine User Portal, go to Sites, select the environment and open Web Rules (it may be under Advanced).
- Delete any Deny access rule with a User-Agent header condition that matches the check.
- Open a support ticket asking WP Engine to exempt the user agent "OnchargeUnderwritingBot" from Global Edge Security bot rules and platform rate limits. Include the addresses, times and cf-ray values of blocked requests.
Note: A Web Rules Allow rule only lifts IP addresses denied by another rule, so blocks at the platform level need WP Engine support.
WP Engine documentation: https://wpengine.com/support/web-rules-engine/
SiteGround#
- SiteGround's anti-bot system has no setting in Site Tools that lets a service through.
- Contact SiteGround Support with the service name (OnCharge site check), your site's address, the user agent "OnchargeUnderwritingBot" and the times the check ran. There is no fixed IP address to give them.
- Run the check again once they confirm.
Note: Only search engine crawlers are exempt; other automated visitors can be shown the robot challenge.
SiteGround documentation: https://www.siteground.com/kb/seeing-captcha-website/
Any other firewall#
- Find the firewall: run curl -sI -A "OnchargeUnderwritingBot/1.0 (+https://oncharge.io)" followed by your store's address. The response headers usually name the vendor. Then find the request in the firewall's security or event log and note which rule stopped it.
- Add an exception (Allow, Skip, Bypass or Exclude) for requests whose User-Agent contains "OnchargeUnderwritingBot". To be stricter, also require the request header "OnCharge-Scan" to be present. Limit it to bot detection, JavaScript or captcha challenges and rate limiting, and keep injection and attack rules on.
- Place it before any blocking rule, then publish or activate it.
- If your firewall can only allow IP addresses or verified bots, pause its bot challenge or "under attack" feature while the check runs, or ask the vendor's support to allow the user agent. Our check has no fixed IP addresses.
- Run the curl command again and expect a 200 with no challenge, then run the check again.