π‘οΈ Sentinel: [HIGH] Prevent content leakage by preserving symlinks during publish#103
π‘οΈ Sentinel: [HIGH] Prevent content leakage by preserving symlinks during publish#103calionauta wants to merge 1 commit into
Conversation
β¦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>
|
π 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
π‘οΈ Sentinel: [HIGH] Prevent content leakage by preserving symlinks during publish
π¨ Severity: HIGH
π‘ Vulnerability:
The
publishflow utilizedshutil.copytreeandshutil.copy2with 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.pyandsrc/agent_sync/publish/agents_source.py) to preserve symbolic links rather than dereferencing them:symlinks=Truetoshutil.copytree.follow_symlinks=Falsetoshutil.copy2.β Verification:
tests/test_sentinel_leakage.pywhich 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.PR created automatically by Jules for task 732197238680532708 started by @renatocaliari