Skip to content

πŸ›‘οΈ Sentinel: [HIGH] Prevent content leakage by preserving symlinks during publish#103

Open
calionauta wants to merge 1 commit into
mainfrom
sentinel-fix-symlink-leakage-732197238680532708
Open

πŸ›‘οΈ Sentinel: [HIGH] Prevent content leakage by preserving symlinks during publish#103
calionauta wants to merge 1 commit into
mainfrom
sentinel-fix-symlink-leakage-732197238680532708

Conversation

@calionauta

Copy link
Copy Markdown
Owner

πŸ›‘οΈ Sentinel: [HIGH] Prevent content leakage by preserving symlinks during publish

🚨 Severity: HIGH

πŸ’‘ Vulnerability:

The publish flow utilized shutil.copytree and shutil.copy2 with default settings, which follow symbolic links. If a user-controlled skill or agent directory contained a symlink pointing to a sensitive file (e.g., ~/.ssh/id_rsa, .env, or /etc/passwd), the content of that file would be copied into the temporary publishing directory and subsequently committed to the public/shared repository.

🎯 Impact:

Unintentional disclosure of sensitive system files, private keys, or credentials when sharing skills or agents with the community.

πŸ”§ Fix:

Hardened all file copy operations in the publishing modules (src/agent_sync/publish/git_publish.py and src/agent_sync/publish/agents_source.py) to preserve symbolic links rather than dereferencing them:

  • Added symlinks=True to shutil.copytree.
  • Added follow_symlinks=False to shutil.copy2.

βœ… Verification:

  • Created tests/test_sentinel_leakage.py which mocks the publishing environment and explicitly verifies that symlinks to external "secret" files are preserved as links in the destination, rather than being converted to regular files containing the secret data.
  • Ran the full test suite (565 tests total), all passed.

PR created automatically by Jules for task 732197238680532708 started by @renatocaliari

…ring publish

Severity: HIGH
Vulnerability: Symlink following during file copy.
Impact: Sensitive files outside the source directory could be leaked to public repositories.
Fix: Harden shutil operations to preserve symlinks (symlinks=True, follow_symlinks=False).
Verification: Added regression tests in tests/test_sentinel_leakage.py.

Co-authored-by: renatocaliari <1719651+renatocaliari@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.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

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