Harden privileged command paths and drop the committed binary - #9
Merged
Conversation
Validate catalog identifiers and helper argv before they reach package managers, keep sudo credentials out of logs, run helper scripts as the invoking user, and add CI for fmt, clippy, tests, and cargo audit. Co-authored-by: The Linux IT Guy <TheLinuxITGuy@users.noreply.github.com>
TheLinuxITGuy
marked this pull request as ready for review
September 1, 2026 23:44
Add the official rustup installer plus PATH setup for toolchains older than 1.92, and rephrase Requirements around cargo build deps instead of a Quick Start script. Co-authored-by: The Linux IT Guy <TheLinuxITGuy@users.noreply.github.com>
Walk up from the executable to the checkout root that holds apps_config.csv and helper scripts, keep a CWD fallback, and report every directory that was searched. Co-authored-by: The Linux IT Guy <TheLinuxITGuy@users.noreply.github.com>
Detect a missing flatpak binary before any helper runs it, install the package with sudo -S through the existing credential flow, and refuse to spawn flatpak from main.sh unless it is on PATH. Co-authored-by: The Linux IT Guy <TheLinuxITGuy@users.noreply.github.com>
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.
This PR audits and hardens The Linux IT Guy Toolbox: identifier validation, safer privilege handling, secret hygiene, helper-script cleanup, removal of the committed binary, and CI.
The product behavior is unchanged at a high level (install/remove catalog apps, Administration tab, Arch/Debian/Fedora). Branding and the MIT license are unchanged. GitHub Releases are unchanged.
Follow-ups on this branch
cargo build --release→./target/release/linux-it-guy-toolbox, with a rustup installer one-liner and Requirements wording that no longer mentions a Quick Start script.target/releasefinds the repo-rootapps_config.csv), also checks beside the helper scripts, then falls back to the current working directory. The Process Log lists the directories that were searched instead of implying./apps_config.csv.flatpakbinary, installs theflatpakpackage withsudo -S(pacman/apt/dnf), then continues the catalog Flatpak install.main.shwill not spawnflatpakunless it is on PATH.Findings by severity
High
main.sharguments were passed through topacman/apt/dnf/flatpakwithout checking that they looked like package names or Flatpak IDs. Values that look like flags or contain unexpected characters are now rejected in both Rust and bash.sudo -S bash …, so Flatpak remotes, catalog scripts, and other user-level work inherited root. Scripts now run as the invoking user.sudois cached once withsudo -S -vand used only where the scripts already call it.linux-it-guy-toolboxwas tracked in git. It is removed;.gitignorealready excluded rebuilds.Medium
sudo -k.pacman -Syu --noconfirmand, for Steam, uncommented[multilib]inpacman.conf. Single-package installs now usepacman -S --neededonly. Steam on Arch fails with a clear message if multilib is not already enabled. Full upgrades stay on the explicit Update System task.set -euo pipefail, requires exactly one bundle under~/Downloads, and uses explicit paths. Install scripts resolveSCRIPT_DIRand source shared validators.Low
apps_config.csvproduced an empty UI with no explanation. Load errors and skipped rows now appear in the process log.PATHwith argv-only checks.FUNDING.yml.Unsafe / FFI
No
unsafe, transmute, FFI, or raw-pointer use was found in first-party code. Nothing to isolate.What changed
src/main.rsintovalidate.rs,catalog.rs,runner.rs, andsystem.rs.bash+ allowlisted script + validated flags). Admin scripts take no extra arguments.toolbox-lib.shvalidates package names, Flatpak IDs, labels, and actions.main.shand install helpers source it.flatpakis missing, the runner installs that package first via the existing sudo flow.cargo build --releaseand points at GitHub Releases.Cargo.tomlrecordsrust-version = "1.92"(eframe 0.34.1’s MSRV).cargo fmt --check,clippy --all-targets -- -D warnings,cargo test,cargo audit.Dependencies / cargo audit
Kept
Cargo.lock. Bumped transitivewebbrowser1.2.1 → 1.2.2 andmemmap20.9.10 → 0.9.11.Remaining (ignored in
.cargo/audit.toml, re-check when eframe/winit can move):quick-xml0.39.2 viawayland-scanner0.31.10 (eframe/winit). Scanner pins^0.39. Moving to eframe 0.35+ raises MSRV (1.92+) and changes the UI stack. This parser is used at build time for Wayland protocol XML, not on toolbox catalog input.Intentionally left
--noconfirm/-yon GUI-driven package commands so the UI cannot hang on prompts. Full-system Arch upgrades remain only on Update System.Verification
Locally:
cargo fmt --check,cargo clippy --all-targets --all-features -- -D warnings,cargo test --all-targets(38 passed),cargo audit(remaining two advisories ignored as above). Helper scripts passbash -n.Please rebuild in
~/Documents/Toolboxand retry a Flatpak-only app on a machine withoutflatpakinstalled. The Process Log should show the package install, then Flathub, without sitting until a timeout.