mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-17 16:38:18 +00:00
fix: server: route: path traversal
This commit is contained in:
parent
37ab7068d9
commit
6fb2102099
2 changed files with 11 additions and 0 deletions
|
|
@ -18,3 +18,10 @@ test('cloudcmd: rest: fs: path', async (t) => {
|
|||
t.equal(path, '/', 'should dir path be "/"');
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('cloudcmd: path traversal beyond root', async (t) => {
|
||||
const {body} = await request.get('/fs..%2f..%2fetc/passwd');
|
||||
|
||||
t.match(body, 'beyond root', 'should return beyond root message');
|
||||
t.end();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue