Potential Security Vulnerability in Challenge ZIP Extraction
- Dominant language
- Python
- Stars
- 2k
- Forks
- 984
- Avg merge
- 2h 54m
- Merged PRs (30d)
- 14
Description
While exploring the codebase, I noticed that **create_challenge_using_zip_file** in
**apps/challenges/views.py**
uses standard zipfile.extractall() on user-uploaded ZIPs. This makes the system vulnerable to Zip Slip (path traversal) and Zip Bomb (disk exhaustion) attacks.
Suggested change:-
Implemented a centralized **extract_zip_safely** utility in **apps/base/utils.py** that validates both file paths and decompressed size before extraction. Refactoring the API to use this utility will significantly harden the challenge creation flow. I have a PR ready that implements this utility and integrates it into the primary challenge upload entry point.
Contributor guide
Research direction
Start in apps/challenges/views.py at create_challenge_using_zip_file, then read the proposed centralized utility in apps/base/utils.py. Verify that the challenge upload entry point uses extract_zip_safely and that path traversal and decompressed-size limits are enforced before extraction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- backend, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100