Join our Newsletter — 33% off our NHI Course
Home› Guides› Virtual Patching and Compensating Controls Guide: Reduce Exposure…
Guide Vulnerability Management

Virtual Patching and Compensating Controls Guide: Reduce Exposure When You Cannot Patch Yet

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 27 October 2026 13 min read
On this page

Some vulnerable systems cannot be patched today: the fix does not exist yet, the vendor has stopped supporting the product, or the asset runs a process that cannot stop. Virtual patching and compensating controls are how a security team reduces the risk of exploitation in that gap, by blocking the known attack path in front of the system or by isolating it, without changing the vulnerable code. Done well, they buy days or months. Done badly, they become a permanent excuse that leaves the flaw in place while a dashboard shows it as handled. This guide covers when to use virtual patches, which control types fit which vulnerabilities, how to build, test and retire them, and how to govern them as time-limited exceptions. It is for vulnerability management, network security, application security and OT teams. WAF technology itself is covered in the Web Application Firewall Guide.

Key takeaways

  • A virtual patch reduces exposure; it does not remove the vulnerability. OWASP defines it as an enforcement layer that detects and blocks exploitation attempts against a known vulnerability without changing the vulnerable code, effective only for traffic it inspects and variants it recognises.
  • Pick the control from the attack path. Web injection flaws suit WAF rules; network service flaws suit IPS signatures and access restriction; unpatchable legacy and OT assets need isolation; a vulnerable feature you do not use should simply be disabled.
  • Every virtual patch is an exception with an expiry date. Record the CVE, the control, the owner, the test evidence and the date by which the real fix or replacement must happen.
  • Test for bypass, not just for the published payload. A rule that blocks one proof of concept can miss alternative encodings, other endpoints or a path that does not cross the enforcement point.
  • Containment is not eviction. If the system was exposed before the virtual patch, assume compromise was possible: hunt, and rotate the secrets and sessions the system holds.

Where virtual patching fits in risk response

NIST SP 800-40 Rev. 4 describes four responses to software vulnerability risk: accept, mitigate, transfer and avoid. Patching is one form of mitigation. The others are the subject of this guide.

ResponseWhat it means (SP 800-40 Rev. 4)ExamplesWhen it is the right choice
Mitigate by removing the flawPatch, upgrade or turn off the vulnerable featureVendor update; disabling an unused protocol or moduleAlways the target state
Mitigate with added controlsMake exploitation harder without changing the softwareWAF or IPS rule, access restriction, segmentationA fix is not yet available, or cannot be deployed before attackers act
TransferShift some consequences to another partyMoving to a SaaS service where the provider patches; insuranceStrategic, for systems you should not run yourself
AvoidRemove the attack surfaceUninstall, decommission, disconnectEnd-of-life products with no fix; KEV entries marked for discontinuation
AcceptRely on existing controls or judge the impact lowLow-severity flaw on an isolated systemDocumented, approved and reviewed risk acceptance only

The SP 800-40 guidance is explicit on timing: emergency mitigations such as deactivating functionality or isolating an asset are temporary and should be replaced with permanent fixes when available. For assets that cannot be patched at all, it recommends approved long-term isolation methods, such as micro-segmentation and software-defined perimeters, with targeted mitigations for gaps, reassessed periodically. CISA's Known Exploited Vulnerabilities catalogue reflects the same logic in its required actions, which for many entries read "apply mitigations per vendor instructions or discontinue use of the product if mitigations are unavailable", and for end-of-life products state that the product should be disconnected.

Choosing the control type

ControlWorks well forWeak againstOperational notes
WAF rule (reverse proxy, cloud WAF, ModSecurity with OWASP CRS)HTTP injection flaws, path traversal, specific vulnerable endpoints or parametersEncrypted traffic it cannot see, logic flaws, attacks that bypass the proxy by reaching the origin directlyLock the origin to accept traffic only from the WAF
IPS signature (for example a Suricata drop rule)Network service flaws with a recognisable protocol patternEncrypted protocols, heavily obfuscated exploitsIn Suricata IPS mode, drop blocks and alerts, and any reject action also drops
Access restrictionManagement interfaces, VPN and admin portals, internal-only services exposed by mistakeAttackers already inside the allowed rangeOften the fastest, most reliable mitigation for edge devices
Feature disablement or configuration changeVulnerabilities in optional components (a protocol, plugin, API, service)Flaws in core functionalityTechnically a real fix for that path; follow vendor mitigation guidance exactly
Segmentation and isolationLegacy, OT and unsupported systemsThreats that use allowed flowsThe long-term option SP 800-40 recommends for unpatchable assets
Endpoint and runtime controlsExploits that end in code execution on a host you manageAppliances where you cannot install agentsApplication control and exploit protection add a second layer
Identity controlsFlaws that need an authenticated session or reuse stolen credentialsPre-authentication flawsStrong MFA and short session lifetimes limit what a bypass yields

