Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: vuln outside the diff #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ferreiratiago
Copy link

No description provided.

Copy link

snyk-io-dev bot commented Aug 27, 2024

Snyk has found 1 issues.

Icon Severity Issues
Critical 0
High 1
Medium 0
Low 0

security/snyk check is completed. No issues were found. (View Details)

code/snyk check is completed. Snyk found 1 issues. (View Details)

Copy link

@snyk-io-dev snyk-io-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Snyk found 1 issue in the modified code

  •   Arbitrary File Write via Archive Extraction (Zip Slip)
    • Path: routes/fileUpload.js#L51

@@ -47,6 +47,8 @@ function handleZipFileUpload ({ file }, res, next) {
utils.solveIf(challenges.fileWriteChallenge, () => { return absolutePath === path.resolve('ftp/legal.md') })
if (absolutePath.includes(path.resolve('.'))) {
entry.pipe(fs.createWriteStream('uploads/complaints/' + fileName).on('error', function (err) { next(err) }))
} else if (absolutePath.includes(path.resolve('/-'))) {
entry.pipe(fs.createWriteStream('uploads/additional' + fileName).on('error', function (err) { next(err) }))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  Arbitrary File Write via Archive Extraction (Zip Slip)

Unsanitized input from Unzipper library flows into fs.createWriteStream, where it is used as a path after been extracted from a zip file. This may result in a Zip Slip vulnerability and allow an attacker to write to arbitrary files.

CWE-22 | Priority score 802 | Line 51

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant