Commit Graph
3 Commits
Author SHA1 Message Date
claude 990b3792bc security(shared-httpd): also remove status, info and every unused proxy/suexec/dbd/cache module
A tenant `RewriteRule ^ - [H=server-status|server-info]` binds the handler
after any config section could pin it, and `RewriteRule ... http://x [P]`
proxies to internal addresses (SSRF). Config cannot close those; removing
the modules does. WHP renders only SetHandler proxy:fcgi, <Proxy balancer://>
+ BalancerMember fcgi:// + ProxySet lbmethod=byrequests and
ProxyFCGISetEnvIf, so only proxy, proxy_fcgi, proxy_balancer,
lbmethod_byrequests and slotmem_shm stay.

Removed in addition to the earlier set: status, info, proxy_http, proxy_ajp,
proxy_ftp, proxy_connect, proxy_scgi, proxy_uwsgi, proxy_wstunnel,
proxy_fdpass, proxy_express, proxy_hcheck, lbmethod_bybusyness,
lbmethod_bytraffic, lbmethod_heartbeat (+ mod_heartbeat/heartmonitor .so),
suexec, dbd, authn_dbd, authz_dbd, cache, cache_disk, cache_socache,
socache_dbm, socache_memcache, socache_redis. socache_shmcb stays (SSL).

The gate derives its banned-module regex from one list. Tests: 26 gate
cases (banned status/info/proxy_*/cache back, leftover .so, required
lbmethod_byrequests/balancer missing) and a new live probe script
(scripts/tests/httpd-exec-surface-probes.test.sh) that renders the real WHP
template + drop-in and tries [H=lua-script|server-status|server-info],
nested <If> CGI and [P] http/ws/ajp/ftp/scgi/uwsgi.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
2026-11-22 22:46:19 -08:00
shadowdaoandClaude Opus 5.5 2a6e2d554e httpd-exec-surface-gate: positive control covers the multi-FPM balancer path and brotli
A WHP site with more than one FPM backend is rendered as <Proxy balancer://>
+ BalancerMember + `ProxySet lbmethod=byrequests` (panel/internal/vhost/
httpdtpl/render.go buildProxyBlock), which needs proxy_balancer,
lbmethod_byrequests and slotmem_shm. None of the three was in the required
list, so a future image change dropping them would pass this gate and take
every multi-backend site down. brotli_module was named in the comment but not
in the list. The comment's "status for /ping-style probes" was wrong (/ping is
a mod_rewrite R=204 in the default vhost) and is gone. Also documents that a
later `dnf update` of httpd-core restores the deleted .so / %config files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
2026-11-22 22:09:09 -08:00
shadowdaoandClaude Sonnet 5.5 8fbbd6d160 security(shared-httpd): remove cgid/lua/include/actions/dav/userdir + exec-surface build gate
One Apache serves every tenant in shared-httpd and everything it executes runs as
the shared `apache` user. mod_lua cannot be closed from the WHP vhost side
(RewriteRule [H=lua-script] binds the handler after any config pin), so the
modules are removed from the image: scripts/httpd-exec-surface-gate.sh
remove|check, run as the last package step of Dockerfile.shared-httpd. check
fails the build if a banned module is loadable/loaded, the global INCLUDES filter
or a cgi-bin ScriptAlias is configured, httpd -t fails, or a module the platform
needs (rewrite, proxy_fcgi, ssl, headers, ...) is not loaded. Test + CI wiring.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
2026-11-22 21:48:51 -08:00