andrewmusselman opened a new issue, #780:
URL: https://github.com/apache/tooling-trusted-releases/issues/780
**Source:** ASVS 2.2.2 Finding 12
**CWE:** CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)
**Location:** `atr/storage/writers/release.py`, lines 295–310
#### Description
The `upload_files` method has different code paths for filename validation.
When the `file_name` parameter is provided, it bypasses `form.to_relpath()`
validation:
```python
if not file_name:
validated_path = form.to_relpath(file.filename) # Validated
else:
relative_file_path = file_name # NOT validated
```
#### Recommendation
- Always validate the path through `form.to_relpath()` regardless of source.
- We should add a SafeFilename string type
--
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]