Skip to content

fix: ignore invalid unix permissions and setuid bits from zip#1007

Open
tommady wants to merge 1 commit into
ouch-org:mainfrom
tommady:close-issue-1006
Open

fix: ignore invalid unix permissions and setuid bits from zip#1007
tommady wants to merge 1 commit into
ouch-org:mainfrom
tommady:close-issue-1006

Conversation

@tommady

@tommady tommady commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1006

Some zip files created on MS-DOS environments store invalid attributes that zip reads as unix modes missing the file type bits, resulting in unintended setuid permissions.

In the reported issue, stat revealed the file access mode was 0o4032.
In a valid Unix permission mode, the file type bits (S_IFMT, e.g., 0o100000 for a regular file) must be set.

A mode of 0o4032 entirely lacks these file type bits, meaning it is garbage data (likely MS-DOS attributes or arbitrary metadata from the archive generator) being mistakenly interpreted as a Unix mode.

Signed-off-by: tommady <tommady@users.noreply.github.com>
@tommady

tommady commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator Author

hi @marcospb19 please review while you have time.
thanks!

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.

Bandcamp archives are unpacked with setuid

1 participant