Skip to content

Fix code scanning alert no. 1: Arbitrary file access during archive extraction ("Zip Slip")#1

Draft
Ericgre wants to merge 1 commit into
mainfrom
alert-autofix-1
Draft

Fix code scanning alert no. 1: Arbitrary file access during archive extraction ("Zip Slip")#1
Ericgre wants to merge 1 commit into
mainfrom
alert-autofix-1

Conversation

@Ericgre
Copy link
Copy Markdown

@Ericgre Ericgre commented Nov 6, 2024

Fixes https://github.com/ericgorg/code-scanning-javascript-demo/security/code-scanning/1

To fix the problem, we need to ensure that the header.linkname does not contain any directory traversal sequences like ... This can be done by validating the path before using it in any file system operations.

The best way to fix this without changing existing functionality is to add a validation step that checks if header.linkname contains any .. sequences. If it does, we should skip processing that entry and log a warning.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…xtraction ("Zip Slip")

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
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