Skip to content

Fix archive extraction bugs #647

Merged
sobregosodd merged 5 commits into
mainfrom
s.obregoso/fix_archive
Jan 9, 2026
Merged

Fix archive extraction bugs #647
sobregosodd merged 5 commits into
mainfrom
s.obregoso/fix_archive

Conversation

@sobregosodd
Copy link
Copy Markdown
Contributor

This PR address several problems while dealing with packages.
It includes several validations for:

  • File type: devices
  • Path trasversal
  • Archive deflated size
  • Archive deflated amount of files

Side tasks:
Improves the documentation by adding a section on how environment variables can be used to alter the tool's behaviour

Comment thread guarddog/utils/config.py Outdated
Comment thread guarddog/utils/archives.py
Comment on lines +135 to +136
attr = zip_info.external_attr >> 16
file_type = attr & 0o170000
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Might be worth factoring this out into a small utility function, since I think you compute this in two places.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Do you think it worth it? sounds having a function to add a number

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah, probably not worth it

Comment thread guarddog/utils/archives.py
Comment thread guarddog/utils/archives.py
@sobregosodd sobregosodd merged commit c3d3994 into main Jan 9, 2026
10 checks passed
@sobregosodd sobregosodd deleted the s.obregoso/fix_archive branch January 9, 2026 15:45
christophetd pushed a commit that referenced this pull request Apr 10, 2026
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.

3 participants