Failure pattern · 7 documented incidents
Automation acts on stale state or authorization
A background job or automation acts on a plan, permission or record that changed after it was read.
See it happen
Watch how this failure unfolds, then switch to the same situation with the safeguard in place. Tap or click any step to replay it.
Scroll the diagram sideways to see every system.
A customer who cancelled is charged anyway.
What goes wrong:
- At 01:00 the job reads the list of accounts it will bill.
- At 01:20 an admin cancels account #77.
- At 02:00 the job acts on the list it read an hour ago.
- A customer who cancelled is charged anyway.
With the safeguard:
- At 01:00 the job reads the list of accounts it will bill.
- At 01:20 an admin cancels account #77.
- Just before acting, the job re-checks each account’s current version.
- The change is caught and the charge is skipped.
What it is
An automated job reads the state of the world, then acts on it later. In between, something changed: an account was cancelled, a permission removed, a newer plan applied. The job does the wrong thing with complete confidence.
How it happens
- A job reads its list of work well before acting on it
- Two automations can update the same thing at once
- Permissions or configuration are cached and not re-checked
What it causes
- Charges, deletions or changes applied to things that changed
- An older plan overwriting a newer one
- Access granted after it had already been revoked
Warning signs
- Actions that contradict the current state of the record
- Race conditions that only appear under load
- Two automations repeatedly undoing each other’s changes
How to prevent it
Re-check state and permission at the moment of action. Use version checks or optimistic locking on every mutation, re-validate authorization when the action runs rather than when it was queued, and refuse to apply plans that are older than the current state.
- Before acting, a job re-reads the record and checks it hasn’t changed (a version or compare-and-set check)
- Only one automation can own a given change at a time
- Permissions are checked at the moment of action, not when the job was planned
Key ideas:Optimistic concurrency control
How to verify
Use synthetic data in an isolated test environment. These checks are engineering guidance; a checkmark is your team’s assessment.
1. Try: Queue an action, then change the target version or revoke the actor’s permission before execution.
Pass when: The action revalidates current state and permission and rejects the stale plan.
2. Try: Run two workers against the same version of a record.
Pass when: Only a valid version transition succeeds; conflicting work is rejected or safely recomputed.
Evidence to keep: Keep concurrency tests and version and authorization decisions from execution time.
Real incidents with this pattern
Documented incidents first. Each links to its public source.
Database permissions change doubles a bot-management feature file and crashes edge proxies (Cloudflare, 2025)
A ClickHouse access-control change made table permissions explicit, so a query without a database filter returned duplicate rows and doubled the size of the Bot Management feature file.
Safeguard: Validate generated configuration before global propagation
Latent race condition in DNS automation leaves DynamoDB's regional endpoint with an empty record (AWS, 2025)
A latent race condition in DynamoDB's DNS management system produced an empty DNS record for the regional endpoint that the automation could not repair, so clients could not resolve the endpoint.
Safeguard: Make control-plane automation safe against stale plans
Dormant configuration error in legacy routing systems withdraws Cloudflare's 1.1.1.1 DNS resolver worldwide (2025)
A configuration change on June 6, 2025 for a not-yet-used service accidentally included the 1.1.1.1 resolver's IP prefixes in that service's topology; the error sat dormant in production.
Safeguard: Validate configuration against what it will change, not only what it adds
Unplanned automatic OS update cuts networking for Heroku apps and its own status tools (2025)
An automated operating-system update ran on production hosts when it should have been disabled, and restarted their networking service.
Safeguard: Allow changes to production only through the controlled deployment path
Blank provisioning parameter leads to automatic deletion of a customer's private cloud (UniSuper / Google Cloud, 2024)
An input parameter was left blank in an internal provisioning tool, so the system assigned an unknown default fixed one-year term to the customer's VMware Private Cloud.
Safeguard: Never let a blank input silently choose a default lifetime
Deletion script given site IDs instead of app IDs removes 775 customers' sites (Atlassian, 2022)
A script meant to retire a deprecated app was given IDs for entire customer sites and did not check whether an ID referred to the app or the whole site.
Safeguard: Validate the scope of every ID in destructive scripts
43-second network partition triggers database failover and unreplicated writes (GitHub, 2018)
Network maintenance caused a 43-second loss of connectivity between GitHub's US East Coast hub and its primary data center, which led to 24 hours and 11 minutes of degraded service.
Safeguard: Make automatic failover aware of replication state
More records with this pattern5 security advisories · 4 illustrative scenarios
Showing 9 of 9
Zipline issue could cause actions to run with inconsistent state
Zipline before 4.8.0 contains a race condition vulnerability in src/server/routes/raw/[id].ts that allows remote attackers to bypass file maxViews limits through non-atomic view counting.
Windows DHCP Server issue could cause actions to run with inconsistent state
Time-of-check time-of-use (toctou) race condition in Windows DHCP Server allows an authorized attacker to execute code over a network.
bitcoinjs-lib: Undetected merkle node duplication in block root computation validates a forged transaction list
fastMerkleRoot pads an odd level by hashing the last node with itself. It does not report that it did so, and checkTxRoots never looks for repeated transactions.
Incorrect authorization due to a time-of-check to time-of-use (TOCTOU) race condition in the setACL request…
Incorrect authorization due to a time-of-check to time-of-use (TOCTOU) race condition in the setACL request handling of Apache ZooKeeper.
WordPress Core issue could cause actions to run with inconsistent state
WordPress WordPress Core contains a time-of-check time-of-use (TOCTOU) race condition vulnerability that could allow unauthenticated attackers to execute code on the server during the upgrade window.
Payment Webhook Out-of-Order Delivery State Machine Corruption
Late-arriving payment_failed webhook processed after subscription_renewed, deactivating active paying customer account.
JWT Secret Key Confusion & Privilege Escalation
Backend accepted HMAC-SHA256 tokens signed with public RSA key, allowing attacker to forge administrator tokens.
DNSSEC Key Rollback & Global Domain Invalidation
Mismatched DS records during planned Key Signing Key (KSK) rollover caused recursive resolvers worldwide to return SERVFAIL.
Cross-Tenant Redis Session Hijacking via Unprefixed Cache Keys
Session store used un-namespaced integer user IDs; tenant A authenticated as user 101 retrieved session of tenant B user 101.
In the standards
CollectSEA's mapping; not an official determination by the standards bodies.