andrewmusselman opened a new issue, #783: URL: https://github.com/apache/tooling-trusted-releases/issues/783
**ASVS:** 3.5.1, 3.5.3 · **CWE:** CWE-352 · **Files:** `src/asfquart/generics.py` (lines 51–58), `atr/templates/includes/topnav.html` (line 142) ### Description Logout is performed by navigating to `GET /auth?logout`. Session destruction is a state-changing operation and should not be on a safe HTTP method. An attacker can force logout via `<img src="https://target/auth?logout">` on any page, disrupting user workflows. ### Vulnerable code ```python # src/asfquart/generics.py elif logout_uri or quart.request.query_string == b"logout": asfquart.session.clear() # state change via GET ``` ```html <!-- topnav.html --> <a href="/auth?logout=/" class="logout-link btn btn-sm btn-secondary ms-2">Log out</a> ``` ### Recommended fix Require POST for logout and protect with CSRF: ```html <form method="post" action="/auth/logout" class="d-inline"> {{ csrf_input|safe }} <button type="submit" class="logout-link btn btn-sm btn-secondary ms-2">Log out</button> </form> ``` -- 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]
