Skip to content

Commit

Permalink
Add API test for upload of password-protected ZIP file
Browse files Browse the repository at this point in the history
(to reproduce juice-shop#750)
  • Loading branch information
bkimminich committed Nov 22, 2018
1 parent c1e69c8 commit 8a2606b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/api/fileUploadSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,16 @@ describe('/file-upload', () => {
.expect('status', 500)
})

xit('POST zip file with directory traversal payload', () => {
it('POST zip file with password protection', () => {
const file = path.resolve(__dirname, '../files/passwordProtected.zip')
const form = frisby.formData()
form.append('file', fs.createReadStream(file))

return frisby.post(URL + '/file-upload', { headers: { 'Content-Type': form.getHeaders()['content-type'] }, body: form })
.expect('status', 204)
})

it('POST zip file with directory traversal payload', () => {
const file = path.resolve(__dirname, '../files/arbitraryFileWrite.zip')
const form = frisby.formData()
form.append('file', fs.createReadStream(file))
Expand Down
Binary file added test/files/passwordProtected.zip
Binary file not shown.

0 comments on commit 8a2606b

Please sign in to comment.