Skip to content

Add rename script#78

Merged
amrabed merged 6 commits intomainfrom
sentinel-fix-makefile-injection-8048658510858943211
May 8, 2026
Merged

Add rename script#78
amrabed merged 6 commits intomainfrom
sentinel-fix-makefile-injection-8048658510858943211

Conversation

@google-labs-jules
Copy link
Copy Markdown
Contributor

🚨 Severity: CRITICAL
💡 Vulnerability: Command injection in Makefile project initialization.
🎯 Impact: An attacker could execute arbitrary commands by tricking a user into running make project with a malicious NAME value.
🔧 Fix: Delegated initialization logic to a secure Python script with proper escaping and input validation.
✅ Verification: Confirmed fix with a reproduction script attempting multiple injection patterns and verified preserved functionality with safe inputs.


PR created automatically by Jules for task 8048658510858943211 started by @amrabed

- Identified a critical command injection vulnerability in the Makefile's `project` target.
- Replaced vulnerable shell-based logic with a secure Python script `project_init.py`.
- Added input validation to prevent directory traversal and injection via the `NAME` variable.
- Improved cross-platform compatibility by removing BSD-specific `sed -i ''` syntax.
- Added Sentinel security journal entry in `.jules/sentinel.md`.
@google-labs-jules
Copy link
Copy Markdown
Contributor Author

👋 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.

Comment thread .jules/sentinel.md Outdated
Comment thread Makefile Outdated
- Moved project initialization logic to `scripts/rename.py` with input validation.
- Updated Makefile to use `uv run scripts/rename.py`.
- Prevented command injection via shell-escaped parameters.
- Added .[jJ]ules to .gitignore and removed sentinel journal.
Comment thread scripts/rename.py Outdated
Comment thread Makefile Outdated
@amrabed amrabed marked this pull request as ready for review May 8, 2026 10:03
- Updated `scripts/rename.py` to use the `click` library for robust argument parsing.
- Refactored Makefile to pass project initialization parameters as named options.
- Maintained security fixes and input validation.
Comment thread Makefile Outdated
Comment thread .gitignore
- Registered `rename` script in `pyproject.toml`.
- Updated Makefile to use `uv run rename` with named arguments.
- Added documentation comment for AI agent logs in `.gitignore`.
Comment thread Makefile
Comment thread Makefile Outdated
- Added `uv` as a prerequisite for the `project` target.
- Updated the `uv` target to only install via `pipx` if not already present.
- Improved Makefile robustness.
Comment thread scripts/rename.py Outdated
- Changed click imports to `from click import ...` style.
- Ensured code remains compliant with line length and linting rules.
@amrabed amrabed changed the title 🛡️ Sentinel: Fix command injection in Makefile project initialization Add rename script May 8, 2026
@amrabed amrabed merged commit b791137 into main May 8, 2026
3 checks passed
@amrabed amrabed deleted the sentinel-fix-makefile-injection-8048658510858943211 branch May 8, 2026 10:32
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