system/nxpkg: Validate catalog and database contents before use. - #3718
Open
aviralgarg05 wants to merge 1 commit into
Open
system/nxpkg: Validate catalog and database contents before use.#3718aviralgarg05 wants to merge 1 commit into
aviralgarg05 wants to merge 1 commit into
Conversation
A manifest and an installed-database entry were trusted as read. A name or a version carrying a path separator therefore reached the filesystem, and a database could name a current version it did not list as installed. Check that those fields are usable as single path components, that the current and previous versions appear among the installed ones, and apply a size limit to each field. Compare versions by their numeric prefix without overflowing, falling back to the remainder so that 1a and 1b are not read as the same version. Carry an optional icon and record the manifest of the version actually installed, which a rollback can leave behind the catalog. Assisted-by: OpenAI Codex:gpt-5.6-sol Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
This was referenced Aug 11, 2026
🔗 Cross-repo PR dependenciesThe read-only Build run reported the following dependent PR(s) and fetched head SHA(s): CI run: https://github.com/apache/nuttx-apps/actions/runs/31526606011 |
xiaoxiang781216
approved these changes
Aug 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note: Please adhere to Contributing Guidelines.
Depends-On: /pull/3642
Summary
A manifest read from a catalog, and an entry read from the installed
database, were used as they arrived. A name or a version containing a path
separator therefore reached the filesystem, and a database could name a
current version that it did not list among the installed ones.
This checks those fields are usable as a single path component, that the
current and previous versions appear in the recorded version list, and
applies a size limit to each field.
Version comparison also had two problems: it could overflow on a long
numeric prefix, and it treated versions sharing that prefix as equal, so 1a
and 1b compared the same. It now compares the numeric part without
overflowing and falls back to the remainder.
The manifest gains an optional icon, and the manifest actually recorded for
an installed version can now be read back, which matters after a rollback
has left the installed version behind the catalog.
This is the second of four parts of #3642, which was one commit covering
several unrelated changes.
Impact
longer smuggle a path traversal through a name or version field.
before. One that was not is now rejected instead of being acted on.
Testing
Build host: macOS 26.5, arm64,
xtensa-esp-elf-gcc 14.2.0(
esp-14.2.0_20251107).Target: Xtensa / ESP32-S3, Waveshare ESP32-S3-Touch-LCD-7.
nxstyle,tools/checkpatch.sh,codespellandgit diff --checkonevery changed file
system/nxpkgsources compiled for the target with this commitapplied on top of system/nxpkg: Make the storage root configurable and crash-safe. #3642
This commit does not build on
masteralone because it uses declarationsadded by #3642; the
Depends-Online above lets CI apply that first.PR verification Self-Check