Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsigned data copied as part of image upgrade #1894

Open
d3zd3z opened this issue Jan 26, 2024 · 1 comment
Open

Unsigned data copied as part of image upgrade #1894

d3zd3z opened this issue Jan 26, 2024 · 1 comment

Comments

@d3zd3z
Copy link
Member

d3zd3z commented Jan 26, 2024

There have been a few instances of this reported through security channels. Given that this is a fairly low-risk vulnerability (it isn't a direct vulnerability but could be used by another vulnerability), I'm reporting is as a regular issue.

The idea is that there are several mechanisms in mcuboot, where an attacker could inject data into the upgrade slot that would then be copied into the primary slot when the upgrade is used. These areas are not part of the data where the signature is checked, and could allow for an ROP attack to make use of the additional code.

For many uses of mcuboot, this isn't an additional risk, as the upgrade slot is also in addressable flash, and is likely also executable. One mitigation of this would be to configure an MPU to prevent execution from the upgrade slot. In the case of an external slot 1, it may be less likely to be executed, and code placed.

There are several potential ways this data could be injected:

  • Data after the TLV. The current code appears to copy the entire sector after the TLV, which could result in some amount of data being copied.
  • Various TLV entries. There are currently no checks on the TLV with custom and other entries placed into the unprotected TLV section. These could contain code.
@Laczen
Copy link

Laczen commented Jan 30, 2024

@d3zd3z, it isn't immediately clear to me, but does this mean a rogue application could be "piggybacked" (added) on a valid application as a tlv ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants