The opt-in security switches, from the same list as the
Install page (yf_docs::$HARDEN). Each one is off by default so that
existing sites keep their behaviour; a default changes only in a major release.
Default is the class property, this site is what the docs site's own $PROJECT_CONF sets.
Details: the upgrade notes and the API reference of each class.
| Switch and how to turn it on | Property | Default | This site |
|---|---|---|---|
CSRF tokens in the admin (the user side has them already) | csrf_guard.ENABLED_FOR | {"admin":false,"user":true} | default |
Session cookie: SameSite, HTTPS only | session.COOKIE_SAMESITEsession.COOKIE_SECURE | 'None'false | default default |
Session strict mode: unknown session ids are replaced | session.USE_STRICT_MODE | false | default |
Passwords: bcrypt (or argon2id), old hashes re-hashed on login. Widen user.password to VARCHAR(255) first | password.ALGOpassword.HASH_ON_WRITEpassword.REHASH_ON_LOGIN | 'sha256'falsefalse | default default default |
Encryption: sodium with a per-install key | encryption.DRIVER | 'cast' | default |
Remember-me tokens instead of a password-derived cookie | auth_user.REMEMBER_ME_TOKENS | false | default |
Error pages: 500 / 404 / 403 with the status code | core_errors.ERROR_PAGES | false | default |
Secrets in error logs: passwords, tokens, card fields and session ids masked in the logged request | core_errors.LOG_REDACT | false | default |
Query builder escapes values. On an existing site run make audit-double-escape SITE=... first | db.ESCAPE_BUILDER_VALUES | false | default |
Template auto-escaping ({var|raw} for HTML values) | tpl.AUTO_ESCAPEtpl.EXPOSE_SUPERGLOBALS | falsetrue | default default |
Behind a proxy: trust X-Forwarded-For only from it | client_utils.TRUSTED_PROXIES | [] | default |
Redirects only to your own hosts | redirect.RESTRICT_HOSTS | false | default |