#13238·authelia

WAF-safe alphabet for session cookie values

Author: Mister-OddCreated Sep 22, 2026Updated Sep 27, 2026
Labelspriority/4/normaltype/featurestatus/needs-design

Description

Use base64url or hex, or add a lever to set the id alphabet.

Use Case

OPNsense's NGINX Reverse Proxy uses Naxsi's WAF and rules will block any session cookie with certain characters. That forces people to white list a rule that is there to protect vhosts behind it, that also want Authelia in front. A lever to set cookie id alphabet or a complete change to a base64url or hex id would solve that.

Details

When we read from its own Redis store: 279 of 889 live sessions (31%) contain a #. Authelia's session cookie value is a 32-character id drawn from a 70-character alphabet: a-z, A-Z, 0-9 and eight symbols — ! # $ % * - ^ _. RFC 6265 permits these characters in a cookie-octet, so it is "legal" - but an alphabet including # $ % * ^ in a value that every WAF (web application firewall) inspects, generates false positives for anyone running one. The cookie is scoped <domain.com>, so the browser sends it to every vhost. Naxsi's rule 1016 is str:# (mysql comment, $SQL:4) against $HEADERS_VAR:Cookie, so roughly a third of sessions score on every site they touch — 730 hits across 14 vhosts in 9 days here. The levers it knows = session.cookie, session.cookies, session.same_site, session.remember_me_duration — no key for the id alphabet (or length).

Documentation

No response

Generative AI

No

Pre-Submission Checklist

  • I agree to follow the Code of Conduct

  • I have checked for related issues and checked the documentation