You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE/SECURITY/BUG] Add hash key validation to check the files downloaded from external projects #3418
Currently all external projects are downloaded/compiled without checking if their MD5/SHA are valid, so if their content get modified we will not know, ie:
changed the title [-][FEATURE/SECURITY/BUG] Add harsh key validation to check the files downloaded from external projects[/-][+][FEATURE/SECURITY/BUG] Add hash key validation to check the files downloaded from external projects[/+]on Mar 4, 2026
Looking into the repository, we actually already have apps/tools/check-hash.sh in tree (added around NuttX 7.29), but currently only 5 packages (inih, psmq, embedlog, rtttl-c, morsey) utilize it. Flagship packages like LVGL, zlib, and others still download archives without validation.
I propose the following approach:
Enhance apps/tools/check-hash.sh:
Add md5 support alongside sha1|sha224|sha256|sha384|sha512.
Replace legacy which checks with POSIX command -v.
Add a fallback to Python 3's hashlib if neither <algo>sum nor shasum is available on the host build environment.
Normalize hash comparison to be case-insensitive.
Standardize Makefile & CMake Integration:
Define CHECKHASH ?= $(APPDIR)/tools/check-hash.sh centrally in apps/Make.defs so individual Makefiles do not need ad-hoc tool paths.
Allow optional hash overrides (e.g., LVGL_SHA256 ?= ...), skipping validation gracefully only if an upstream hash is explicitly cleared or pointing to an unversioned dev branch.
Add matching URL_HASH validation in CMakeLists.txt (FetchContent_Declare).
Rollout:
Start with graphics/lvgl (and optionally system/zlib) as the primary pilot PR, followed by rolling it out systematically to the remaining external packages.
Please let me know if this plan looks good to you, and feel free to assign this issue to me.
Thanks @Swatantra-66 yes please provide the PR with solution proposition :-)
MD5 is not considered secure, we should use SHA256+ where possible.
okay to replace which with command -v.
For now I would avoid Python in the *.sh scripts. We have clear separation of interpreters and dependencies. Python became moving target while shell is stable. We may want to fallback to pythoh when we hit a wall with existing problem, or create a dedicated python script for that. For now please avoid mixing the Python in.
okay with lowercase hash comaprison.
okay with CHECKHASH centralization in apps/Make.defs.
okay with optional overrides.
okay with example implementation in graphics/lvgl and system/zlib.
Activity
[-][FEATURE/SECURITY/BUG] Add harsh key validation to check the files downloaded from external projects[/-][+][FEATURE/SECURITY/BUG] Add hash key validation to check the files downloaded from external projects[/+]Swatantra-66 commentedon Oct 10, 2026
Hi @acassis,
I would like to take this up!
Looking into the repository, we actually already have
apps/tools/check-hash.shin tree (added around NuttX 7.29), but currently only 5 packages (inih,psmq,embedlog,rtttl-c,morsey) utilize it. Flagship packages like LVGL, zlib, and others still download archives without validation.I propose the following approach:
Enhance
apps/tools/check-hash.sh:md5support alongsidesha1|sha224|sha256|sha384|sha512.whichchecks with POSIXcommand -v.hashlibif neither<algo>sumnorshasumis available on the host build environment.Standardize Makefile & CMake Integration:
CHECKHASH ?= $(APPDIR)/tools/check-hash.shcentrally inapps/Make.defsso individual Makefiles do not need ad-hoc tool paths.LVGL_SHA256 ?= ...), skipping validation gracefully only if an upstream hash is explicitly cleared or pointing to an unversioned dev branch.URL_HASHvalidation inCMakeLists.txt(FetchContent_Declare).Rollout:
graphics/lvgl(and optionallysystem/zlib) as the primary pilot PR, followed by rolling it out systematically to the remaining external packages.Please let me know if this plan looks good to you, and feel free to assign this issue to me.
cederom commentedon Oct 11, 2026
Thanks @Swatantra-66 yes please provide the PR with solution proposition :-)
whichwithcommand -v.*.shscripts. We have clear separation of interpreters and dependencies. Python became moving target while shell is stable. We may want to fallback to pythoh when we hit a wall with existing problem, or create a dedicated python script for that. For now please avoid mixing the Python in.CHECKHASHcentralization inapps/Make.defs.graphics/lvglandsystem/zlib.Thank you and have fun! :-)
Swatantra-66 commentedon Oct 11, 2026
Thanks @cederom! I have submitted the proposal in #3833 incorporating all the points discussed. Looking forward to your review! :-)
tools/check-hash: add checksum validation for external downloads
tools/check-hash: add checksum validation for external downloads
tools/check-hash: add checksum validation for external downloads
cederom commentedon Oct 19, 2026
BIG THANK YOU @Swatantra-66 :-)