🛡️ Sentinel: [CRITICAL] Fix path traversal in plugin directory resolution#8
Conversation
…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>
|
👋 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. |
This PR introduces input validation for
plugin_nameto prevent directory traversal vulnerabilities inhelpers/plugins.py.Security Details
plugin_nameparameter from the API was appended directly to base directories without checking for directory traversal sequences (such as../).execute.pyscript or reading unintended configuration files.plugin_namethat contains/,\, or..insideget_plugin_rootsandfind_plugin_dir.PR created automatically by Jules for task 6224273217668732404 started by @thirdeyenation