Decision guidance

  • If the vendor publishes a mitigation: apply it first, exactly as written, then add a detection rule. Vendor workarounds have been tested against the real flaw.
  • If the flaw is in a web application you control: a WAF virtual patch while the code fix is built. OWASP notes virtual patching is best suited to injection-type flaws and recommends positive (allow list) rules that define valid input over negative rules that try to describe attacks.
  • If the asset is an internet-facing appliance: restrict access to the management and vulnerable interfaces first; an IPS signature is a second layer, not a substitute. See the Network Device Vulnerability Management Guide.
  • If the asset is OT or legacy: isolation, monitoring of the allowed conduits, and a replacement plan. See the OT Patch Management Guide and the OT Network Segmentation Guide.
  • Small versus large organisations: smaller teams get most value from access restriction and vendor workarounds, plus managed WAF rule sets from their provider. Larger teams can run a virtual patching service with a rule pipeline, testing and an exception register.

Building and testing a virtual patch

The OWASP Virtual Patching Cheat Sheet sets out a six-phase method: preparation, identification, analysis, virtual patch creation, implementation and testing, and recovery and follow-up. Turned into an operational procedure:

  1. Prepare before you need it: deploy the enforcement points in advance, subscribe to vendor advisories, pre-authorise an expedited change route for virtual patches, and configure logging that records rule ID, endpoint, outcome and a correlation ID without capturing passwords, tokens or payment data.
  2. Analyse the flaw: record the CVE, affected versions, the configuration needed to trigger it, the vulnerable endpoint or port, and whether it is pre- or post-authentication. Confirm your exposure with an authorised scan; see the Nuclei Vulnerability Scanner Guide.
  3. Write the narrowest effective rule: scope it to the vulnerable path, parameter or service. A broad rule causes false positives and gets switched off.
  4. Deploy in detect-only mode first: for example ModSecurity SecRuleEngine DetectionOnly, or an IPS rule set to alert. Watch real traffic for a short, agreed period to find legitimate requests that would be blocked.
  5. Test both directions: confirm legitimate business workflows still work, and confirm the check is blocked using safe detection templates or the vendor's test guidance, including alternate encodings and other routes to the same function. Never use live exploit code against production.
  6. Switch to block and monitor: alert on rule hits, because hits after disclosure are exploitation attempts and should feed the SOC.
  7. Record the exception: CVE, asset, control, rule ID, owner, test evidence, expiry date and the permanent remediation plan.
  8. Retire it: once the real fix is applied and verified, remove the rule so the rule base does not grow without limit, and close the exception.

Rollback: keep the previous rule set version and a one-step revert path. If a block rule breaks a critical service, revert to detect-only rather than deleting the rule, and add an access restriction while you fix it.

Governing compensating controls

A compensating control is a documented alternative that meets the intent of a requirement when the requirement itself cannot be met. Frameworks expect the same disciplines: PCI DSS, for example, requires a documented compensating control worksheet showing the constraint, the objective, the identified risk, the control and how it is validated and maintained.

  • Exception register: each virtual patch or compensating control has an owner, a business justification, a risk rating and an expiry. Align expiry with your remediation SLAs; see the Remediation SLAs and Vulnerability Exceptions Guide.
  • Maintenance groups: SP 800-40 Rev. 4 recommends that assets that cannot be patched still belong to a maintenance group with defined risk responses, rather than being labelled as exceptions and forgotten.
  • Re-validation: retest each control after changes to the enforcement point, the application or the network path, and at least quarterly for long-lived controls.
  • Escalation: an expired exception escalates to the risk owner automatically, and repeated renewals for the same asset trigger a replace-or-retire decision.

Scenarios and the interim measures that fit them

ScenarioFirst interim measureSecond layerExit condition
Zero-day in an internet-facing VPN or firewall, no patch yetVendor mitigation plus restricting management and portal access to known rangesIPS signature and log review for indicators published in the advisoryVendor fix applied and integrity checked; credentials on the device rotated
Injection flaw in an in-house web applicationWAF allow-list rule on the vulnerable parameterApplication logging and alerting on rule hitsCode fix released and verified by retest
Flaw in a third-party web application you cannot modifyWAF rule scoped to the vulnerable endpoint, or blocking the endpoint if it is unusedRestricting the application to internal users through a proxyVendor release deployed
Vulnerable optional service on servers (a protocol or plugin)Disable the service or block its port at host and network firewallsDetection of attempts to reach the portPatched version deployed, or service permanently removed
Legacy OT controller that cannot be updatedIsolation in its own zone with only required conduits allowedPassive OT monitoring of the allowed flowsPlanned replacement; reassessed at each maintenance window
End-of-life operating system or applianceDisconnect, or isolate with no internet access and no inbound pathsApplication control and strict monitoringDecommissioned by a fixed date approved by the risk owner

