Safeguard
Application Security•

CWE-1274 Weak Access Control on Volatile Memory Holding Boot Code

Secure boot checks the bootloader, then parks it in RAM. If that RAM is writable by others, the check proves nothing.

Safeguard Security Team
2 min read

CWE-1274 covers a secure boot process that copies bootloader code from non-volatile memory into volatile memory without enough protection on the volatile side. SoC and firmware engineers are the audience.

How it happens

During secure boot, the SoC's ROM code fetches bootloader code from non-volatile memory (NVM), usually external to the chip, and stores it in volatile memory (VM) such as DRAM or SRAM, usually internal. As the code is transferred, the ROM code authenticates it.

Authentication happens at the copy. After that, the code sits in VM. If an adversary or an untrusted agent can modify that region, they can replace the authenticated code with their own, and the secure boot is bypassed.

The recorded example is CVE-2019-2267, where locked memory regions could be modified through other interfaces in a secure-boot-loader image because of improper access control.

What an attacker gains

Rated high: modifying memory, executing unauthorized code or commands, and gaining privileges or assuming identity, with access control and integrity lost. Code running at boot level controls everything above it.

How to find it

MITRE gives two manual analyses.

  • Check that the volatile memory is lockable, and that it is locked against writes from untrusted agents. Try modifying it from an untrusted agent and confirm the writes are dropped.
  • Identify all fabric master agents active during the boot flow when initial code moves from non-volatile storage to volatile memory, and identify the memory regions that hold the loaded executable code. Then check what each agent can do to those regions.

How to fix it

  1. Lock the volatile memory region holding boot code once it is loaded and authenticated.
  2. Allow writes only from the trusted loading path.
  3. Check that every other interface to that region respects the lock, as the CVE shows other interfaces can bypass it.
  4. Keep the test that attempts untrusted writes in your regression suite.

Quick check

Why is authentication at copy time not enough?

The code can be changed after it is authenticated if the memory it sits in is not protected.

Sources

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.