aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/templates
diff options
context:
space:
mode:
authorDennis Fink2026-10-30 08:11:05 +0100
committerDennis Fink2026-10-30 08:11:05 +0100
commit9f093cf07a3531ee4b7d02c20151e21c141a93de (patch)
treedc39b1586dd6599bd09e95f3dd463a0f64c2de3f /webmentions_ssg/templates
parentedd7c0c2220ba12c2a773f9ba1cf6e0e7a273856 (diff)
downloadwebmentions-ssg-9f093cf07a3531ee4b7d02c20151e21c141a93de.tar.gz
webmentions-ssg-9f093cf07a3531ee4b7d02c20151e21c141a93de.zip
fix(core): harden authentication flows
Reduce login abuse and username enumeration by rate limiting POST attempts and always performing password verification, even for unknown users. Require authenticated, CSRF-protected POST requests for logout so sessions cannot be terminated through cross-site or accidental GET requests.
Diffstat (limited to '')
-rw-r--r--webmentions_ssg/templates/base.html5
1 files changed, 4 insertions, 1 deletions
diff --git a/webmentions_ssg/templates/base.html b/webmentions_ssg/templates/base.html
index fabfaaf..5cd521b 100644
--- a/webmentions_ssg/templates/base.html
+++ b/webmentions_ssg/templates/base.html
@@ -44,7 +44,10 @@ SPDX-License-Identifier: BSD-3-Clause
href='{{ url_for("root.received") }}'>Received</a>
<a class="nav-link{% if request.endpoint == 'root.sent' %} active{% endif %}"
href='{{ url_for("root.sent") }}'>Sent</a>
- <a class="nav-link" href="{{ url_for("root.logout") }}">Logout</a>
+ <form action="{{ url_for("root.logout") }}" method="post" class="m-0">
+ <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
+ <button type="submit" class="nav-link border-0 bg-transparent">Logout</button>
+ </form>
</div>
{% endif %}
</div>