Two rules hold across all of these. First, the interim measure should match where the attacker would come from: a WAF in front of an internal-only system protects nothing if the realistic attacker is already on the internal network. Second, vendor guidance outranks home-grown rules, because vendors know which code path is vulnerable and often publish exact configuration mitigations, integrity checking tools and indicators. Where the vendor publishes nothing, treat any virtual patch as lower assurance and shorten its review interval.

Detection and measurement

Log virtual patch rule hits with the CVE they relate to, so the SOC can tell exploitation attempts against known flaws from generic noise. Watch for traffic that reaches the protected asset without passing the enforcement point, such as direct origin access or a new firewall rule.

  • Time to mitigate: hours from KEV listing or vendor advisory to a tested virtual patch or access restriction on exposed assets.
  • Exception age: median and maximum age of open virtual patches, and the count past expiry.
  • Conversion rate: share of virtual patches replaced by a real fix within their expiry window.
  • Bypass test coverage: share of active virtual patches with a recorded bypass test in the last quarter.
  • Exploit attempts blocked: rule hits per CVE, which also shows which exposures attackers are actively probing.
  • False positive rate: business-impacting blocks per rule, which predicts whether a rule will survive in block mode.

Where identity fits

Virtual patches stop new exploitation; they do nothing about credentials an attacker already took. Edge and application flaws frequently expose session tokens, service account passwords, API keys and signing keys held on the vulnerable system. After any period of exposure, rotate the machine credentials and keys on that system and revoke active sessions. See the Edge Device Compromise Investigation Playbook.

Common failure patterns

  • Treating the virtual patch as the fix: the exception never expires, the vulnerable version stays deployed for years, and a later rule change or bypass reopens it.
  • Blocking the payload, not the path: a rule matches the published proof of concept string but not a re-encoded variant or a second vulnerable endpoint.
  • An enforcement point attackers can walk around: the WAF protects the public hostname while the origin server answers directly on its own IP address.
  • Ignoring what was stolen before mitigation: with CitrixBleed, patching stopped new memory leaks but stolen session cookies stayed valid until sessions were killed; in the ToolShell SharePoint exploitation, stolen ASP.NET machine keys let attackers return after the flaw was fixed until the keys were rotated.
  • Rules left in detect-only mode: the test phase never ends, so the "virtual patch" only produces alerts nobody reads.
  • Rule sprawl: virtual patches are never removed after the fix, the rule base becomes unmanageable and teams start disabling whole rule groups.

Framework mapping

FrameworkReferenceRelevance
NIST SP 800-40 Rev. 4Sections 2.1, 3.4, 3.5Risk responses, maintenance groups, emergency and long-term mitigations
NIST CSF 2.0ID.RA-01, PR.PS-02, PR.IR-01Identifying vulnerabilities; maintaining software commensurate with risk; protecting networks from unauthorised access
NIST SP 800-53 Rev. 5SI-2, RA-7, SC-7, CM-7, SA-22Flaw remediation; risk response; boundary protection; least functionality; unsupported system components
CIS Controls v8.1Control 7, Control 13Continuous vulnerability management; network monitoring and defence
ISO/IEC 27001:2022 Annex AA.8.8, A.8.20, A.8.22Management of technical vulnerabilities; network security; segregation of networks
MITRE ATT&CK v20T1190, T1133Exploit Public-Facing Application; External Remote Services

Practitioner checklist

  • Deploy WAF and IPS enforcement points in front of critical exposed services before you need them, and lock origins to accept traffic only through them.
  • Pre-approve an expedited change route for virtual patches and access restrictions.
  • For each new KEV or critical advisory, decide within one working day: patch, vendor mitigation, virtual patch, isolate or disconnect.
  • Deploy every rule in detect-only mode first, then block, with a recorded rollback.
  • Test legitimate workflows and bypass variants, and store the evidence.
  • Register every virtual patch as an exception with owner and expiry; escalate expired entries.
  • Put unpatchable assets in a maintenance group with segmentation and monitoring, plus a replacement date.
  • Rotate secrets and revoke sessions on any system that was exposed before mitigation.
  • Remove virtual patch rules once the real fix is verified.

Standards and references

Related NHI Mgmt Group resources: Web Application Firewall Guide · Patch Management Guide · IDS and IPS Guide · Emergency Out-of-Band Patching Playbook

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 27 October 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.