Two hardening fixes from a fresh security pass:
- SESSION_COOKIE_SECURE=True (was only HTTPONLY+SAMESITE)
- _nginx_ban validates IP via ipaddress.ip_address before writing the nginx deny rule (config-injection guard at the sink)
Verified: py_compile clean; guard rejects injection payloads.
Two hardening fixes from a fresh security pass of the live code:
- SESSION_COOKIE_SECURE=True: the session cookie set only HTTPONLY +
SAMESITE=Lax, so it could be sent over plaintext HTTP. App is served
behind nginx TLS, so no functional downside.
- _nginx_ban: validate the IP with ipaddress.ip_address() before
interpolating it into the nginx deny file. A malformed value could
otherwise inject nginx directives at the last write before reload.
Guard sits at the sink, covering all current and future callers.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Two hardening fixes from a fresh security pass:
Verified: py_compile clean; guard rejects injection payloads.
ℹ️ Gitea merged this (commit
86b3093) but its PR-status queue is stalled so the badge still shows 'open' — it IS merged into main.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.