{"@ID": "1310", "@Name": "Missing Ability to Patch ROM Code", "@Abstraction": "Base", "@Structure": "Simple", "@Status": "Draft", "Description": "Missing an ability to patch ROM code may leave a System or System-on-Chip (SoC) in a vulnerable state.", "Extended_Description": {"xhtml:p": ["A System or System-on-Chip (SoC) that implements a boot process utilizing security mechanisms such as Root-of-Trust (RoT) typically starts by executing code from a Read-only-Memory (ROM) component. The code in ROM is immutable, hence any security vulnerabilities discovered in the ROM code can never be fixed for the systems that are already in use.", "A common weakness is that the ROM does not have the ability to patch if security vulnerabilities are uncovered after the system gets shipped.  This leaves the system in a vulnerable state where an adversary can compromise the SoC."]}, "Related_Weaknesses": {"Related_Weakness": {"@Nature": "ChildOf", "@CWE_ID": "1329", "@View_ID": "1000", "@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": "This issue could be introduced during hardware architecture and design and can be identified later during Testing."}, {"Phase": "Implementation", "Note": "This issue could be introduced during implementation and can be identified later during Testing."}, {"Phase": "Integration", "Note": "This issue could be introduced during integration and can be identified later during Testing."}, {"Phase": "Manufacturing", "Note": "This issue could be introduced during manufacturing and can be identified later during Testing."}]}, "Common_Consequences": {"Consequence": {"Scope": "Other", "Impact": ["Varies by Context", "Reduce Maintainability"], "Likelihood": "High", "Note": "When the system is unable to be patched, it can be left in a vulnerable state."}}, "Potential_Mitigations": {"Mitigation": [{"Phase": ["Architecture and Design", "Implementation"], "Description": "Secure patch support to allow ROM code to be patched on the next boot.", "Effectiveness": "Moderate", "Effectiveness_Notes": "Some parts of the hardware initialization or signature verification done to authenticate patches will always be \"not patchable.\""}, {"Phase": ["Architecture and Design", "Implementation"], "Description": "Support patches that can be programmed in-field or during manufacturing through hardware fuses. This feature can be used for limited patching of devices after shipping, or for the next batch of silicon devices manufactured, without changing the full device ROM.", "Effectiveness": "Moderate", "Effectiveness_Notes": "Patches that use hardware fuses will have limitations in terms of size and the number of patches that can be supported. Note that some parts of the hardware initialization or signature verification done to authenticate patches will always be \"not patchable.\""}]}, "Demonstrative_Examples": {"Demonstrative_Example": [{"@Demonstrative_Example_ID": "DX-146", "Intro_Text": {"xhtml:p": "A System-on-Chip (SOC) implements a Root-of-Trust (RoT) in ROM to boot secure code. However, at times this ROM code might have security vulnerabilities and need to be patched. Since ROM is immutable, it can be impossible to patch."}, "Body_Text": "ROM does not have built-in application-programming interfaces (APIs) to patch if the code is vulnerable. Implement mechanisms to patch the vulnerable ROM code."}, {"Intro_Text": "The example code is taken from the SoC peripheral wrapper inside the buggy OpenPiton SoC of HACK@DAC'21. The wrapper is used for connecting the communications between SoC peripherals, such as crypto-engines, direct memory access (DMA), reset controllers, JTAG, etc. The secure implementation of the SoC wrapper should allow users to boot from a ROM for Linux (i_bootrom_linux) or from a patchable ROM (i_bootrom_patch) if the Linux bootrom has security or functional issues.The example code is taken from the SoC peripheral wrapper inside the buggy OpenPiton SoC of HACK@DAC'21. The wrapper is used for connecting the communications between SoC peripherals, such as crypto-engines, direct memory access (DMA), reset controllers, JTAG, etc. The secure implementation of the SoC wrapper should allow users to boot from a ROM for Linux (i_bootrom_linux) or from a patchable ROM (i_bootrom_patch) if the Linux bootrom has security or functional issues.", "Example_Code": [{"@Nature": "Bad", "@Language": "Verilog", "xhtml:br": [null, null, null, null], "xhtml:div": {"@style": "margin-left:1em;", "xhtml:br": [null, null, null, null], "xhtml:div": [{"@style": "margin-left:1em;", "xhtml:br": [null, null, null, null], "#text": ".clk_i                   ,\n\t\t\t\t\t\t\t.req_i      ( rom_req   ),\n\t\t\t\t\t\t\t.addr_i     ( rom_addr  ),\n\t\t\t\t\t\t\t.rdata_o    ( rom_rdata_patch )"}, {"@style": "margin-left:1em;", "xhtml:br": [null, null, null, null], "#text": ".clk_i                   ,\n\t\t\t\t\t\t\t.req_i      ( rom_req   ),\n\t\t\t\t\t\t\t.addr_i     ( rom_addr  ),\n\t\t\t\t\t\t\t.rdata_o    ( rom_rdata_linux )"}], "#text": "bootrom i_bootrom_patch (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbootrom_linux i_bootrom_linux (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t);"}, "xhtml:b": "assign rom_rdata = (ariane_boot_sel_i) ? rom_rdata_linux : rom_rdata_linux;", "#text": "...\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t..."}, {"@Nature": "Good", "@Language": "Verilog", "xhtml:br": [null, null, null, null], "xhtml:div": {"@style": "margin-left:1em;", "xhtml:br": [null, null, null, null], "xhtml:div": [{"@style": "margin-left:1em;", "xhtml:br": [null, null, null, null], "#text": ".clk_i                   ,\n\t\t\t\t\t\t\t.req_i      ( rom_req   ),\n\t\t\t\t\t\t\t.addr_i     ( rom_addr  ),\n\t\t\t\t\t\t\t.rdata_o    ( rom_rdata_patch )"}, {"@style": "margin-left:1em;", "xhtml:br": [null, null, null, null], "#text": ".clk_i                   ,\n\t\t\t\t\t\t\t.req_i      ( rom_req   ),\n\t\t\t\t\t\t\t.addr_i     ( rom_addr  ),\n\t\t\t\t\t\t\t.rdata_o    ( rom_rdata_linux )"}], "#text": "bootrom i_bootrom_patch (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t);\n\t\t\t\t\t\tbootrom_linux i_bootrom_linux (\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t);"}, "xhtml:b": "assign rom_rdata = (ariane_boot_sel_i) ? rom_rdata_patch : rom_rdata_linux;", "#text": "...\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t..."}], "Body_Text": {"xhtml:p": ["The above implementation causes the ROM data to be hardcoded for the linux system (rom_rdata_linux) regardless of the value of ariane_boot_sel_i. Therefore, the data (rom_rdata_patch) from the patchable ROM code is never used [REF-1396].", "This weakness disables the ROM's ability to be patched. If attackers uncover security vulnerabilities in the ROM, the users must replace the entire device. Otherwise, the weakness exposes the system to a vulnerable state forever.", "A fix to this issue is to enable rom_rdata to be selected from the patchable rom (rom_rdata_patch) [REF-1397]."]}}]}, "Related_Attack_Patterns": {"Related_Attack_Pattern": {"@CAPEC_ID": "682"}}, "References": {"Reference": [{"@External_Reference_ID": "REF-1396"}, {"@External_Reference_ID": "REF-1397"}]}, "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": "Narasimha Kumar V Mangipudi", "Submission_Organization": "Intel Corporation", "Submission_Date": "2020-04-25", "Submission_Version": "4.3", "Submission_ReleaseDate": "2020-12-10"}, "Modification": [{"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 Maintenance_Notes"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2021-07-20", "Modification_Version": "4.5", "Modification_ReleaseDate": "2021-07-20", "Modification_Comment": "updated Demonstrative_Examples, Maintenance_Notes"}, {"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 Applicable_Platforms, Common_Consequences, Potential_Mitigations, 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, 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 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": "2024-02-29", "Modification_Version": "4.14", "Modification_ReleaseDate": "2024-02-29", "Modification_Comment": "updated Demonstrative_Examples, References"}, {"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 Weakness_Ordinalities"}], "Contribution": [{"@Type": "Feedback", "Contribution_Name": "Jason Fung", "Contribution_Organization": "Intel", "Contribution_Date": "2022-09-07", "Contribution_Comment": "suggested removal of incorrect references"}, {"@Type": "Content", "Contribution_Name": "Chen Chen, Rahul Kande, Jeyavijayan Rajendran", "Contribution_Organization": "Texas A&M University", "Contribution_Date": "2023-11-29", "Contribution_Comment": "suggested demonstrative example"}, {"@Type": "Content", "Contribution_Name": "Shaza Zeitouni, Mohamadreza Rostami, Ahmad-Reza Sadeghi", "Contribution_Organization": "Technical University of Darmstadt", "Contribution_Date": "2023-11-29", "Contribution_Comment": "suggested demonstrative example"}]}}
