[Security] Krux firmware 24.07.0, 24.09.0 and 24.09.1 can be "hacked" with using a SD card #472
tadeubas
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We have been developing the firmware in a way to enhance the security of the devices for some time now.
For example, the version 24.03.0 brought:
And the version 24.07.0:
But while experimenting with Krux Apps (to sign Nostr events, enable games and additional OpSec features) I've discovered a way to tamper a device in memory firmware using the SD card. This "hack" could pass undetected by the user even with the new Tamper detection feature. It appears to work only when the real-time compiler and REPL were disabled on version 24.07.0, so it doesn't appear to work on version prior to 24.07.0.
Place the
os.mpy(48 bytes) file in the root directory of a SD card and connect this SD card to a Krux device, then restart Krux and it will freeze with the K logo on the screen. When connected to the device via terminal (using Maixpy IDE for example) you will see theFAKEEEEEprint statement.Terminal output example (notice the
FAKEEEEEtext):The flaw is exploited using the current Maixpy / Micropython implementation. It enables the import of Python libs from the Virtual File System (VFS) layer, so the SD card
/sdpath can be used to import a lib likeosfor exemple. When this file is present on the SD card, anyimport osinstruction in the firmware code loads the correspondingoslib found into theSD cardfirst instead of trying to import fromflashinternal memory. @jdlcdl and @odudex tried to fix this with some commits, but the permanent fix was to disable the import of any python code from VFS, fixed with this Micropython commit and this Maixpy commitNOTE that the
.mpyfile could't be uploaded to Github because of its extension, so a.txtsuffix was added (rename the file by removing the.txtsuffix before placing it on a SD card).FILE: os.mpy.txt
Beta Was this translation helpful? Give feedback.
All reactions