Commit bbce656
Fix command injection in change_permissions_to_root
Replace ssh_client.exec_command(f'chmod 600 {filepath}') with
sftp_client.chmod(filepath, 0o600). The shell-interpolated filepath
allowed injection of arbitrary commands via crafted filenames.
Closes #85
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 0ab8ce7 commit bbce656
2 files changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
19 | 23 | | |
20 | 24 | | |
21 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
| 163 | + | |
0 commit comments