Skip to content

Settings refusals: VIP covers 0.0.0.0/8, blank username-domain list refuses, public-origin, backup and DR path and sibling refusals quote no value (BACKLOG #5132 #5131 #5109 #5110 #5111) - #3560

Merged
wshallwshall merged 36 commits into
mainfrom
b20055-5111
Dec 2, 2026

Conversation

@wshallwshall

@wshallwshall wshallwshall commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

BACKLOG #5132, #5131, #5109, #5110 and #5111 (batch 20055, the config/settings.py chain). All five change security controls.

Why one PR and not five. The rows were built as a stack, 5132 -> 5131 -> 5109 -> 5110 -> 5111, all in config/settings.py and its neighbours. Branches 5109 and 5110 are each red on tests/test_cli_offline_resolution.py, three public-address-nfkc-* cases. #5109 stopped quoting the value in that refusal, so the test's control could no longer fire. The fix, commit 3505444, which swaps in an [update_check].mode case, exists only on 5111. Per-row PRs would put two red PRs in the queue, and moving the fix would need a force-push of stacked branches. So the stack lands as one unit; each row keeps its own commits. Manager decision d20261202T075015447-e29f6a (adversarial review affirmed). The head merges clean with main.

Rows

Row Branch head What Verdict
#5132 0e5ff8c _vip_address_problems refuses all of 0.0.0.0/8, with a /8 boundary test DONE
#5131 5c2c31e a blank oidc_allowed_username_domains that normalises to empty refuses (OIDC on, strip_domain on) instead of falling back to ad_domain DONE
#5109 175842b _normalize_public_origin guards its split and refuses without quoting the value; the IP-literal and oidc_allowed_endpoints refusals quote no host DONE
#5110 a0042f9 _is_local_or_unc_path gates the backup destination, the DR seed paths and the restore token path; two runner log lines show destination_for_log DONE
#5111 73cac06 sibling refusals name the setting and what it accepts, and quote no value (urlscreen.setting_must_be); destination, token-URL and proxy scheme refusals name their connection DONE

Behaviour changes, fail-closed and by design:

  • #5110: a POSIX backup or DR path holding : or one of <>"|?* is now refused.
  • #5131: a blank env value over a TOML list now refuses.
  • #5132: every 0.0.0.0/8 address is now refused as a VIP.

QA. Level xhigh, Rounds 2 + 1 unrepaired for each row. Tag: xhigh effort -> 10 inline angles -> dedup (no verify) -> sweep -> <=15 findings, read with review_tag.py --ascii.

Row Forks and nonces (the last is the unrepaired round)
5132 a99962bb17d2f22cf round-e06ade4446; a08c1d781e8fb07ce round-a9f3373a6f; aabdcd81344395349 round-e49254088d
5131 aa8f8694dec4eec78 round-281b51a824; a80312df1923a1daa round-b02e9a8c9c; a48981689d4f546b7 round-a216ad5ed1
5109 a1e18f1a7076c1d99 round-876d8cccc8; aade56369277febce round-cf45fb8d16; ab6adef2978329af8 round-7b5e33eef7
5110 a698b44ba921e1891 round-a58f13a9cc; a08ced15faa27c953 round-bd2020a0dc; aa561d68ae2153ec4 round-76a2b74765
5111 aee638008023143f6 round-12f997e51b; af2d83b30065ff39a round-eaffc7c2e8; ae3c4cb199ee91d2a round-27ada09290, on the head

Checks:

  • ruff and all four mypy legs on each row (at the head: linux 400, win32 381, tests 2088 and asvs 6 files, all clean);
  • pytest on each row's touched modules; at the head, 2461 passed and 1 skipped over 20 modules, plus test_hop_url_with_no_host_is_refused.py (64 passed);
  • the full suite was not run.

Refusals, all corrected acts:

  • The worktree guard refused compound commands as too complex to verify. Each was split into plain commands, or the edit was made with Edit or Write inside the worktree.
  • The forbidden-content pre-commit hook flagged an RFC section number as an IPv4 shape. The text was reworded to "RFC 1122, section 3.2.1".
  • The ruff-format hook reformatted a file, which was re-staged.

Open findings, for you to route. These change behaviour:

  • #5111:
    • the base-URL refusal, and an engine URL written without //, says "another scheme" where none was written;
    • the SOAP soap_version refusal still prints the raw value;
    • _peer_label in wiring.py still prints an arbitrary scheme, and static_credentials passes a refused proxy_url to it;
    • other enum refusals still quote: update_check.mode, tls_min_version, [ai].provider, event_type, control_action, secret_rotation. The new offline-resolution test case depends on update_check.mode quoting.
  • #5110:
    • _ensure_destination's BackupError and the storage_threshold alert still carry the raw destination;
    • [backup].destination does not refuse a value padded with a control character;
    • //token@host passes the check, and C1 controls are not refused.
  • #5109: a non-numeric port and userinfo on the public origin are still accepted (#4840), and the OIDC loop's bare urlsplit remains (#4783).
  • #5131 (altitude): other lists also come out empty under a blank env variable, and a BOM or zero-width value is not caught.

Open findings that change no behaviour:

  • The #5132, #5131 and #5109 entries are in CHANGELOG.md, not changelog.d fragments.
  • The renderer positive control in the #5109 tests is vacuous.
  • _PATH_SHAPE_RULE's text misdescribes the @ rule.
  • The changelog fragment for #5111 has four inaccuracies (base-URL setting, OAuth2 omitted, build-time CRL omitted, the :// reason).
  • Seven copies of the url-scheme check exist; the "not shown to be a path" reason is restated at six sites; the renamed API-CRL test fires at settings load; egress.py has a duplicate proxy refusal text.
  • A test file holds a raw TAB where "\t" was meant, and the #5131 commit message wrongly says it was fixed. Another test file holds a literal U+FF03 character.

Owed after PR 3528 merges. The CONFIGURATION.md rows for [backup].destination, [dr].seed_archive, [dr].seed_dir and the restore token path (~3469, ~3506-3508) should state the local-or-UNC rule and what is refused.

Ledger. Proposed banners: each row CLOSED by this PR, as in the table above.

…ACKLOG #5132)

_vip_address_problems tested ip.is_unspecified, which is true for
0.0.0.0 alone, so 0.1.2.3 loaded as a floating address that no host
can bind. The check now refuses the whole "this network" block
(RFC 1122, section 3.2.1). Tests add 0.0.0.0, 0.1.2.3 and 0.255.255.254.

Verified-by: tests
…BACKLOG #5132)

CONFIGURATION.md said an unspecified address is refused; the check
now refuses the whole 0.0.0.0/8 block, which is wider.

Proposed PR title: [cluster.vip] refuses every address in 0.0.0.0/8 (BACKLOG #5132)
Proposed vault banner: CLOSED by engine PR <N>: _vip_address_problems
refuses all of 0.0.0.0/8, with tests for 0.0.0.0, 0.1.2.3 and
0.255.255.254; CONFIGURATION.md names the block.

Verified-by: none
…lock (BACKLOG #5132)

Review round 1. The check now calls netaddr.not_a_host_address, the
existing helper for 0.0.0.0/8, multicast and reserved, rather than a
second copy of the block. The refusal names 0.0.0.0/8, so 0.1.2.3 is
no longer refused as "unspecified". The comment's reason was false
(Linux can bind most of the block); the reason is that the block is
not valid as a destination. A boundary test shows the first address
past the block still loads.

Verified-by: tests
…CKLOG #5132)

Review round 1. CONFIGURATION.md's list read "is in ... loopback";
ADR 0056's still said "unspecified". Both now name the block. The
CHANGELOG records the tightening, since 0.5.3 loads such an address.

Proposed PR title: [cluster.vip] refuses every address in 0.0.0.0/8 (BACKLOG #5132)
Proposed vault banner: CLOSED by engine PR <N>: _vip_address_problems
refuses all of 0.0.0.0/8 through netaddr.not_a_host_address, with
tests for 0.0.0.0, 0.1.2.3, 0.255.255.254 and a boundary control.

Verified-by: none
Review round 2. The check no longer leans on netaddr's helper, whose
"at least" blocks serve the navigation lists and could narrow under
the VIP unseen. Each class is tested explicitly, 0.0.0.0/8 by its
first octet, and the refusal names the one that fired. Tests match
each reason, escape the 0.0.0.0/8 pattern, and the boundary control
is now 1.0.0.0 itself, as a /32.

Verified-by: tests
…CKLOG #5132)

Review round 2. ADRs are append-only history, so the ratified bullet
keeps its words and carries a dated amendment note instead of being
rewritten.

Proposed PR title: [cluster.vip] refuses every address in 0.0.0.0/8 (BACKLOG #5132)
Proposed vault banner: CLOSED by engine PR <N>: _vip_address_problems
refuses all of 0.0.0.0/8 and names the reason that fired, with tests
for 0.0.0.0, 0.1.2.3, 0.255.255.254 and a 1.0.0.0 boundary control.

Verified-by: none
…orms (BACKLOG #5131)

A blank MEFOR_AUTH_OIDC_ALLOWED_USERNAME_DOMAINS over a real TOML list
loaded as the empty default, so the UPN suffix check moved to
[auth].ad_domain with no output; the same blanks as a TOML list
disabled that fallback instead. The setting now has its own
claim-compared list validator: both forms are stripped with blanks
dropped, and a value that names something but holds only blanks is
refused at load, without quoting it. The unset default still falls
back to ad_domain. Step 1 took the refusal arm, so no ruling is owed.

Verified-by: tests
…ACKLOG #5131)

CONFIGURATION.md described the old split, a TOML list of blanks
refusing while the env form fell back. It now states the refusal in
both forms.

Proposed PR title: [auth] oidc_allowed_username_domains of only blanks refuses in both forms (BACKLOG #5131)
Proposed vault banner: CLOSED by engine PR <N>: a blanks-only value
refuses at load as a TOML list and as the env string, and the setting
moved to its own claim-compared list validator; tests pin both forms,
the row's env-over-TOML case and the default fallback.

Verified-by: none
…he type check (BACKLOG #5131)

Review round 1. The refusal stopped an engine with OIDC off over a
setting nothing reads, unlike the sibling lists; it now fires only
with oidc_enabled, and loads as empty otherwise. It runs after the
type check, so a set or other iterable pydantic coerces is caught too.
The message names the variable, since the TOML file holds a real
suffix, and says the fallback needs the setting unset in both places.
Tests pin an explicit empty list and OIDC off.

Verified-by: tests
…nset (BACKLOG #5131)

Review round 1. CONFIGURATION.md said "Empty falls back" beside a
refusal of an empty variable; it now says unset or an explicit empty
list falls back, and scopes the refusal to oidc_enabled. The CHANGELOG
says the same and notes TOML entries are now stripped.

Proposed PR title: [auth] oidc_allowed_username_domains of only blanks refuses in both forms (BACKLOG #5131)
Proposed vault banner: CLOSED by engine PR <N>: with OIDC on, a
blanks-only value refuses at load as a TOML list and as the env
string, and the setting has its own claim-compared list validator;
tests pin both forms, the row's env-over-TOML case, OIDC off and the
fallback.

Verified-by: none
…e claim-list helper (BACKLOG #5131)

Review round 2. The claim check reads the list only with OIDC on and
the suffix stripped, so the refusal now needs both; with strip off a
blank template variable loads as empty. The strip and blank drop go
through _normalise_claim_value_list, whose docstring names this field.
The message no longer asserts an env variable the site may not have
set. A test pins the field order the refusal depends on, and the field
and property comments match. The tab case is written as an escape.

Verified-by: tests
…med (BACKLOG #5131)

Review round 2. CONFIGURATION.md and the CHANGELOG scope the refusal
to OIDC and stripping both on, and say an explicit empty list in the
file falls back. The CHANGELOG drops a sentence that changed nothing
an operator does.

Proposed PR title: [auth] oidc_allowed_username_domains of only blanks refuses in both forms (BACKLOG #5131)
Proposed vault banner: CLOSED by engine PR <N>: with OIDC and
stripping on, a blanks-only value refuses at load as a TOML list and
as the env string, and the setting has its own claim-compared list
validator; tests pin both forms, the row's env-over-TOML case, the
not-read cases and the fallback.

Verified-by: none
…alue (BACKLOG #5109)

_normalize_public_origin let urlsplit's ValueError through, and its
message can quote the netloc, userinfo included; it is now replaced,
with no chained cause. The IP-literal refusal quoted the whole origin,
which may keep userinfo; the oidc_allowed_endpoints refusal quoted the
host, which urlsplit reads from the value. Both now name the setting
only. input_hiding.py's "names at least the ones known" read as a
census; it now says the list is examples. Canary tests cover each.

Proposed PR title: Public origin and OIDC host refusals quote no part of the value (BACKLOG #5109)
Proposed vault banner: CLOSED by engine PR <N>: _normalize_public_origin
guards urlsplit, the IP-literal and oidc_allowed_endpoints refusals
name the setting and quote nothing, with a canary test per field; the
input_hiding.py sentence names what it covers. The OIDC loop's bare
urlsplit stays #4783's.

Verified-by: tests
…ies case-folded (BACKLOG #5109)

Review round 1. `from None` left urlsplit's error, which quotes the
netloc, on __context__ of the error pydantic keeps in ctx, and it
failed test_from_none_is_not_redaction; the refusal is now raised
after the handler ends. The canaries were upper case while the origin
and host are lower-cased before a refusal could quote them, so they
could not fire; they are lower case, compared case-folded, and the
kept error's chain is read too. The OIDC refusal shows the allow-list
again, the operator's own host names. The IP-literal comment's second
reason could not occur there and is gone.

Verified-by: tests
…ACKLOG #5109)

Review round 1: the sibling refusal changes in [Unreleased] each have
an entry, and this one changes security-relevant output.

Proposed PR title: Public origin and OIDC host refusals quote no part of the value (BACKLOG #5109)
Proposed vault banner: CLOSED by engine PR <N>: _normalize_public_origin
refuses an unparsable origin after its handler ends, the IP-literal
and oidc_allowed_endpoints refusals quote no part of the value, with a
canary test per field; the input_hiding.py sentence names what it
covers. The OIDC loop's bare urlsplit stays #4783's.

Verified-by: none
… uncached (BACKLOG #5109)

Review round 2. An oidc_allowed_endpoints entry is not checked to be a
host, so a pasted URL there could hold a password; the refusal now
quotes neither, and says the host is read in lower case and compared
exactly, which the dropped host used to show. The public-origin split
is uncached (#5287) and its refusal names likely causes. Tests add the
load_settings path, a second canary in the allow-list, and a positive
control proving the renderer reaches a kept error's __context__.

Verified-by: tests
…LOG #5109)

Review round 2 follows the code change.

Proposed PR title: Public origin and OIDC allow-list refusals quote no part of the value (BACKLOG #5109)
Proposed vault banner: CLOSED by engine PR <N>: _normalize_public_origin
refuses an unparsable origin after its handler ends, and the
IP-literal and oidc_allowed_endpoints refusals quote no part of the
value, with a canary test per field and a load_settings case; the
input_hiding.py sentence names what it covers. The OIDC loop's bare
urlsplit stays #4783's.

Verified-by: none
…stination (BACKLOG #5110)

_looks_like_url reads one spelling, so x://u:pw@h, KEY:pw://h,
s3:bucket?sig= and 1s://... loaded as paths at [backup].destination,
[dr].seed_archive and [dr].restore_token. _is_local_or_unc_path adds a
positive check: no URL, and a ':' only after a leading drive letter
(after any \\?\ prefix). The DR runner's INFO start line and its
not-writable WARNING read BackupSettings.destination_for_log, which
shows a path and withholds anything else, and the WARNING names the
OSError by strerror, since its own text quotes the path. Tests carry
the four values, path controls and both log lines. The seed_dir
render test now reaches _seed_dir_absolute with a colon-free value.

Verified-by: tests
… #5110)

The CONFIGURATION.md rows that describe _looks_like_url are left to
open PR 3528, which rewrites them; the wording they need is in the
Builder's report.

Proposed PR title: [backup]/[dr] path settings checked positively; DR runner logs no URL destination (BACKLOG #5110)
Proposed vault banner: CLOSED by engine PR <N>: destination,
seed_archive and restore_token take a positive local-or-UNC shape
check, with the four reported values as tests; the DR runner's INFO
and WARNING lines log destination_for_log. CONFIGURATION.md rows owed
after PR 3528 lands.

Verified-by: none
…info and a query (BACKLOG #5110)

Review round 1. x://token@h/x and C:/c?sig=... still loaded; the
check now refuses an '@' in the segment after a drive letter's '//'
and any character Win32 refuses in a path, read after the \\?\ or
\\.\ prefix in either slash spelling, which it now strips by matched
length. The WARNING keeps the OSError's class and code, without its
filename. The new values join _CREDENTIAL_URLS, so all four path
fields and every rendering are checked; the runner test patches mkdir
for its own path only.

Verified-by: tests
…LOG #5110)

Review round 1. The entry omitted [dr].seed_dir, and said the runner
no longer logs such a destination at all; only its startup lines
changed. The CONFIGURATION.md rows that describe _looks_like_url are
left to open PR 3528; the wording they need is in the Builder's report.

Proposed PR title: [backup]/[dr] path settings checked positively; DR runner startup lines log no URL destination (BACKLOG #5110)
Proposed vault banner: CLOSED by engine PR <N>: destination,
seed_archive, seed_dir and restore_token take a positive local-or-UNC
shape check, with the four reported values among the tested shapes;
the DR runner's startup INFO and WARNING lines log destination_for_log.
CONFIGURATION.md rows owed after PR 3528 lands.

Verified-by: none
…states every rule (BACKLOG #5110)

Review round 2. A NUL loaded and then failed the runner's mkdir with
an uncaught ValueError; the C0 controls are now refused. The userinfo
rule takes two or more slashes, and the \\?\ and \\.\ prefixes match
in every slash spelling. Each refusal now states the whole rule, one
fixed text. The WARNING keeps a WinError code. Tests add NUL, three
slashes, the mixed prefixes, seed_dir controls and a WinError case.

Verified-by: tests
…5110)

Review round 2. changelog.d/README.md says a pull request adds a
fragment and does not edit CHANGELOG.md; this branch's entry moves to
changelog.d/5110.security.md and names the control-character and
prefix rules. The CONFIGURATION.md rows that describe _looks_like_url
are left to open PR 3528; the wording they need is in the Builder's
report.

Proposed PR title: [backup]/[dr] path settings checked positively; DR runner startup lines log no URL destination (BACKLOG #5110)
Proposed vault banner: CLOSED by engine PR <N>: destination,
seed_archive, seed_dir and restore_token take a positive local-or-UNC
shape check, with the four reported values among the tested shapes;
the DR runner's startup INFO and WARNING lines log destination_for_log.
CONFIGURATION.md rows owed after PR 3528 lands.

Verified-by: none
…alue (BACKLOG #5111)

One shared helper, urlscreen.setting_must_be, writes the refusal for
the eight "got scheme" sites (ai_broker, dicomweb, fhir twice, rest
twice, smart, soap), [backup].schedule_at and snapshot_method, and the
same shape found beside them: [retention].vacuum_at, and the load-time
CRL and [store].ssl_root_cert path refusals, which quoted a value not
yet shown to be a path. harden_crl_check's missing-file refusal names
the setting alone; crl_label keeps quoting a path, with a line saying
why that is safe (the file was there). ai_broker.py and rest.py import
the helper at the refusal, to keep their hunks to those lines.

Verified-by: tests
… (BACKLOG #5111)

Proposed PR title: Sibling refusals name the setting and what it accepts, and quote no value (BACKLOG #5111)
Proposed vault banner: CLOSED by engine PR <N>: urlscreen.setting_must_be
writes the eight got-scheme refusals, schedule_at, snapshot_method,
vacuum_at and the load-time CRL and ssl_root_cert path refusals, with a
canary test per refusal; crl_label carries the line saying why a path
it quotes is safe.

Verified-by: none
…es no scheme (BACKLOG #5111)

Review round 1. The REST, SOAP, FHIR and DICOMweb scheme refusals now
name the destination, since without the scheme nothing else told the
operator which one failed. The api client's base-URL refusal quoted
the scheme, which is a user name when '//' is missing; it no longer
does. harden_crl_check's missing-file refusal leads with the setting,
as its docstring says. setting_must_be's and crl_label's docstrings no
longer claim more than holds. test_hop_refusal_revocation's pin moves
to the new text; tests add oauth2_token_url and the api client.

Verified-by: tests
…t (BACKLOG #5111)

Review round 1 follows the code change.

Proposed PR title: Sibling refusals name the setting and what it accepts, and quote no value (BACKLOG #5111)
Proposed vault banner: CLOSED by engine PR <N>: urlscreen.setting_must_be
writes the eight got-scheme refusals, schedule_at, snapshot_method,
vacuum_at and the load-time CRL and ssl_root_cert path refusals, the
API client's base-URL refusal no longer quotes its scheme, with a
canary test per refusal; crl_label says when a path it quotes is safe.

Verified-by: none
…#5111)

Review round 2. The REST, SOAP, FHIR and DICOMweb scheme refusals lead
with hop_name_prefix(config.name), as their neighbours do, in place of
an ad-hoc label; the SMART/OAuth2 token-URL and proxy_url scheme
refusals now name their connection too. harden_crl_check's
setting-named refusal says the path does not exist or is not a file,
which is true of a directory. The settings docstrings no longer say
"A path, not a secret". test_api_tls_client_trust pins the new
load-time CRL text, and test_cli_offline_resolution swaps its
public-address NFKC case, whose refusal stopped quoting the value under
#5109, for an [update_check].mode case that still quotes.

Verified-by: tests
…#5111)

Review round 2: the fragment no longer says every refusal names what
the setting accepts or that every destination refusal names the
destination.

Proposed PR title: Sibling refusals name the setting and what it accepts, and quote no value (BACKLOG #5111)
Proposed vault banner: CLOSED by engine PR <N>: urlscreen.setting_must_be
writes the eight got-scheme refusals, schedule_at, snapshot_method,
vacuum_at and the load-time CRL and ssl_root_cert path refusals; the
scheme refusals of destinations, token URLs and proxy_url name their
connection; the API client's base-URL refusal quotes no scheme; a
canary test per refusal.

Verified-by: none
@wshallwshall wshallwshall added the qa Builder QA record posted; not a merge gate label Dec 2, 2026
@github-actions github-actions Bot added the ci-red A required check went red. Attribute it before retrying. label Dec 2, 2026
… #5110)

The [backup].destination path-shape check refuses a "?" on every
platform, as the 5110 changelog fragment states, so the POSIX-only "?"
case of test_backup_verify_and_restore_count_the_real_snapshot_under_hazard_paths
failed to build its BackupSettings on CI test shard 3 (ubuntu). On
origin/main the same destination loads. No snapshot is staged in the
destination, so the "?" case now writes its archive to a hazard-free
directory; the data, OS temp and restore directories keep the hazard,
and "#" and "%41" keep it in the destination too. The refusal stays.

Verified-by: tests
@wshallwshall

Copy link
Copy Markdown
Collaborator Author

CI fix pushed: head 1039ab1 (fast-forward from 73cac06).

  • Cause: this branch. The #5110 path-shape check refuses ? in a backup destination, while origin/main accepts it. That refusal is intended and documented in changelog.d/5110.security.md.
  • Fix: the refusal is kept, and the test changes. tests/test_b2186_snapshot_uri.py now uses a hazard-free destination for the ? case only; the data, temp and restore directories keep the ? hazard.
  • Local run: 70 passed. The changed case is POSIX-only and did not run locally, so read ubuntu test shard 3.
  • QA: Level xhigh. Tag: xhigh effort -> 10 inline angles -> dedup (no verify) -> sweep -> <=15 findings (fork a6192749f8b0e6775 round-2188d81ad5). Rounds: 1, unrepaired. 7 open findings, all test or comment prose. The main one: the new comment says no snapshot is staged in the destination, which holds only for an on-disk SQLite store.
  • Docker image smoke: read as main-side (see PR 3543).

Brings PR 3560 up to date with main. One conflict, CHANGELOG.md
Unreleased: the branch's #5132, #5131 and #5109 entries and main's
#6600 entry were added at the same point; both are kept, branch first.
settings.py, tls_policy.py and CONFIGURATION.md merged cleanly.

Verified-by: tests
…read (BACKLOG #5110, #5111)

Comment and docstring text only; no behaviour changes.

- _looks_like_url: says it detects one shape and that the settings
  refuse through _is_local_or_unc_path (#5110).
- seed_dir comment and settings_error_detail: name
  _is_local_or_unc_path, not _looks_like_url.
- _refuse_a_missing_crl_file: harden_crl_check no longer hard-codes a
  "[tls] crl file" prefix (#5111); the load check's point is refusing
  at load, led by the setting.
- tls_policy _naming_the_ca_setting: a missing CRL is refused by
  setting without its path (#5111); only refusals on a file that is
  there quote it.
- test_security_cli docstring names _is_local_or_unc_path.

Verified-by: tests
Verified-by: code-review xhigh
…sals (BACKLOG #5110)

The rows merged from main (#5116) said the check was _looks_like_url
and that my_s3:// and 1s:// load as a path. #5110 replaced that gate
with _is_local_or_unc_path, which refuses both. The backup destination
row now names that check and its refusals with their remedy, and the
three [dr] path rows point to it.

Proposed PR title: [backup]/[dr] paths checked positively; refusals
name the setting and quote no value (BACKLOG #5110, #5111)
Proposed vault banner: #5110 built on PR 3560, docs follow-up included.

Verified-by: tests
Verified-by: code-review xhigh
…ell (BACKLOG #5110)

Prose only; no behaviour changes.

- Escape the pipe in the destination row's code span, which split the
  table cell and dropped the rest of the row on render.
- Say a two-or-more-character scheme is refused, and that a one-letter
  scheme (s://, x://) with none of the refused shapes still loads as a
  path, in the destination row, the three [dr] rows and the
  _looks_like_url docstring.
- Name C0 control characters, not every control character.
- Replace the C:// sentence, which was false both ways.
- The remedy names the file itself for a [dr] key that takes a file.

Verified-by: tests
Verified-by: code-review xhigh
@wshallwshall

Copy link
Copy Markdown
Collaborator Author

Merge of main and doc corrections pushed. Head is 6b0e120.

Commits after 1039ab1:

  • a7f17a5: merge of origin/main baa9d4f. One CHANGELOG conflict; both sides kept.
  • 290bc72 and 991b29c: comments, docstrings and CONFIGURATION.md rows that the merge left describing _looks_like_url now name _is_local_or_unc_path and its refusals.
  • 6b0e120: table-pipe escape and accuracy fixes.

No behaviour changed after a7f17a5.

QA:

  • Merge: fork af645107430566f97 round-a3dec5e1c8, Rounds 1.
  • Docs round 1: fork a674c7d1f22acc3e9 round-5aa2c33b, review_tag.py exit 0.
  • Docs round 2: fork a35beb06d9fab5a38 round-0582a5e6. All unrepaired at their last round.
  • Tag on each: xhigh effort -> 10 inline angles -> dedup (no verify) -> sweep -> <=15 findings.

Checks on 6b0e120: 13 doc/settings/backup files, 1732 passed and 91 skipped; ruff; the four mypy legs. The earlier merge head had 2094 passed across 19 files.

Text rounds stop here; the Manager's call. Open findings for the Lander to classify:

  1. OWNER-ROUTE CANDIDATE (control claim, unsafe direction): the C0 control-character rule runs on the stripped value, so a leading or trailing TAB, LF, VT, FF, CR or U+001C-U+001F passes (destination='D:/backups\t' loads). The runner uses the unstripped value. Rewording alone leaves a padded destination loading, so a behaviour row is likely too.
  2. OWNER-ROUTE CANDIDATE (control claim, unsafe direction): comments beside the fields still say "a URL is rejected" unqualified (settings.py ~7958, 8122, 8129, 8140; docs/adr/0049 line 265; docs/ASVS-L2-PHASE0-CHANGES.md line 817). A one-letter scheme (s://) loads as a path.
  3. Behaviour, to file: the @ rule's segment stops at a backslash, so x://tok\en@host loads.
  4. The _PATH_SHAPE_RULE refusal text says "right after" // while the regex refuses @ anywhere in the first segment. Changing the text is behaviour.
  5. The _looks_like_url sentence "a one-letter scheme passes both" lacks "with none of the refused shapes"; same for the [dr] rows (safe direction).
    6-10. The remedy has no seed_dir or @ case; restatement (SDS-3.5); repeated phrase; "listed below" inside a cell.

Also from the merge review: the #5109 OIDC endpoint loop (settings.py ~4975) still calls the cached urlsplit, so its NFKC error can quote userinfo. Not reached end to end. The #5132, #5131 and #5109 CHANGELOG bullets are direct edits rather than changelog.d fragments.

@wshallwshall

Copy link
Copy Markdown
Collaborator Author

Lander (session heuristic-kepler, account 7): held at 6b0e120 for four text fixes; no behaviour change is asked for. Your QA lines are the review proof. A fresh-context reviewer I started ran one probe (32 path inputs, 7 VIP addresses, 5 public origins, 14 username-domain cases) at this head and at main 89f5b5e: the head never accepts an input main refused, and no head refusal text quotes a token or userinfo. So there is nothing worse than main here, and the tightenings are accepted. What holds the merge is text this PR adds or rewrites that promises a refusal the code does not give. You said text rounds stop with you, so a Lander repair Builder is applying these now (repair 1 of 2).

What is wrong (each measured):

  1. changelog.d/5110.security.md says a value is refused when it has "a control character", and docs/CONFIGURATION.md ([backup].destination row) says "or a C0 control character (U+0000 to U+001F)". [backup].destination = 'D:/backups\t' loads at this head, as do a leading or trailing LF, VT, FF, CR and U+001C to U+001F, because the rule runs on the stripped value.
  2. changelog.d/5110.security.md opens "Besides a <scheme>:// URL, a value is now refused...", which reads as every scheme URL being refused. s://x loads (a one-letter scheme reads as a drive letter), on main too.
  3. messagefoundry/config/settings.py, the comment this PR rewrote near line 7958: "A :// URL (s3://, https://, sftp://, ...) is REJECTED, and so is any value without a local or UNC path's shape". Same s://x case.

Fix. These four edits and nothing else.

  1. changelog.d/5110.security.md: replace "or a control character" with "or a control character inside the value (a leading or trailing TAB, LF, VT, FF, CR or U+001C to U+001F is not refused by this rule)".
  2. changelog.d/5110.security.md: replace "Besides a <scheme>:// URL," with "Besides a <scheme>:// URL whose scheme has two or more characters (a one-letter scheme reads as a drive letter and can load),".
  3. docs/CONFIGURATION.md, [backup].destination row: replace "or a C0 control character (U+0000 to U+001F)" with "or a C0 control character (U+0000 to U+001F) inside the value; a leading or trailing TAB, LF, VT, FF, CR or U+001C to U+001F is not refused by this rule".
  4. messagefoundry/config/settings.py near line 7958: replace the sentence "A :// URL (s3://, https://, sftp://, ...) is REJECTED, and so is any value without a local or UNC path's shape" with "_is_local_or_unc_path decides which values are refused; a one-letter scheme such as s://x passes it and loads as a path", re-wrapping only that comment.

Queued for filing under R2, none holding the merge: the padded-destination behaviour itself (same on main; the runner uses the unstripped value); the unqualified "a URL is rejected" comments this PR does not touch (settings.py near 8122, 8130, 8140, ADR 0049, the ASVS phase-0 doc); the @ rule's segment stopping at a backslash (x://tok\en@host loads, same on main); _PATH_SHAPE_RULE text saying "right after //" where the regex refuses @ anywhere in the first segment (safe direction); "a one-letter scheme passes both" without its qualifier (safe direction); the OIDC endpoint loop still using the cached urlsplit; the #5132, #5131 and #5109 CHANGELOG bullets edited directly, not as fragments; public_origin with userinfo loads on both and reaches the cached urlsplit; x:SECRETTOK//host loads on both as a drive-relative path.

…RL or control character

The changelog fragment, CONFIGURATION.md and the settings comment now say a one-letter scheme loads
and a leading or trailing control character stripped before the screen is not refused by it.

Verified-by: tests
… example beside its rule

The changelog fragment and CONFIGURATION.md row now say C0 control character and attach the ?sig= example to the rule that refuses it.

Verified-by: tests
@wshallwshall

Copy link
Copy Markdown
Collaborator Author

Lander (session heuristic-kepler, account 7): both Lander repairs are used (8cd99fb, 9f54f62); text only, no code. The review of the first repair (fork ada322af1ba36860d, round-d04e7a15c9, xhigh effort -> 10 inline angles -> dedup (no verify) -> sweep -> <=15 findings, review_tag.py exit 0) probed 13 values against _is_local_or_unc_path, confirmed the new text true, and prescribed two replacements: "C0 control character (U+0000 to U+001F)" in the changelog fragment (DEL and C1 controls are not refused), and moving the ?sig= clause back beside its rule in CONFIGURATION.md. The second repair applies those two replacements word for word; I checked that with a word diff of 8cd99fb..9f54f62 (two files, only those words). No further review round ran on that last delta; I am relying on the reviewer having measured the exact text it prescribed. Decision d20261202T (see log): merge with findings filed, empower added class 3.

Also queued for filing under R2: a TAB- or LF-padded [backup].destination loads and the runner's mkdir then fails on Windows on every run, with no consequence or remedy stated (refuse padding as [dr] does); the new settings.py comment drops the note that a blank destination is also refused and restates the one-letter-scheme fact; _PATH_SHAPE_RULE says "a control character" (outside this delta); a leading or trailing NUL or ESC is refused though the text reads as interior only; no test pins the padded-loads behaviour the text documents.

Pinned head for the merge: 9f54f62. I enqueue once every required context is green on it. Undo: revert the squash commit.

@wshallwshall

Copy link
Copy Markdown
Collaborator Author

Lander: the decision record named above is d20261202T140629267-2332cf.

@wshallwshall
wshallwshall added this pull request to the merge queue Dec 2, 2026
Merged via the queue into main with commit b8e8d62 Dec 2, 2026
67 of 69 checks passed
@wshallwshall
wshallwshall deleted the b20055-5111 branch December 2, 2026 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-red A required check went red. Attribute it before retrying. qa Builder QA record posted; not a merge gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant