Auto Virtual Patching

Sectora's killer feature: deploy a WAF rule that blocks the exact attack a finding describes, in under 30 seconds, while engineering ships the real fix.

The problem this solves

A scanner finds a SQLi at POST /api/v1/users/search. Cool. Now what?

Without virtual patching, your options are:

  • Wait for engineering to fix it. Best case: hours. Worst case: weeks for legacy code.
  • Take the endpoint offline. Breaks the product.
  • Hand-write a WAF rule in ModSecurity / Cloudflare Rules. Slow + error-prone + you might get the syntax wrong and block legitimate traffic.

Sectora's virtual patching is option 4: click a button on the finding, Shield deploys a rule that blocks the exact request shape that triggers the bug, globally in <30 seconds. Real fix ships later — when it's ready, you delete the patch.

How it works under the hood

When you click Virtual-patch on a finding, Sectora derives a request signature from the exploit:

Finding: SQLi at POST /api/v1/users/search, param "name"
Original exploit: name="' OR '1'='1"

Generated rule:
  - URL: /api/v1/users/search
  - Method: POST
  - When parameter "name" matches /['"]\s*(OR|UNION|;|--|\*)/i → BLOCK
  - When parameter "name" exceeds 200 bytes → BLOCK
  - When request has no Authorization header → CHALLENGE
  - Audit: log all blocked requests to /__shield/data/audit

The rule is conservative on purpose — better to allow some attacks through than to break a legit user with a SQL-looking name (the famous "O'Brien" problem). Sectora's rule generator is tuned to the matched payload class.

Per-finding patch deployment

  1. Open any DAST / SAST / API finding marked confirmed-exploitable.
  2. Click Virtual-patch. A preview shows the generated rule.
  3. (Optional) Refine — narrow the URL pattern, tighten the payload regex, change action (Block / Challenge / Log).
  4. Pick scope — "just this site" or "all my sites" (useful for shared-codebase vulns).
  5. Click Deploy. Rule lands globally in <30 seconds.

What happens at the edge

The deployed rule is stored in Cloudflare KV (per-customer namespace) and read by the Worker on every request. Decision flow:

  1. Worker resolves which customer this hostname belongs to (config lookup).
  2. Loads the customer's virtual-patch rules from KV (cached in-Worker for 60s).
  3. For each rule, evaluates URL match → method match → parameter regex.
  4. On match, takes the rule's action: 403 Block, Turnstile Challenge, or audit-only Log.
  5. Audit log entry written to __shield/data/audit — appears in Shield analytics.

Response-layer patches

Not every finding is fixed by blocking a request. Because Shield sits in the response path too, it virtual-patches a class of issues most WAFs only report on:

  • CORS misconfiguration (CWE-942) — an Access-Control-Allow-Origin: * (or null, or a reflected origin) combined with Access-Control-Allow-Credentials: true is neutralized at the edge. The credentials grant is stripped on the unambiguous wildcard / null cases; an optional origin allow-list reflects only your trusted origins and revokes the rest. Legitimate single-origin CORS is never touched.
  • Insecure cookies — Set-Cookie headers are rewritten to add Secure automatically (always correct on an HTTPS-only site). HttpOnly / SameSite are surfaced as one-click suggestions, since they can change app behavior.
  • Missing security headers — safe, non-app-specific headers (X-Frame-Options, X-Content-Type-Options, Strict-Transport-Security, …) are filled in when absent, never overriding ones your origin already sets.

These response patches are safe-by-design: each acts only on the unambiguous misconfiguration and is built to never break a working configuration.

Verified protection

A rule existing isn't proof it works. Sectora replays the request that triggered the finding through Shield's live rule engine for your site and records whether the patch's own rule matched it and would block it. The replay is evaluated inside Shield; it is never sent to your origin.

  • When a patch is created — right after the scan that found the issue. On a site with Auto-apply patches on, a staged patch whose replay proves it blocks the exploit is promoted to enforcing; one that isn't proven stays staged and is retried every hour.
  • Every 24 hours after that — every enabled patch, including the ones already enforcing, is replayed again at least once a day. This catches a patch that has stopped blocking its exploit, for example after a new exception rule.
  • On demand — Verify now on the site's Protection Chain page replays one patch immediately.

A replay only records a result. It never promotes, demotes or switches off a patch on its own, apart from the auto-apply promotion above. Each patch's latest result is in the Last replay column on the Virtual Patching page:

  • Proven — the patch's own rule matched the exploit and would block it.
  • Not proven — the replay matched nothing, matched but only logs, or another rule matched first (that rule may still stop the exploit; this patch is unproven).
  • Stopped blocking — the patch was proven before and the latest replay found nothing blocks the exploit any more. The finding is exposed again; the page shows a red alert. The patch stays as it is at the edge until you act.
  • Replay could not run — the finding can no longer be loaded, or the replay failed. The earlier result is kept; a failed replay is retried within the hour.
  • Proven (stale) — the last proof is more than 48 hours old, so no replay has landed since; treat the result as out of date.
  • Not replayed yet — a new patch, replayed within the next day.

Only patches that are enforcing and proven by their own replay count as Protected on the closed-loop dashboard. Patches in log-only mode or switched off count as Observing, and a proven patch on a site in monitor mode is reported as matched but not blocking in production. The dashboard reports mean-time-to-mitigate from that data, not an estimate, and a patch retires itself once a re-scan confirms the underlying bug is fixed.

CVE patches

Besides patches from your own scan findings, Shield patches actively exploited CVEs in the software it sees on your site. Every CVE patch is a reviewed signature from Sectora's catalog: a match on one specific part of the exploit request, tested in CI against the exploit and against normal requests to the same product. A CVE with no recognisable exploit request gets no patch.

  • On every site: Log4Shell, Spring4Shell (including Spring Cloud Function CVE-2022-22963), Apache Struts OGNL injection and PHP-CGI argument injection are blocked from a site's first request.
  • Scoped to your stack: every other CVE patch is added only to sites where Shield has fingerprinted the affected software and version, and starts staged — recorded at the edge, not blocking.
  • Proven: each staged patch is replayed with the exploit requests from its catalog entry, with only that patch evaluated. It must catch every one.
  • Soaked: it then watches your real traffic for at least 7 days and 1,000 requests. Any match on a request Shield did not already judge hostile stops it from arming on your site, and you decide on the Virtual Patching page.
  • Armed: with Auto-apply patches on and your software's version known, a proven, cleanly soaked patch starts enforcing automatically and you are notified. Otherwise promote it yourself; the page shows the soak result first.
  • False positives: report one on a CVE patch and it goes back to staged on your site at once, Sectora is alerted to fix the signature, and that signature version stops arming on every site until it is fixed.

Suggestions mode (change control)

By default (Auto-apply patches on), a patch for a high/critical, high-confidence finding is created staged and starts enforcing as soon as its replay proves it blocks the exploit. For change-controlled or compliance environments, switch Auto-apply patches off on the site page to run in suggestions-only mode: patches are still generated and replayed, but stay staged (recorded at the edge, not blocking) until a human promotes each one. Combine with Monitor mode to watch a patch's would-be blocks before it ever enforces.

Rule lifecycle

A patch made from a DAST finding retires itself. When a clean rescan of the same kind no longer finds the vulnerability, the patch is scheduled to expire 7 days later; if a later rescan finds it again, the expiry is cancelled. An incomplete or failed rescan can keep a patch alive but never retires one. Each patch keeps a link to the finding it came from.

Bulk patching

Select up to 50 findings and click Patch Selected to create a patch for each in one step. Findings that are already patched or cannot be patched are skipped.

Limitations

  • Most virtual patches act at the request level. Response-layer patches cover specific response misconfigurations (CORS, cookie flags, missing security headers), but deeper logic bugs that leak data in the response body still need a real code fix.
  • Encrypted payloads (e.g. JWE bodies) can't be inspected — virtual patches on encrypted endpoints are limited to URL/method/header matching.
  • The patch is only effective if traffic actually goes through Shield. If an attacker reaches your origin directly (e.g. via the public IP), the patch is bypassed. Turn on Origin Lock so your origin refuses requests that did not come through Shield — allow-listing Cloudflare's IP ranges is not enough, since every Cloudflare customer shares them.

What's next

  • Shield overview — the 9-layer architecture.
  • Managed Rulesets — pre-built rules complementing your virtual patches.
  • DAST — the most common source of virtual-patch-eligible findings.