Base · Medium

CWE-1310: Missing Ability to Patch ROM Code

Missing an ability to patch ROM code may leave a System or System-on-Chip (SoC) in a vulnerable state.

CWE-1310 · Base Level ·2 Mitigations

Description

Missing an ability to patch ROM code may leave a System or System-on-Chip (SoC) in a vulnerable state.

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.

Potential Impact

Other

Varies by Context, Reduce Maintainability

Demonstrative Examples

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.
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.
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.
Bad
...
						
						bootrom i_bootrom_patch (
							
							.clk_i                   ,
							.req_i      ( rom_req   ),
							.addr_i     ( rom_addr  ),
							.rdata_o    ( rom_rdata_patch )
							
						);
						bootrom_linux i_bootrom_linux (
							
							.clk_i                   ,
							.req_i      ( rom_req   ),
							.addr_i     ( rom_addr  ),
							.rdata_o    ( rom_rdata_linux )
							
						);
						
					assign rom_rdata = (ariane_boot_sel_i) ? rom_rdata_linux : rom_rdata_linux;
					...
Good
...
						
						bootrom i_bootrom_patch (
							
							.clk_i                   ,
							.req_i      ( rom_req   ),
							.addr_i     ( rom_addr  ),
							.rdata_o    ( rom_rdata_patch )
							
						);
						bootrom_linux i_bootrom_linux (
							
							.clk_i                   ,
							.req_i      ( rom_req   ),
							.addr_i     ( rom_addr  ),
							.rdata_o    ( rom_rdata_linux )
							
						);
						
					assign rom_rdata = (ariane_boot_sel_i) ? rom_rdata_patch : rom_rdata_linux;
					...

Mitigations & Prevention

Architecture and DesignImplementation Moderate

Secure patch support to allow ROM code to be patched on the next boot.

Architecture and DesignImplementation Moderate

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.

Frequently Asked Questions

What is CWE-1310?

CWE-1310 (Missing Ability to Patch ROM Code) is a software weakness identified by MITRE's Common Weakness Enumeration. It is classified as a Base-level weakness. Missing an ability to patch ROM code may leave a System or System-on-Chip (SoC) in a vulnerable state.

How can CWE-1310 be exploited?

Attackers can exploit CWE-1310 (Missing Ability to Patch ROM Code) to varies by context, reduce maintainability. This weakness is typically introduced during the Architecture and Design, Implementation, Integration, Manufacturing phase of software development.

How do I prevent CWE-1310?

Key mitigations include: Secure patch support to allow ROM code to be patched on the next boot.

What is the severity of CWE-1310?

CWE-1310 is classified as a Base-level weakness (Medium abstraction). Its actual severity depends on the specific context and how the weakness manifests in your application.