{"@ID": "1332", "@Name": "Improper Handling of Faults that Lead to Instruction Skips", "@Abstraction": "Base", "@Structure": "Simple", "@Status": "Stable", "Description": "The device is missing or incorrectly implements circuitry or sensors that detect and mitigate the skipping of security-critical CPU instructions when they occur.", "Extended_Description": {"xhtml:p": ["The operating conditions of hardware may change\n              in ways that cause unexpected behavior to occur,\n              including the skipping of security-critical CPU\n              instructions. Generally, this can occur due to\n              electrical disturbances or when the device operates\n              outside of its expected conditions.", "In practice, application code may contain\n\t\t\t  conditional branches that are security-sensitive (e.g.,\n\t\t\t  accepting or rejecting a user-provided password). These\n\t\t\t  conditional branches are typically implemented by a\n\t\t\t  single conditional branch instruction in the program\n\t\t\t  binary which, if skipped, may lead to effectively\n\t\t\t  flipping the branch condition - i.e., causing the wrong\n\t\t\t  security-sensitive branch to be taken. This affects\n\t\t\t  processes such as firmware authentication, password\n\t\t\t  verification, and other security-sensitive decision\n\t\t\t  points.", "Attackers can use fault injection techniques to\n\t\t\t  alter the operating conditions of hardware so that\n\t\t\t  security-critical instructions are skipped more\n\t\t\t  frequently or more reliably than they would in a\n\t\t\t  \"natural\" setting."]}, "Related_Weaknesses": {"Related_Weakness": [{"@Nature": "ChildOf", "@CWE_ID": "1384", "@View_ID": "1000", "@Ordinal": "Primary"}, {"@Nature": "PeerOf", "@CWE_ID": "1247", "@View_ID": "1194", "@Ordinal": "Primary"}]}, "Weakness_Ordinalities": {"Weakness_Ordinality": {"Ordinality": "Primary"}}, "Applicable_Platforms": {"Language": {"@Class": "Not Language-Specific", "@Prevalence": "Undetermined"}, "Operating_System": {"@Class": "Not OS-Specific", "@Prevalence": "Undetermined"}, "Architecture": {"@Class": "Not Architecture-Specific", "@Prevalence": "Undetermined"}, "Technology": {"@Class": "System on Chip", "@Prevalence": "Undetermined"}}, "Modes_Of_Introduction": {"Introduction": [{"Phase": "Architecture and Design", "Note": "Failure to design appropriate countermeasures to common fault injection techniques can manifest this weakness."}, {"Phase": "Implementation", "Note": "This weakness can arise if the hardware design incorrectly implements countermeasures to prevent fault injection."}]}, "Common_Consequences": {"Consequence": {"Scope": ["Confidentiality", "Integrity", "Authentication"], "Impact": ["Bypass Protection Mechanism", "Alter Execution Logic", "Unexpected State"], "Likelihood": "High", "Note": "Depending on the context, instruction skipping can\n                        have a broad range of consequences related to the\n                        generic bypassing of security critical code."}}, "Detection_Methods": {"Detection_Method": [{"Method": "Automated Static Analysis", "Description": "This weakness can be found using automated static analysis once a developer has indicated which code paths are critical to protect.", "Effectiveness": "Moderate"}, {"Method": "Simulation / Emulation", "Description": "This weakness can be found using automated dynamic analysis. Both emulation of a CPU with instruction skips, as well as RTL simulation of a CPU IP, can indicate parts of the code that are sensitive to faults due to instruction skips.", "Effectiveness": "Moderate"}, {"Method": "Manual Analysis", "Description": "This weakness can be found using manual (static) analysis. The analyst has security objectives that are matched against the high-level code. This method is less precise than emulation, especially if the analysis is done at the higher level language rather than at assembly level.", "Effectiveness": "Moderate"}]}, "Potential_Mitigations": {"Mitigation": [{"Phase": "Architecture and Design", "Description": "Design strategies for ensuring safe failure if\n                        inputs, such as Vcc, are modified out of acceptable\n                        ranges."}, {"Phase": "Architecture and Design", "Description": "Design strategies for ensuring safe behavior if\n                        instructions attempt to be skipped."}, {"Phase": "Architecture and Design", "Description": "Identify mission critical secrets that should\n                          be wiped if faulting is detected, and design a\n                          mechanism to do the deletion."}, {"Phase": "Implementation", "Description": "Add redundancy by performing an operation\n                          multiple times, either in space or time, and perform\n                          majority voting. Additionally, make conditional\n                          instruction timing unpredictable."}, {"Phase": "Implementation", "Description": "Use redundant operations or canaries to\n                          detect and respond to faults."}, {"Phase": "Implementation", "Description": "Ensure that fault mitigations are strong enough\n                        in practice. For example, a low power detection\n                        mechanism that takes 50 clock cycles to trigger at lower\n                        voltages may be an insufficient security mechanism if\n                        the instruction counter has already progressed with no\n                        other CPU activity occurring."}]}, "Demonstrative_Examples": {"Demonstrative_Example": {"Intro_Text": "A smart card contains authentication credentials that are used as authorization to enter a building. The credentials are only accessible when a correct PIN is presented to the card.", "Example_Code": [{"@Nature": "Bad", "@Language": "Other", "#text": "The card emits the credentials when a voltage anomaly is injected into the power line to the device at a particular time after providing an incorrect PIN to the card, causing the internal program to accept the incorrect PIN."}, {"@Nature": "Good", "@Language": "Other", "xhtml:ul": {"xhtml:li": ["add an internal filter or internal power supply in series with the power supply pin on the device", "add sensing circuitry to reset the device if out of tolerance conditions are detected", "add additional execution sensing circuits to monitor the execution order for anomalies and abort the action or reset the device under fault conditions"]}}], "Body_Text": "There are several ways this weakness could be fixed."}}, "Observed_Examples": {"Observed_Example": {"Reference": "CVE-2019-15894", "Description": "fault injection attack bypasses the verification mode, potentially allowing arbitrary code execution.", "Link": "https://www.cve.org/CVERecord?id=CVE-2019-15894"}}, "Functional_Areas": {"Functional_Area": "Power"}, "Related_Attack_Patterns": {"Related_Attack_Pattern": [{"@CAPEC_ID": "624"}, {"@CAPEC_ID": "625"}]}, "References": {"Reference": [{"@External_Reference_ID": "REF-1161"}, {"@External_Reference_ID": "REF-1222"}, {"@External_Reference_ID": "REF-1223"}, {"@External_Reference_ID": "REF-1224"}, {"@External_Reference_ID": "REF-1286", "@Section": "4.3"}]}, "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"}}}, "Content_History": {"Submission": {"Submission_Name": "Jasper van Woudenberg", "Submission_Organization": "Riscure", "Submission_Date": "2020-10-14", "Submission_Version": "4.3", "Submission_ReleaseDate": "2020-12-10"}, "Modification": [{"Modification_Name": "Jasper van Woudenberg", "Modification_Organization": "Riscure", "Modification_Date": "2021-01-11", "Modification_Version": "4.4", "Modification_ReleaseDate": "2021-03-15"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2021-03-15", "Modification_Version": "4.4", "Modification_ReleaseDate": "2021-03-15", "Modification_Comment": "updated Description, Functional_Areas, Potential_Mitigations, References"}, {"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 Demonstrative_Examples, Description, Detection_Factors, Maintenance_Notes, Name, Observed_Examples, Potential_Mitigations, References, Relationships, Weakness_Ordinalities"}, {"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 Potential_Mitigations, References, Relationships"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2022-06-28", "Modification_Version": "4.8", "Modification_ReleaseDate": "2022-06-28", "Modification_Comment": "updated Relationships"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2022-10-13", "Modification_Version": "4.9", "Modification_ReleaseDate": "2022-10-13", "Modification_Comment": "updated References"}, {"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 Potential_Mitigations, Related_Attack_Patterns"}, {"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-04-03", "Modification_Version": "4.17", "Modification_ReleaseDate": "2025-04-03", "Modification_Comment": "updated Demonstrative_Examples"}], "Contribution": {"@Type": "Content", "Contribution_Name": "Jasper van Woudenberg", "Contribution_Organization": "Riscure", "Contribution_Date": "2021-10-11", "Contribution_Comment": "Provided detection methods and feedback on demonstrative example"}, "Previous_Entry_Name": {"@Date": "2021-10-28", "#text": "Insufficient Protection Against Instruction Skipping Via Fault Injection"}}}
