Skip to content

🛡️ Sentinel: [CRITICAL] Fix path traversal in plugin directory resolution#8

Open
thirdeyenation wants to merge 1 commit intomainfrom
sentinel/fix-plugin-path-traversal-6224273217668732404
Open

🛡️ Sentinel: [CRITICAL] Fix path traversal in plugin directory resolution#8
thirdeyenation wants to merge 1 commit intomainfrom
sentinel/fix-plugin-path-traversal-6224273217668732404

Conversation

@thirdeyenation
Copy link
Copy Markdown
Owner

This PR introduces input validation for plugin_name to prevent directory traversal vulnerabilities in helpers/plugins.py.

Security Details

  • Severity: CRITICAL
  • Vulnerability: Path traversal was possible because the plugin_name parameter from the API was appended directly to base directories without checking for directory traversal sequences (such as ../).
  • Impact: This could be exploited to load arbitrary directories, leading to the execution of an arbitrary execute.py script or reading unintended configuration files.
  • Fix: Rejects any plugin_name that contains /, \, or .. inside get_plugin_roots and find_plugin_dir.
  • Verification: Verified the codebase for other similar file loading mechanisms and ran test structures where applicable.

PR created automatically by Jules for task 6224273217668732404 started by @thirdeyenation

…tion

🚨 Severity: CRITICAL
💡 Vulnerability: The `plugin_name` parameter passed via API requests was not validated before being used to resolve the path of a plugin directory. This allowed directory traversal using sequences like `../` to access and potentially execute arbitrary files outside of the designated plugin directories (e.g. via `execute.py`).
🎯 Impact: An attacker could execute arbitrary Python code or read arbitrary plugin configuration files from outside the plugin directories.
🔧 Fix: Added input validation in `helpers/plugins.py` (`get_plugin_roots` and `find_plugin_dir`) to reject any `plugin_name` containing `/`, `\`, or `..`.
✅ Verification: Review the added checks in `helpers/plugins.py`. The relevant unit tests were manually verified.

Co-authored-by: thirdeyenation <133812267+thirdeyenation@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown

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

1 participant