Hello Nordic Team,
I’m currently working with the nRF5340-DK and nRF Connect SDK (v2.6) using VS Code. I’ve been testing OTA firmware update processes using MCUboot and signature verification.
I’d like to describe a scenario I encountered and ask for clarification regarding secure firmware update enforcement.
Scenario:
-
I created a firmware image, signed it using my private key (standard MCUboot RSA signing).
-
I successfully performed an OTA update and verified the image was accepted.
-
I then took that signed image (or the project ZIP), moved it to another computer.
-
On this new machine, I deleted the original
build/folder and re-built the firmware, making minor changes. -
I then re-signed the firmware using the same private key, and attempted to OTA update the same device again.
-
Surprisingly, the device accepted and installed the modified image.
Concern:
Since the firmware was modified and re-signed on a completely different machine, I expected the device to reject the new image. However, it appears the device still accepts any image as long as it is signed — even if it's been modified or generated outside of the trusted build environment.
This raises a concern:
If someone obtains the private key, they can generate their own signed firmware, even if they are not the trusted developer.
My Questions:
-
Is there a way to prevent re-signed or modified firmware from being accepted — even if the private key is the same?
-
How can I ensure that only firmware coming from a trusted build environment can be updated OTA on the device?
-
What is the recommended production practice to:
-
Avoid signing firmware on local machines
-
Embed public key securely on the device
-
Ensure that only legitimate, versioned, untampered firmware is accepted
-
Any advice, documentation, or verification on best practices (CI-based signing, manifest usage, anti-rollback, etc.) would be highly appreciated.
Additional Details:
-
Device: nRF5340-DK
-
SDK: nRF Connect SDK v2.6
-
OTA Update via: MCUboot + Zephyr
-
Tools: imgtool for signing, VS Code, west build
Thanks in advance for your support and clarification.
Best regards,
[Mehmet Efe Öten]