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

Expanding archive files without controlling resource consumption is security-sensitive #546

Open
kevinhagel opened this issue Mar 18, 2024 · 0 comments
Assignees
Labels
Type: Bug The issue documents broken, incorrect, or confusing behavior.

Comments

@kevinhagel
Copy link
Member

Describe the bug
See issue https://github.com/webforj/webforj/security/advisories/GHSA-qxgc-w4c2-c7mh
See sonar description: Expanding archive files without controlling resource consumption is security-sensitive java:S5042

As described in the security advisory issue, unchecked use of zip.getEntries() and unchecked opening of the expanded entry are a minor security issue, possible DOS issue, described as a zip bomb attack from a user uploading the 'right kind' of jar file.

Successful Zip Bomb attacks occur when an application expands untrusted archive files without controlling the size of the expanded data, which can lead to denial of service. A Zip bomb is usually a malicious archive file of a few kilobytes of compressed data but turned into gigabytes of uncompressed data. To achieve this extreme compression ratio, attackers will compress irrelevant data (eg: a long string of repeated bytes).

Expected behavior
The sonar issue describes a compliant solution for measuring the size of each file in the archive, the ratio of compression, and the number of file entries in the archive.

  • Implement this solution. Create a processor that loads and validates zip entries, shared by the zip file entries in the application.
  • Refactor WebforjInstaller and MavenBinaryInstaller to use the new validating zip file processor.

Software Versions (please complete the following information)

  • Java Version: 17+
  • Webforj version: [e.g 24.00]

Additional context
Add any other context about the problem here.

@kevinhagel kevinhagel added the Type: Bug The issue documents broken, incorrect, or confusing behavior. label Mar 18, 2024
@kevinhagel kevinhagel self-assigned this Mar 18, 2024
@kevinhagel kevinhagel added this to the 24.00 milestone Mar 18, 2024
@hyyan hyyan modified the milestones: 24.00, 24.01 Apr 8, 2024
@hyyan hyyan removed this from the 24.01 milestone Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug The issue documents broken, incorrect, or confusing behavior.
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants