Skip to content

tests: pin probe-verified behaviors of the recently merged plugin fixes#70

Merged
MegaManSec merged 2 commits into
masterfrom
tests/pin-probe-verified-behaviors
Jun 9, 2026
Merged

tests: pin probe-verified behaviors of the recently merged plugin fixes#70
MegaManSec merged 2 commits into
masterfrom
tests/pin-probe-verified-behaviors

Conversation

@MegaManSec

Copy link
Copy Markdown
Owner

Each of these was verified by hand (CLI probes, and runtime checks against nginx 1.27 in docker) while reviewing #62-#67 but had no test pinning it:

  • status_page_exposed: http-level allow/deny inheritance; a location whose own partial rules replace the inherited ones (all-or-nothing merge) is flagged again.
  • return_bypasses_allow_deny: 'rewrite ... break' with a URI replacement reaches the access phase (not flagged); a $scheme:// replacement redirects even under 'break' (flagged); the absolute-URL prefix check is case-sensitive like nginx's, so 'HTTP://' does not count.
  • unanchored_regex: \A/\Z string anchors; a lookahead carrying the anchor; min>=1 repeats anchor while min=0 repeats do not; an escaped backslash before 'z' is not a \z anchor.
  • allow_without_deny: auth_jwt participates in the satisfy-any suppression; an explicit 'satisfy all' still warns.
  • invalid_regex: the set-outside-if fallback path (flag without a provider, stay quiet with one); an unparseable provider regex silences the whole-scope check; add_header and try_files are audited; a static map key spelled 'map' is skipped without crashing while the sibling regex entry is still validated.

Each of these was verified by hand (CLI probes, and runtime checks
against nginx 1.27 in docker) while reviewing #62-#67 but had no test
pinning it:

- status_page_exposed: http-level allow/deny inheritance; a location
  whose own partial rules replace the inherited ones (all-or-nothing
  merge) is flagged again.
- return_bypasses_allow_deny: 'rewrite ... break' with a URI
  replacement reaches the access phase (not flagged); a $scheme://
  replacement redirects even under 'break' (flagged); the absolute-URL
  prefix check is case-sensitive like nginx's, so 'HTTP://' does not
  count.
- unanchored_regex: \A/\Z string anchors; a lookahead carrying the
  anchor; min>=1 repeats anchor while min=0 repeats do not; an escaped
  backslash before 'z' is not a \z anchor.
- allow_without_deny: auth_jwt participates in the satisfy-any
  suppression; an explicit 'satisfy all' still warns.
- invalid_regex: the set-outside-if fallback path (flag without a
  provider, stay quiet with one); an unparseable provider regex
  silences the whole-scope check; add_header and try_files are audited;
  a static map key spelled 'map' is skipped without crashing while the
  sibling regex entry is still validated.
…anged

The first commit pinned the NEW behaviors; these pin the behaviors that
were already correct before #62-#67 and had no test keeping them that
way:

- return_bypasses_allow_deny: a flagless rewrite with a URI replacement
  is not a bypass; the named-location pruning applies to redirecting
  rewrites just as it does to return.
- unanchored_regex: prefix (non-regex) locations are never flagged;
  '~*' case-insensitive regexes still are; a PCRE-only pattern the
  vendored parser cannot read stays quiet instead of crashing.
- allow_without_deny: auth alone (no 'satisfy any') still warns; a
  sibling location's satisfy/auth does not leak into another location's
  allow.
- invalid_regex: $12 against a captureless pattern reports $1 (single
  digit), not $12; the whole-scope union spans sibling locations of the
  same server; static/default map values are never validated against
  their key.
- status_page_exposed: stub_status directly in server context is still
  audited.
@MegaManSec
MegaManSec merged commit 625ac0d into master Jun 9, 2026
24 checks passed
@MegaManSec
MegaManSec deleted the tests/pin-probe-verified-behaviors branch June 9, 2026 23:28
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