Skip to content

fix(config): mirror the nginx deny rules in the Apache template, Secure cookie by scheme - #2458

Open
elcreator wants to merge 1 commit into
evolution-cms:3.5.xfrom
elcreator:fix-apache-config-hardening
Open

fix(config): mirror the nginx deny rules in the Apache template, Secure cookie by scheme#2458
elcreator wants to merge 1 commit into
evolution-cms:3.5.xfrom
elcreator:fix-apache-config-hardening

Conversation

@elcreator

Copy link
Copy Markdown

ht.access refused nothing that ng.inx refuses: /core, /views, /vendor, /tmp, the writable assets areas, composer.json/.lock, dumps and backups, and PHP under assets/ were all left to per-directory .htaccess files. Those only apply with AllowOverride, and they were written in the Apache 2.2 dialect, which a 2.4 server without mod_access_compat answers with a 500. The rewrite rules now live in ht.access ahead of the assets/manager passthrough, and every shipped .htaccess carries both dialects behind mod_authz_core guards.

manager/.htaccess switched mod_security off with a 1.x directive; dropped. install/.htaccess stripped the Content-Security-Policy header the installer itself sets with a nonce; dropped.

The session cookie's Secure flag came from SESSION_SECURE_COOKIE alone, and the session proxy, which is the default, reads the config value rather than detecting HTTPS, so an HTTPS site never got the flag without setting the variable. Unset, the option now follows the request scheme; the variable still overrides it for a TLS-terminating proxy.

…re cookie by scheme

ht.access refused nothing that ng.inx refuses: /core, /views, /vendor, /tmp,
the writable assets areas, composer.json/.lock, dumps and backups, and PHP
under assets/ were all left to per-directory .htaccess files. Those only
apply with AllowOverride, and they were written in the Apache 2.2 dialect,
which a 2.4 server without mod_access_compat answers with a 500. The rewrite
rules now live in ht.access ahead of the assets/manager passthrough, and
every shipped .htaccess carries both dialects behind mod_authz_core guards.

manager/.htaccess switched mod_security off with a 1.x directive; dropped.
install/.htaccess stripped the Content-Security-Policy header the installer
itself sets with a nonce; dropped.

The session cookie's Secure flag came from SESSION_SECURE_COOKIE alone, and
the session proxy, which is the default, reads the config value rather than
detecting HTTPS, so an HTTPS site never got the flag without setting the
variable. Unset, the option now follows the request scheme; the variable
still overrides it for a TLS-terminating proxy.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0136CYHW4NXMDFA8gfuNCx7R
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant