Commit Graph
3 Commits
Author SHA1 Message Date
shadowdaoandClaude Sonnet 5.5 0d9e57e012 ci+chore(mod_whp_symlink): remove racy WHPSymlinkWalk prototype; run the probe test in CI; assert Options All mapping
shared-httpd mod_whp_symlink PR check / Symlink-Module-Probe (pull_request) Successful in 1m15s
- 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
2026-11-23 07:33:47 -08:00
shadowdaoandClaude Opus 5.5 1953a176f5 review(mod_whp_symlink): no uninitialised uid in the guard log; document guard gaps; container probes
- 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
2026-11-23 07:13:13 -08:00
shadowdaoandClaude Opus 5.5 31e42ecbc2 fix(mod_whp_symlink): deny-by-default Options remap, refuse quoted lines; add probe test
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
2026-11-23 06:29:48 -08:00