andrewmusselman opened a new issue, #789: URL: https://github.com/apache/tooling-trusted-releases/issues/789
**ASVS:** 3.5.1, 3.5.3 · **CWE:** CWE-352 · **Files:** Multiple in `atr/post/*.py` ### Description Several POST endpoints use the `@post.empty()` decorator, meaning they expect no form body. While the global `quart_wtf.CSRFProtect(app)` middleware should cover all POST requests, this should be explicitly verified for empty-body requests. If the middleware relies on reading a CSRF token from the request body, these endpoints may be unprotected. **Affected endpoints:** - `POST /draft/fresh/<project>/<version>` - `POST /draft/hashgen/<project>/<version>/<path>` - `POST /draft/recheck/<project>/<version>` - `POST /draft/sbomgen/<project>/<version>/<path>` - `POST /keys/import/<project>/<version>` - `POST /manual/start/<project>/<version>/<revision>` - `POST /tokens/jwt` ### Recommended action 1. Verify that `CSRFProtect` validates the `X-CSRFToken` header (set by JavaScript) for these endpoints. 2. If not covered, add explicit Sec-Fetch-Site validation or require a custom header. 3. Consider using `@post.form(EmptyCSRFForm)` instead of `@post.empty()` for documentation clarity. 4. See sub-issues for specifics -- 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]
