Skip to content

πŸ›‘οΈ Sentinel: [HIGH] Fix environment hijacking and arbitrary file move/deletion in install.sh - #53

Open
google-labs-jules[bot] wants to merge 1 commit into
mainfrom
jules-9289392815037441823-59933427
Open

πŸ›‘οΈ Sentinel: [HIGH] Fix environment hijacking and arbitrary file move/deletion in install.sh#53
google-labs-jules[bot] wants to merge 1 commit into
mainfrom
jules-9289392815037441823-59933427

Conversation

@google-labs-jules

Copy link
Copy Markdown
Contributor

🚨 Severity: HIGH

πŸ’‘ Vulnerability:

Critical variables used within the installer's exit/cleanup trap (ANTIGRAVITY_BAK, ANTIGRAVITY_VA39_BAK, INSTALL_BIN_DIR, SECURE_TMP_DIR) were not explicitly initialized at script startup. An attacker or user could pre-set these variables in their environment. If the script exited prematurely (e.g., during env/prerequisite checks or SIGINT/cancellation), the cleanup trap was invoked using those parent environment values, causing arbitrary files to be moved or deleted (rm -f or mv -f).

πŸ”§ Fix:

  • Explicitly initialize ANTIGRAVITY_BAK, ANTIGRAVITY_VA39_BAK, INSTALL_BIN_DIR, SECURE_TMP_DIR, and INSTALL_SUCCESS to safe defaults ("" and 0) at script entry.
  • Prevent parent environment hijacking.
  • Added strict non-empty checks for INSTALL_BIN_DIR before attempting restore mv commands in the trap logic.

βœ… Verification:

  • Verified that pre-setting ANTIGRAVITY_BAK=dummy_sensitive_file no longer deletes or moves the file during early script exits.
  • Ran script syntax checks (bash -n install.sh) and existing test suites (python3 test_statusline.py) successfully with zero regressions.

PR created automatically by Jules for task 9289392815037441823 started by @qapdex-maker

…/deletion in install.sh

Initialize critical installer-flow variables (ANTIGRAVITY_BAK, ANTIGRAVITY_VA39_BAK, INSTALL_BIN_DIR, SECURE_TMP_DIR, and INSTALL_SUCCESS) to safe defaults at the script entry of install.sh. This ensures pre-existing environment variables cannot hijack trap cleanup handlers to execute arbitrary file deletions or moves on premature exits or script cancellations. Additionally, ensure INSTALL_BIN_DIR is validated to be non-empty before executing restore commands.
@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.

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.

0 participants