Skip to content

🛡️ Sentinel: [HIGH] Harden publish flow against data leakage and injection#118

Open
calionauta wants to merge 1 commit into
mainfrom
sentinel-security-hardening-publish-9379680464252856925
Open

🛡️ Sentinel: [HIGH] Harden publish flow against data leakage and injection#118
calionauta wants to merge 1 commit into
mainfrom
sentinel-security-hardening-publish-9379680464252856925

Conversation

@calionauta

Copy link
Copy Markdown
Owner

🛡️ Sentinel: [HIGH] Harden publish flow against data leakage and injection

Identified and fixed three security vulnerabilities in the publishing workflow:

  • Regex Newline Injection: Validation in local_source.py and external_source.py was vulnerable to trailing newlines bypass.
  • Symlink Content Leakage: The publish flow followed symlinks, potentially leaking sensitive host files into public repositories.
  • Brittle Exclusion Logic: The ignore mechanism in git_publish.py failed to match many patterns in the default exclusion list.

All issues have been remediated, verified with targeted scripts, and confirmed not to cause regressions via the full test suite.


PR created automatically by Jules for task 9379680464252856925 started by @calionauta

…ction

This commit addresses several security vulnerabilities in the `publish` module:
1. **Regex Newline Injection**: Replaced `$` with `\Z` in `_is_valid_skill_name` regex to prevent bypasses using trailing newlines.
2. **Symlink Content Leakage**: Configured `shutil.copytree` and `shutil.copy2` to preserve symlinks instead of following them, preventing accidental disclosure of linked sensitive files.
3. **Robust File Exclusions**: Refactored `_ignore_func` to use `fnmatch.filter`, ensuring all `DEFAULT_IGNORE_PATTERNS` (like `sessions/` and `cache/`) are correctly applied.

Verified with specialized security tests and full repository test suite.

Co-authored-by: calionauta <1719651+calionauta@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 gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses several security and robustness issues in the publishing flow. It updates regex patterns in _is_valid_skill_name to use \Z instead of $ to prevent newline injection, refactors file exclusion logic in _ignore_func to use fnmatch.filter for robust pattern matching, and configures shutil.copytree and shutil.copy2 to preserve symlinks and prevent content leakage of linked files. Additionally, the .jules/sentinel.md file is updated to document these vulnerabilities and prevention strategies. There are no review comments, so no feedback is provided.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

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