Skip to content

Reject plugin path arguments for installed operations#386

Open
GreyforgeLabs wants to merge 1 commit into
CortexLM:mainfrom
GreyforgeLabs:reject-absolute-plugin-remove
Open

Reject plugin path arguments for installed operations#386
GreyforgeLabs wants to merge 1 commit into
CortexLM:mainfrom
GreyforgeLabs:reject-absolute-plugin-remove

Conversation

@GreyforgeLabs
Copy link
Copy Markdown

Summary

  • Validate installed plugin names as a single path component before remove/enable/disable/show build paths under the plugins directory.
  • Reject absolute paths, nested paths, traversal components, and Windows-style separators instead of passing them through PathBuf::join.
  • Add a binary integration regression proving cortex plugin remove -y <absolute-path> leaves the outside directory intact.

Fixes PlatformNetwork/bounty-challenge#49473.

Validation

  • cargo test -p cortex-cli --test plugin_remove_path --no-default-features --features cortex-tui -- --nocapture
  • cargo check -p cortex-cli --no-default-features --features cortex-tui
  • cargo fmt --package cortex-cli --check
  • git diff --check

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

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.

[BUG] [v0.0.7] cortex plugin remove <absolute-path> deletes directories outside ~/.cortex/plugins

1 participant