Skip to content

Conversation

@xusheng6
Copy link
Contributor

Summary

  • Add validation to reject crackme and solution submissions that contain password-protected ZIP archives
  • Users should NOT add passwords to their archives - the server handles compression and password protection automatically during the approval process
  • Clear error message informs users that they should not add passwords themselves

Changes

  • Created new app/services/archive.py with is_archive_password_protected() function to detect encrypted ZIP files
  • Added validation in crackme upload controller (app/controllers/crackme.py)
  • Added validation in solution upload controller (app/controllers/solution.py)

Test plan

  • Upload a non-password-protected ZIP file (should succeed)
  • Upload a password-protected ZIP file (should fail with clear error message)
  • Upload a non-archive file (should pass through to existing validation)

Fixes #1

🤖 Generated with Claude Code

xusheng6 and others added 2 commits December 31, 2025 11:12
Add validation to reject crackme and solution submissions that contain
password-protected ZIP archives. Users should not add passwords to their
archives as the server handles compression and password protection
automatically during the approval process.

- Add new archive service with is_archive_password_protected() function
- Add validation in crackme upload controller
- Add validation in solution upload controller

Fixes #1

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Read file data into buffer once and reuse it for size check, password
protection check, and writing to disk. This avoids reading the file twice.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@xusheng6 xusheng6 merged commit f607167 into main Dec 31, 2025
@xusheng6 xusheng6 deleted the reject-password-protected-archives branch December 31, 2025 03:20
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.

Automatically reject crackme and solution submissions that already have a password

2 participants