- PR workflow: no secrets/registry login, checkout without persisted credentials,
docker build --pull --no-cache, per-run tag shared-httpd:pr-probe-<run_id>,
always() cleanup of the image and containers.
- build-push.yaml: every docker/build-push-action step gets pull: true and
no-cache: true (base is already digest-pinned by the resolve step).
- Wiring tests for both; docs: CI trust model.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
- Remove the WHPSymlinkWalk post-walk lstat prototype (check-then-use race by
construction; WHPOwnerGuard is the race-free mechanism): hook, directive,
per-dir member, header docs. The directive is now an unknown command.
- Probe test: WHP_SYMTEST_REQUIRE=1 turns every SKIP into a FAIL (no docker, no
image, container does not start) and a minimum assertion count is enforced.
New assertions: bare `Options All` keeps Apache semantics (Indexes on,
MultiViews off, same-owner symlink followed, cross-tenant refused) plus
None/+MultiViews controls (106 assertions).
- CI: new pull_request workflow shared-httpd-symlink-pr.yaml (builds amd64
locally, no push/secrets, runs the probe test); build-push.yaml
Build-Shared-httpd runs the probe test against the amd64 digest it just pushed,
before the arm64 build and tag assembly, so a failure publishes no tag.
Test script added to the shellcheck set; wiring tests added.
- docs/shared-httpd-symlink-module.md: behaviour, local run, CI.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
- guard_filter logged fi.user uninitialised when fstat of the served fd
failed (refusal itself was already fail-closed); now -1.
- Drop the unused guard_ctx.checked_ok.
- Header: state what the fd guard cannot see (no FILE bucket): 304 to a
conditional request (confirms a wrong-owner target's ETag, measured),
mod_autoindex listings (a swapped public_html still lists the other
tenant's directory names with guard On and no WHP <Directory /mnt/users>
fix, measured), PHP via FPM.
- whp-symlink-module.test.sh: Options inside nested <If>, <ElseIf>, <Else>,
<Files>+<If>, <FilesMatch>, <IfModule>/<IfDefine>/<IfVersion>, <Limit>,
mod_macro expansion, backslash line continuation; and a tenant .htaccess
setting WHPOwnerGuard / WHPHtaccessOptionsRemap (also inside <If>) must
500. 100/100 against the rebuilt image.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
Security review (2 HIGH):
- Incomplete remap: only bare `All` was handled; `+All`/`-All`, `None +X`,
`RunScripts` etc. passed through. The remap now matches every word against
the full core keyword list and emits only known-safe names (prefix kept,
core +/- mixing rules respected): any symlink-follow form ->
SymLinksIfOwnerMatch, any exec-SSI form -> IncludesNOEXEC (only if allowed,
else dropped), positive ExecCGI dropped, unknown words dropped. The line is
always replaced by the normalised form, so the core never sees input words.
- Parser differential: ap_getword_conf() unquotes, and the re-joined line was
re-tokenised by the core. A line containing quote or backslash characters is
now refused (config error -> 500, nothing enabled); emitted tokens are fixed
keywords, so the join is unambiguous.
scripts/tests/whp-symlink-module.test.sh probes 29 Options forms (+All, -All,
All mixed with +/-, case and FollowSymlinks spelling variants, quoted,
escaped, tab-separated) for cross-tenant symlink reads, SSI/CGI exec, refusal
of quoted lines, and the swapped public_html owner guard.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
Tenant .htaccess files that say `Options +FollowSymLinks` / `All` /
`Includes` (stock CodeIgniter 4, Joomla, OpenCart, Magento) answer 500 on the
shared tier since the AllowOverride Options= lockdown. A small loadable module,
built against the distribution httpd-devel (stock AlmaLinux httpd RPMs stay):
- WHPHtaccessOptionsRemap On: rewrites the Options line in .htaccess before
the core parses it (FollowSymLinks -> SymLinksIfOwnerMatch, Includes ->
IncludesNOEXEC, positive ExecCGI dropped), so those files work while the
core's own owner-match symlink check stays in charge. Covers nested <If>.
- WHPOwnerGuard Log|On: fstat() owner check on the file descriptor actually
served (the Bluehost/cPanel SymlinkProtect idea, as an output filter);
closes the SymLinksIfOwnerMatch check-then-open race and the swapped
public_html case. Ships in Log mode.
DRAFT: measured locally only, see the WHP-side write-up.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6