andrewmusselman opened a new issue, #553:
URL: https://github.com/apache/tooling-trusted-releases/issues/553
## Summary
File uploads do not validate file types or content, allowing potentially
dangerous files to be uploaded.
## ASVS Requirements
- 15.3.1 - File storage security
## Related Audit Reports
- [Basic Access #404](ASVS/basic-access-404.md) - Issue 15.3.1-2
## Affected Files
- `atr/shared/upload.py`
- `atr/post/upload.py`
## Recommended Fix
```python
ALLOWED_EXTENSIONS = {
'.tar.gz', '.tgz', '.tar.bz2', '.zip',
'.asc', '.sig', '.sha256', '.sha512',
'.pom', '.jar', '.txt', '.md',
}
BLOCKED_EXTENSIONS = {
'.exe', '.dll', '.bat', '.sh', '.php',
}
def validate_filename(filename: str) -> bool:
lower_name = filename.lower()
for ext in BLOCKED_EXTENSIONS:
if lower_name.endswith(ext):
return False
return True
```
## Acceptance Criteria
- [ ] Blocked extension list implemented
- [ ] Consider magic byte validation for archives
- [ ] Zip bomb protection (already exists in archives.py)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]