diff options
| author | Thierry Santos <thierrysantoos123@gmail.com> | 2026-01-14 09:54:52 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-14 13:54:52 +0100 |
| commit | 544bc7a45111555593ac44cf522a39ab6593ac9f (patch) | |
| tree | f263841d13f14b71664a54ae9c5b01b544a2014e /zellij-utils/src/plugin_api/plugin_command.rs | |
| parent | Deps upgrade (#4603) (diff) | |
| download | sl0ppij-544bc7a45111555593ac44cf522a39ab6593ac9f.tar.gz sl0ppij-544bc7a45111555593ac44cf522a39ab6593ac9f.tar.xz sl0ppij-544bc7a45111555593ac44cf522a39ab6593ac9f.zip | |
fix(security): validate session name in delete-session to prevent directory deletion (#4583)
* fix(security): validate session name in delete-session to prevent directory deletion
When delete-session receives a path instead of a session name (e.g., due to
shell alias misconfiguration), PathBuf::join() replaces the cache directory
base path entirely, causing remove_dir_all() to delete the user's directory.
Add validate_session_name() to reject names containing '/' or invalid values.
* refactor: use Result instead of Option for validate_session_name
Change validate_session_name to return Result<(), &'static str> instead
of Option<&'static str> for clearer error semantics.
* refactor: use String for validate_session_name errors
Return Result<(), String> and include the session name in error messages
for better debugging context.
* chore: lint changed files
Diffstat (limited to 'zellij-utils/src/plugin_api/plugin_command.rs')
0 files changed, 0 insertions, 0 deletions
