{"@ID": "841", "@Name": "Improper Enforcement of Behavioral Workflow", "@Abstraction": "Class", "@Structure": "Simple", "@Status": "Incomplete", "Description": "The product supports a session in which more than one behavior must be performed by an actor, but it does not properly ensure that the actor performs the behaviors in the required sequence.", "Extended_Description": {"xhtml:p": ["By performing actions in an unexpected order, or by omitting steps, an attacker could manipulate the business logic of the product or cause it to enter an invalid state. In some cases, this can also expose resultant weaknesses.", "For example, a file-sharing protocol might require that an actor perform separate steps to provide a username, then a password, before being able to transfer files. If the file-sharing server accepts a password command followed by a transfer command, without any username being provided, the product might still perform the transfer.", "Note that this is different than CWE-696, which focuses on when the product performs actions in the wrong sequence; this entry is closely related, but it is focused on ensuring that the actor performs actions in the correct sequence.", "Workflow-related behaviors include:"], "xhtml:ul": {"xhtml:li": ["Steps are performed in the expected order.", "Required steps are not omitted.", "Steps are not interrupted.", "Steps are performed in a timely fashion."]}}, "Related_Weaknesses": {"Related_Weakness": {"@Nature": "ChildOf", "@CWE_ID": "691", "@View_ID": "1000", "@Ordinal": "Primary"}}, "Weakness_Ordinalities": {"Weakness_Ordinality": [{"Ordinality": "Primary"}, {"Ordinality": "Resultant"}]}, "Applicable_Platforms": {"Language": {"@Class": "Not Language-Specific", "@Prevalence": "Undetermined"}}, "Modes_Of_Introduction": {"Introduction": {"Phase": "Implementation", "Note": "REALIZATION: This weakness is caused during implementation of an architectural security tactic."}}, "Common_Consequences": {"Consequence": {"Scope": "Other", "Impact": "Alter Execution Logic", "Note": "An attacker could cause the product to skip critical steps or perform them in the wrong order, bypassing its intended business logic. This can sometimes have security implications."}}, "Detection_Methods": {"Detection_Method": {"@Detection_Method_ID": "DM-14", "Method": "Automated Static Analysis", "Description": "Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect \"sources\" (origins of input) with \"sinks\" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)"}}, "Demonstrative_Examples": {"Demonstrative_Example": {"Intro_Text": "This code is part of an FTP server and deals with various commands that could be sent by a user. It is intended that a user must successfully login before performing any other action such as retrieving or listing files.", "Example_Code": [{"@Nature": "Bad", "@Language": "Python", "xhtml:div": {"xhtml:div": {"@style": "margin-left:1em;", "xhtml:div": {"xhtml:div": [{"@style": "margin-left:1em;", "xhtml:br": null, "#text": "loginUser(args)return"}, {"@style": "margin-left:1em;", "xhtml:br": null, "xhtml:div": {"@style": "margin-left:1em;", "xhtml:br": null, "#text": "sendFile(args)return"}, "#text": "if authenticated(user) and ownsFile(user,args):"}, {"@style": "margin-left:1em;", "xhtml:br": null, "#text": "listFiles(args)return"}], "xhtml:br": [null, null, null, null, null, null], "xhtml:i": ["# user has requested a file", "..."], "#text": "if command == 'Login':\n                           \n                           \n                           \n                           if command == 'Retrieve_file':\n\t\t\t   \n                           if command == 'List_files':"}}, "#text": "def dispatchCommand(command, user, args):"}}, {"@Nature": "Good", "@Language": "Python", "xhtml:div": {"xhtml:div": {"@style": "margin-left:1em;", "xhtml:div": {"xhtml:br": [null, null, null, null], "xhtml:i": ["...", "..."], "xhtml:div": {"@style": "margin-left:1em;", "xhtml:div": {"@style": "margin-left:1em;", "xhtml:br": null, "#text": "listFiles(args)return"}, "#text": "if authenticated(user) and ownsDirectory(user,args):"}, "#text": "if command == 'List_files':"}}, "#text": "def dispatchCommand(command, user, args):"}}], "Body_Text": ["The server correctly avoids sending files to a user that isn't logged in and doesn't own the file. However, the server will incorrectly list the files in any directory without confirming the command came from an authenticated user, and that the user is authorized to see the directory's contents.", "Here is a fixed version of the above example:"]}}, "Observed_Examples": {"Observed_Example": [{"Reference": "CVE-2011-0348", "Description": "Bypass of access/billing restrictions by sending traffic to an unrestricted destination before sending to a restricted destination.", "Link": "https://www.cve.org/CVERecord?id=CVE-2011-0348"}, {"Reference": "CVE-2007-3012", "Description": "Attacker can access portions of a restricted page by canceling out of a dialog.", "Link": "https://www.cve.org/CVERecord?id=CVE-2007-3012"}, {"Reference": "CVE-2009-5056", "Description": "Ticket-tracking system does not enforce a permission setting.", "Link": "https://www.cve.org/CVERecord?id=CVE-2009-5056"}, {"Reference": "CVE-2004-2164", "Description": "Shopping cart does not close a database connection when user restores a previous order, leading to connection exhaustion.", "Link": "https://www.cve.org/CVERecord?id=CVE-2004-2164"}, {"Reference": "CVE-2003-0777", "Description": "Chain: product does not properly handle dropped connections, leading to missing NULL terminator (CWE-170) and segmentation fault.", "Link": "https://www.cve.org/CVERecord?id=CVE-2003-0777"}, {"Reference": "CVE-2005-3327", "Description": "Chain: Authentication bypass by skipping the first startup step as required by the protocol.", "Link": "https://www.cve.org/CVERecord?id=CVE-2005-3327"}, {"Reference": "CVE-2004-0829", "Description": "Chain: File server crashes when sent a \"find next\" request without an initial \"find first.\"", "Link": "https://www.cve.org/CVERecord?id=CVE-2004-0829"}, {"Reference": "CVE-2010-2620", "Description": "FTP server allows remote attackers to bypass authentication by sending (1) LIST, (2) RETR, (3) STOR, or other commands without performing the required login steps first.", "Link": "https://www.cve.org/CVERecord?id=CVE-2010-2620"}, {"Reference": "CVE-2005-3296", "Description": "FTP server allows remote attackers to list arbitrary directories as root by running the LIST command before logging in.", "Link": "https://www.cve.org/CVERecord?id=CVE-2005-3296"}]}, "Taxonomy_Mappings": {"Taxonomy_Mapping": {"@Taxonomy_Name": "WASC", "Entry_ID": "40", "Entry_Name": "Insufficient Process Validation"}}, "References": {"Reference": [{"@External_Reference_ID": "REF-795"}, {"@External_Reference_ID": "REF-796"}, {"@External_Reference_ID": "REF-797"}, {"@External_Reference_ID": "REF-806"}, {"@External_Reference_ID": "REF-799"}, {"@External_Reference_ID": "REF-667"}, {"@External_Reference_ID": "REF-801"}, {"@External_Reference_ID": "REF-802", "@Section": "pages 29 - 41"}]}, "Mapping_Notes": {"Usage": "Allowed", "Rationale": "This CWE entry is at the Base level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.", "Comments": "Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.", "Reasons": {"Reason": {"@Type": "Acceptable-Use"}}}, "Notes": {"Note": {"@Type": "Research Gap", "xhtml:p": ["This weakness is typically associated with business logic flaws, except when it produces resultant weaknesses.", "The classification of business logic flaws has been under-studied, although exploitation of business flaws frequently happens in real-world systems, and many applied vulnerability researchers investigate them. The greatest focus is in web applications. There is debate within the community about whether these problems represent particularly new concepts, or if they are variations of well-known principles.", "Many business logic flaws appear to be oriented toward business processes, application flows, and sequences of behaviors, which are not as well-represented in CWE as weaknesses related to input validation, memory management, etc."]}}, "Content_History": {"Submission": {"Submission_Name": "CWE Content Team", "Submission_Organization": "MITRE", "Submission_Date": "2011-03-24", "Submission_Version": "1.12", "Submission_ReleaseDate": "2011-03-30"}, "Modification": [{"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2011-06-01", "Modification_Version": "1.13", "Modification_ReleaseDate": "2011-06-01", "Modification_Comment": "updated Common_Consequences"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2011-06-27", "Modification_Version": "2.0", "Modification_ReleaseDate": "2011-06-27", "Modification_Comment": "updated Common_Consequences, Observed_Examples, Related_Attack_Patterns, Relationships"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2012-05-11", "Modification_Version": "2.2", "Modification_ReleaseDate": "2012-05-15", "Modification_Comment": "updated Demonstrative_Examples, Observed_Examples, Relationships"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2017-11-08", "Modification_Version": "3.0", "Modification_ReleaseDate": "2017-11-08", "Modification_Comment": "updated Modes_of_Introduction, References, Relationships"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2020-02-24", "Modification_Version": "4.0", "Modification_ReleaseDate": "2020-02-24", "Modification_Comment": "updated Relationships"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2021-10-28", "Modification_Version": "4.6", "Modification_ReleaseDate": "2021-10-28", "Modification_Comment": "updated Relationships"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2022-04-28", "Modification_Version": "4.7", "Modification_ReleaseDate": "2022-04-28", "Modification_Comment": "updated Demonstrative_Examples"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2023-01-31", "Modification_Version": "4.10", "Modification_ReleaseDate": "2023-01-31", "Modification_Comment": "updated Common_Consequences, Description"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2023-04-27", "Modification_Version": "4.11", "Modification_ReleaseDate": "2023-04-27", "Modification_Comment": "updated References, Relationships"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2023-06-29", "Modification_Version": "4.12", "Modification_ReleaseDate": "2023-06-29", "Modification_Comment": "updated Mapping_Notes"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2025-12-11", "Modification_Version": "4.19", "Modification_ReleaseDate": "2025-12-11", "Modification_Comment": "updated Applicable_Platforms, Detection_Factors, Relationships, Type, Weakness_Ordinalities"}], "Contribution": {"@Type": "Feedback", "Contribution_Name": "Anonymous External Contributor", "Contribution_Date": "2021-11-11", "Contribution_Comment": "Reported an error in a demonstrative example"}}}
