You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cortex plugin remove <absolute-path> can delete arbitrary directories outside ~/.cortex/plugins.
With a fresh HOME and no installed plugins, passing an absolute path to plugin remove -y removes that source directory directly instead of rejecting it as not installed.
Create a temporary directory outside ~/.cortex/plugins with a marker file.
Use a fresh temporary HOME so there are no installed plugins.
Run cortex plugin remove -y <absolute-path-to-that-directory>.
Check whether the original directory still exists.
Expected Behavior
plugin remove should only remove plugins installed under ~/.cortex/plugins and should reject arbitrary absolute paths.
Actual Behavior
The command resolves the absolute path directly and deletes that external directory.
Additional Context
Code path: src/cortex-cli/src/plugin_cmd.rs. run_remove() computes plugin_path = plugins_dir.join(&args.name). When args.name is absolute, PathBuf::join() returns the absolute path itself, and std::fs::remove_dir_all(&plugin_path) deletes that outside directory.
Duplicate check on April 7, 2026: searched plugin remove absolute path delete arbitrary directory, plugin remove outside plugins directory absolute path, and related variants in the live tracker. No matching live issue was found.
Project
cortex
Description
cortex plugin remove <absolute-path>can delete arbitrary directories outside~/.cortex/plugins.With a fresh
HOMEand no installed plugins, passing an absolute path toplugin remove -yremoves that source directory directly instead of rejecting it as not installed.Error Message
Debug Logs
System Information
Screenshots
repro.mp4
Steps to Reproduce
~/.cortex/pluginswith a marker file.HOMEso there are no installed plugins.cortex plugin remove -y <absolute-path-to-that-directory>.Expected Behavior
plugin removeshould only remove plugins installed under~/.cortex/pluginsand should reject arbitrary absolute paths.Actual Behavior
The command resolves the absolute path directly and deletes that external directory.
Additional Context
Code path:
src/cortex-cli/src/plugin_cmd.rs.run_remove()computesplugin_path = plugins_dir.join(&args.name). Whenargs.nameis absolute,PathBuf::join()returns the absolute path itself, andstd::fs::remove_dir_all(&plugin_path)deletes that outside directory.Duplicate check on April 7, 2026: searched
plugin remove absolute path delete arbitrary directory,plugin remove outside plugins directory absolute path, and related variants in the live tracker. No matching live issue was found.