Attacks stop before your code
Shield inspects the path, parameters, body and headers of every request, including in encoded form, and denies those carrying a known attack.
Scenario
DENY · deniedA search parameter contains UNION SELECT: the sqli-union pattern matches with a score of 100. Request denied.
Zarex responseDocs
{
"decision_id": "c20ad4d76fe97759aa27a0c99bff6710",
"verdict": "DENY",
"results": [
{
"rule_type": "SHIELD",
"verdict": "DENY",
"is_dry_run": false,
"reason": {
"pattern": "sqli-union",
"description": "Injection SQL : UNION SELECT (y compris avec commentaires, parenthèses ou espaces exotiques)",
"score": 100
}
}
],
"ruleset_version": "11.3.0+shield-2.0",
"ip": {
"country": "DE",
"asn": "AS64504"
}
}Inspection that sees through encodings
Attacks often hide behind URL encoding, double slashes or exotic whitespace. Shield also inspects the decoded versions of the path, parameters and body, and reads multipart forms field by field.
It covers SQL, NoSQL and LDAP injection, XSS, path traversal, command injection, SSRF, Log4Shell, template injection (SSTI), XXE, mail header injection and recognisable scanning tools.
A score, not just a yes or no
Every signature has a weight. A weak hint alone is not always enough; several hints reinforce each other. You can set a threshold from 1 to 100: below it, the request goes through and the decision says so.
Each decision gives the matching signature, a plain description and the ruleset version that decided: compare before and after an update.
In your code
With no options, every recognised attack is denied.
import { withZarex, shield } from "@zarex/next";
export const GET = withZarex(
{
key: process.env.ZAREX_KEY!,
ipSource: "vercel",
rules: [shield()],
},
async (request) => Response.json({ resultats: [] })
);Ready for production
Body inspected by default
In memory, never stored.
Adjustable threshold
From 1 to 100, to your tolerance.
Ruleset version
In every decision (ruleset_version).
DRY_RUN
Measure before enforcing.
Other protections
Start by observing
Turn the rule on in DRY_RUN, watch the log, then switch to LIVE. A question before you start? Write to us.