Commit d730803
committed
Fix SCP path traversal issue
This commit fixes an issue where a malicious SCP server could trick an
SCP client into writing files outside of a requested target directory.
Thanks go to Jaden Furtado for reporting this issue and providing
detailed reproduction steps.
Note: While this fix should prevent writing outside a target directory,
the SCP protocol is inherently insecure and may still be able to
overwrite arbitrary files within the target directory, even if they
don't match the requested source files to copy. To avoid this issue, it
is strongly recommended that SFTP be used in place of SCP.1 parent 3d515ba commit d730803
2 files changed
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
139 | 143 | | |
140 | 144 | | |
141 | 145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5737 | 5737 | | |
5738 | 5738 | | |
5739 | 5739 | | |
| 5740 | + | |
| 5741 | + | |
| 5742 | + | |
5740 | 5743 | | |
5741 | 5744 | | |
5742 | 5745 | | |
| |||
5772 | 5775 | | |
5773 | 5776 | | |
5774 | 5777 | | |
| 5778 | + | |
| 5779 | + | |
| 5780 | + | |
| 5781 | + | |
| 5782 | + | |
| 5783 | + | |
| 5784 | + | |
| 5785 | + | |
| 5786 | + | |
| 5787 | + | |
| 5788 | + | |
5775 | 5789 | | |
5776 | 5790 | | |
5777 | 5791 | | |
| |||
0 commit comments