CWE-841 Improper Enforcement of Behavioral Workflow
Coverage: 5 rules in the SiteShadow rule registry target this CWE (registry v2.0.0). Regex 5 Also: Taint and heuristic analyzers may also detect related flows (see coverage for the authoritative list) Registry tagging shows intent, for sample-level behaviour and benchmarked gaps see known gaps.
What this means
SiteShadow flagged a workflow that can be bypassed or executed out of order. Many security and fraud controls depend on enforcing state transitions ("you must do A before B").
Why it matters
Workflow bypasses can enable privilege escalation or fraud.
- Fraud: skip payment/verification steps and still obtain goods/access.
- Privilege escalation: jump directly to a privileged state ("verified", "approved", "admin") without the checks.
- Security bypass: skip 2FA/email verification/consent steps.
Safer examples
1) Enforce workflow state server-side
Never trust the client to tell you the current state; load it from the database and validate allowed transitions.
2) Use explicit state machines / transition allowlists
Define allowed transitions and reject everything else (see A11 / B01).
3) Make step-up actions idempotent and auditable
Log transitions and include replay protection for one-time steps (verification tokens, approvals).
How SiteShadow detects it (high level)
- Detects client-controlled state flags and direct writes to privileged states.
- Flags endpoints that mutate state without verifying the previous state or required prerequisites.
References
- CWE-841: https://cwe.mitre.org/data/definitions/841.html
---
← Back to Vulnerability Library
Catch this with SiteShadow Pro.
This vulnerability class is detected by SiteShadow's Pro-tier engines, two-pass interprocedural taint analysis, heuristic flow checks, AI-context scanning, and cross-file detection. The free tier catches OWASP Top 10 single-file patterns; Pro adds the data-flow depth that finds this class of bug.