Skip to content

🔒 Prevent potential command injection in modprobe - #236

Open
undivisible wants to merge 1 commit into
mainfrom
fix-modprobe-injection-14235387394271860600
Open

undivisible wants to merge 1 commit into
mainfrom
fix-modprobe-injection-14235387394271860600

Conversation

@undivisible

@undivisible undivisible commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

🎯 What: The vulnerability fixed is a potential command/argument injection in the modprobe execution block in init.rs.
⚠️ Risk: Although the current inputs are hardcoded, the pattern of passing arguments directly to Command::new without validation is a security hygiene issue. If this list were to be populated dynamically in the future, it could lead to command execution or unintended kernel module loading.
🛡️ Solution: Added strict validation to ensure that the module name is not empty, does not start with a hyphen, and only contains ASCII alphanumeric characters, underscores, and hyphens. Invalid module names are skipped and logged as an error.


PR created automatically by Jules for task 14235387394271860600 started by @undivisible


Note

Low Risk
Boot-time hardening on a fixed module list; no change to mount logic or dynamic module loading.

Overview
Hardens early boot in init.rs by validating each kernel module name before invoking /sbin/modprobe. Names that are empty, start with -, or contain characters outside ASCII alphanumerics, underscores, and hyphens are rejected with an error log and skipped instead of being passed through.

Several run("/bin/mount", …) calls were reformatted to multi-line argument lists only; mount behavior is unchanged.

Reviewed by Cursor Bugbot for commit f2fa024. Configure here.

Adds strict validation for module names passed to modprobe to prevent potential argument or command injection. The validation ensures that the module name is not empty, does not start with a hyphen, and only contains ASCII alphanumeric characters, underscores, and hyphens.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@cursor

cursor Bot commented Sep 10, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_feaa76c3-d138-4a1b-ac4e-d604622ae333)

@mergify

mergify Bot commented Sep 10, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant