-
Notifications
You must be signed in to change notification settings - Fork 1
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: fiches MT en DSFR (ne pas merger) #1490
base: master
Are you sure you want to change the base?
Conversation
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/@lerna/[email protected], npm/@lerna/[email protected] |
f318231
to
a15d56c
Compare
|
||
rs.pipe(unzipper.Parse()) | ||
.on("entry", function (entry) { | ||
const filePath = entry.path.replace( |
Check failure
Code scanning / CodeQL
Arbitrary file access during archive extraction ("Zip Slip") High
file system operation
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 1 month ago
To fix the problem, we need to ensure that the entry.path
does not contain any directory traversal sequences like ..
before using it to construct outputPath
. This can be achieved by validating the filePath
and ensuring it is within the intended directory.
- We will add a check to ensure that
filePath
does not contain..
and is within theoutputDir
. - If the
filePath
is invalid, we will skip processing that entry and log a warning message. - This change will be made in the
downloadZip
function, specifically around the construction and usage ofoutputPath
.
-
Copy modified lines R98-R104 -
Copy modified lines R107-R112
@@ -97,4 +97,17 @@ | ||
|
||
// Validate filePath to prevent directory traversal | ||
if (filePath.includes("..")) { | ||
console.log('skipping bad path', filePath); | ||
entry.autodrain(); | ||
return; | ||
} | ||
|
||
const outputPath = path.join(outputDir, filePath); | ||
|
||
if (!outputPath.startsWith(outputDir)) { | ||
console.log('skipping bad path', filePath); | ||
entry.autodrain(); | ||
return; | ||
} | ||
|
||
if (entry.type === "Directory") { |
a3fa118
to
bf4346a
Compare
bf4346a
to
0924562
Compare
Quality Gate passedIssues Measures |
🎉 Deployment for commit 0924562 : Docker images
|
No description provided.