[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
-
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 theFAKEEEEE
print statement.Terminal output example (notice the
FAKEEEEE
text):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
/sd
path can be used to import a lib likeos
for exemple. When this file is present on the SD card, anyimport os
instruction in the firmware code loads the correspondingos
lib found into theSD card
first instead of trying to import fromflash
internal 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
.mpy
file could't be uploaded to Github because of its extension, so a.txt
suffix was added (rename the file by removing the.txt
suffix before placing it on a SD card).FILE: os.mpy.txt
Beta Was this translation helpful? Give feedback.
All reactions