Skip to content

fix(security): allowed link hosts take DNS names only and audit their use - #26736

Merged
bolichen97 merged 1 commit into
mainfrom
fix/redaction-hosts-18180
Oct 31, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/redaction-hosts-18180

Conversation

@bolichen97

@bolichen97 bolichen97 commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: The allowed link host list holds DNS names only, and every time an allowed host lets a blocked link back on screen the security audit log records it.

The allowed-host list from #12684 accepts IPv4 and bracketed IPv6 literals. The blocked-link card offers "Allow for this host" on a link to 10.0.0.5, and one click relaxes the query-length and base64 checks for that address. The add and revoke routes write SEL events, but nothing records when an allowed host actually restores a link.

Why it matters

An IP literal names one machine, often a loopback or private one where the reader's own control planes run, and an injected reply can aim a long-query link there. The OAuth endpoint extension, the other operator-trusted host list in exfil.py, already refuses IP literals. Without a use event, an operator reviewing the audit log can see that a host was allowed but not whether the allowance ever let a link through.

Not a goal

  • Adding hosts from Settings, or one list for the whole deployment. Those are a separate follow-up.

  • Applying the list outside the dashboard. Slack and other channels unfurl links with no click, and the list only allows a link to be opened on a click.

  • Checking what a host name resolves to. A DNS name that resolves to loopback or a private address, such as 127.0.0.1.nip.io, still passes the shape check. The card shows that name to the reader before they allow it, but nothing here refuses it on the address.

  • Changing which checks an allowed host skips. Credential, encoded-credential, decode-saturation and percent-encoding checks still run for every host.

  • Timing the use event to the frame the reader sees. The slot-detail memo fill renders the page a reader just opened and is audited, so its event can land a second before the link shows, never after.

What changed (motivation → approach → change)

_HOST_RE in redaction_allow.py matched IP literals and accepted any run of [a-z0-9._-]. It is now _OAUTH_EXTENSION_HOST_RE itself, which lives in exfil_oauth.py since the exfil split in #22158, the regex the OAuth endpoint extension already validates its hosts with, so the two operator-trusted host lists share one definition. The OAuth regex itself is unchanged. valid_host also refuses a name whose last label is localhost, because browsers send every *.localhost name to loopback without a lookup (RFC 6761 section 6.3); the refusal sits beside the shared regex, not in it, so the OAuth list's shape does not change. Beside it too, valid_host keeps main's 63-letter cap on the top-level label (MAX_TLD_LEN), because the shared regex leaves that label open-ended. allow_host refuses anything else. An off-shape entry already in hosts.json is dropped on load, so the file can never widen trust past what allow_host writes. The first load of a file in a process that drops entries logs one warning and writes one redaction.allowed_hosts.dropped_invalid SEL event with the exact count and up to 50 {workspace, host, reason} entries, so a narrowed list shows in the audit log.

RedactionCards.tsx carries a copy of that regex and of the .localhost refusal to hide "Allow for this host" when the server would refuse the host, and test_redaction_mirror_parity.py derives the expected copy from the backend regex and checks the suffix against redaction_allow.LOOPBACK_SUFFIX, so the two cannot drift. The hint is one new key in each website/src/i18n/locales/*.json catalog. In Allow's place the card says "Only a host name like example.com can be allowed. Use “Open once” instead." The wording covers every host the list refuses, an underscore name as well as an IP literal. Before this change the button was offered for an IP-literal host.

restore_allowed_links in exfil.py now writes one redaction_allowed_host_used SEL event per workspace and host per process when it puts a link back, naming the workspace, the host and the rules relaxed. It shares _log_operator_list_use in exfil_oauth.py with the OAuth extension's use event, and _PACKAGE_LINE_BUDGET in test_security_gate_liveness.py rises by 197, from 33,523 to 33,720. The workspace comes from the render's scoped_exempt_hosts scope, which the three render paths open with the slot's stored workspace key. A revoke forgets the host and bumps an epoch that wire_render._context_digest hashes, so a memoized render misses once and the next use after a re-allow is audited again. One lock, _ALLOWED_HOST_AUDIT_LOCK, guards the memo and the epoch. Each render reads allowed_host_audit_epoch() before allowed_hosts_for; if a revoke lands in between, the use is audited but not remembered. The save-time projection in display_verdicts.project runs under allowed_host_use_unaudited, so a render nobody reads writes no event. The event is best-effort and a failed write never blocks the restore. The memo holds at most _ALLOWED_HOST_AUDITED_MAX = 1024 pairs; past that a new pair is audited every time and not remembered.

The security argument is that this change only narrows what the list accepts and only adds audit records. No URL that was blocked before is let through. docs/system-specs/modules/security.md documents the host shape and the new event.

Backwards compatibility

Breaking: an IP-literal, underscore or *.localhost host saved in <config>/redaction-allow/hosts.json is no longer honoured, so links on it show as blocked again. Writer sweep on origin/main @ 770088c: allow_host is the only writer, reached only from api_redaction_allow_host, which validates with the same valid_host. A dropped entry is never honoured and Settings does not list it, and the load that drops it writes the redaction.allowed_hosts.dropped_invalid SEL event and a warning. revoke_host cannot target it, because it works from the filtered snapshot and returns False for a host that is not there. The entry stays as dead bytes in hosts.json until the next allow or revoke in any workspace, which rewrites the file from the filtered snapshot and removes it.

Release notes should say that a link host saved as an IP address, with _ in its name, or under .localhost is no longer allowed, and that the reader can use "Open once" or allow a DNS name for that machine instead.

Reader: src/kiro_crew/security/redaction_allow.py:allowed_hosts_for -- chat -- returns only valid hosts; test_a_dropped_entry_left_in_the_file_is_logged_and_audited_once
Reader: src/kiro_crew/security/redaction_allow.py:list_allowed -- crew page -- Settings list shows only kept hosts; same test
Reader: src/kiro_crew/dashboard/handlers/redaction.py:api_redaction_allow_host -- crew page -- returns 400 invalid_host for an IP literal; test_ip_literals_ports_and_wildcards_are_refused

Carried from #18180

This is #18180 by @Pearcekieser, carried on a repository branch with no behaviour change. #18180 comes from a fork, so its required Sensitive Change Review check cannot pass there. The one commit is #18180's head eb3dd59 cherry-picked onto main ac346e0 and later rebased onto 770088c, with Co-authored-by: the original author. The only conflict was the _PACKAGE_LINE_BUDGET line: the resolution keeps main's comment and adds this change's unchanged 197 lines, giving 33,720.

How each point of the request for changes on #18180 is handled:

  1. The in-flight render race. Fixed in the carried code: each render path reads allowed_host_audit_epoch() before allowed_hosts_for, and a use whose epoch no longer matches under _ALLOWED_HOST_AUDIT_LOCK is audited but not remembered. test_a_render_whose_snapshot_predates_a_revoke_is_not_remembered covers it.
  2. The Settings note for dropped hosts.json entries. Tracked in Pearcekieser/KiroCrew#52, linked under Related Issues.
  3. Human review for a change to which hosts are exempt from redaction. This PR is on a repository branch, so Sensitive Change Review can run here. It still needs a maintainer approval and a human security review before it merges.

Tests

  • test_ip_literals_ports_and_wildcards_are_refused covers 13 off-shape hosts: IPv4, IPv6, IPv4-mapped IPv6, a port, a wildcard, leading and trailing hyphens, an underscore, an empty label, a bare name and two *.localhost names. Each is refused by valid_host and allow_host.

  • test_a_dropped_entry_left_in_the_file_is_logged_and_audited_once checks that a hand-edited file with an IP literal, a .localhost name and a number keeps only its DNS entry, and that the load writes one warning and one SEL event naming all three with their reasons, not repeated when a write re-reads the file.

  • test_restoring_an_allowed_link_is_audited_once_per_host checks that an unlisted host logs nothing, that three restores in one workspace log one event with the workspace, host and rule, that the same host in a second workspace logs its own event, and that a revoke makes the next use log again.

  • test_a_re_allow_after_a_revoke_misses_the_memo_and_audits_again renders through wire_render.prepare_messages_json and checks one event per workspace, a memo hit on the second render, and a fresh event after a revoke. It fails on the previous head.

  • test_a_save_projection_audits_no_allowed_host_use runs display_verdicts.project on a row with an allowed link and checks it writes no event, then that the reader's render writes one. It fails without allowed_host_use_unaudited.

  • test_a_render_whose_snapshot_predates_a_revoke_is_not_remembered takes the epoch and hosts, revokes, then restores under that stale scope. It checks the link is shown and audited with the memo left empty, and that the first view after a re-allow is audited and remembered. It fails without the epoch check.

  • test_a_failing_audit_does_not_stop_the_restore checks that a raising audit log still restores the link.

  • MarkdownRenderer.blockedLink.test.tsx checks that cards for 10.0.0.5, [::1], my_box.corp.example and api.localhost render no Allow button and show the host-name hint, and that a DNS-host card shows no hint.

  • test_blocked_link_card_offers_allow_only_for_hosts_the_server_accepts pins the frontend regex and .localhost suffix to the backend ones.

  • Determinism: the four changed backend test files passed 5 runs in a row with -n 8, and once serially in reverse file order. With the production files reverted to main, 19 of their tests fail.

Proof: not provable -- other: prove.py cannot revert the binary screenshots in this diff; reverting the src/ files to main by hand fails 19 of these tests

Manual verification

website/scripts/capture-blocked-link-allow-host.mjs drives the built SPA with fixtures: one reply holds a blocked link on reviews.corp.example and one on 10.0.0.5. On main both cards had one Allow button. On this branch the DNS card has one, and the IP card has none and shows the host-name hint instead, in dark and light themes.

Screenshots / video

On main, the IP-host card offers Allow:

before, IP host

On this branch, the IP-host card has no Allow and says why:

after, IP host

after, IP host, light

On this branch, the DNS-host card keeps Allow:

after, DNS host

after, DNS host, light

Related Issues

Follows #12684.

Follow-up: Pearcekieser/KiroCrew#52 tracks a Settings note when a load drops saved hosts. Pearcekieser/KiroCrew#53 tracks writing the use audit when a background-filled fragment is first served rather than when it is rendered, from the GPT 6.1 finding on bc6fe06. Upstream issues here open together with their PR, so the upstream issue opens with that PR.

Sibling sweep

Swept: git grep -nE "allow_host(|hosts.json|_HOST_RE" -- src/
Sibling: src/kiro_crew/security/exfil_oauth.py -- changed here
Sibling: src/kiro_crew/apps/manifest_contributes.py -- not affected -- app manifest host list, not an operator redaction exemption

Pattern harvest

Rule candidate: review-prompt
Pattern: an operator-trusted host list whose host regex accepts IP literals or loose character runs instead of the shared DNS-name shape

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Fixes #18179

Supersedes #18180

Contribution License Agreement

Contributed under the project's Apache-2.0 license.

@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Sensitive Change Review

Sensitive files changed:

  • src/kiro_crew/security/exfil.py

  • src/kiro_crew/security/exfil_oauth.py

  • src/kiro_crew/security/redaction_allow.py

  • @bolichen97 comment: does not name the current head 9f770f2; post it again for this head

  • @iamwhatever: missing the ## Sensitive change review heading

How to clear this check:

  1. The PR author posts the template below as a PR comment, with
    every field filled (N/A needs a reason). Keep the
    Head commit line: it must name the current head SHA.
  2. The check turns green within a minute, with no push.
  3. A new push resets this check: post it again for the new head.

Only the author's comment counts this way. A reviewer can instead
paste the filled template into an "Approve" review on this head.
Merging still needs a reviewer's approval.

## Sensitive change review
- Head commit: 9f770f209dc6a641bb035536b2635f969f8aad06
- What rule changed:
- Before -> after (what was allowed/blocked, now):
- Worst case if wrong (breaks commands / leaks secret / locks user out):
- Evidence checked (which sandbox result proves it):
- No regression:
  - Tools still work (which tools/commands were run, result):
  - Backward compatible (old config / old data / old callers still work, how checked):
  - Existing tests (which suites passed on this head):
- How to undo:

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 31, 2026
@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 9f770f209dc6a641bb035536b2635f969f8aad06 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the change only narrows what the host list accepts and only adds audit records, and the readers it affects are listed with tests.

Notes

  • The revoke route (handlers/redaction.py:102) now returns 400 for an IP-literal host. That host is already dropped on load, so nothing breaks. The dead entry stays in hosts.json until some other allow or revoke rewrites the file, which the Breaking line already says.

[DESIGN-REVIEWED] 9f770f2

Description read

[DESCRIPTION-READ] 06f8f1b87d95ed160123b63cb5f6062fca9c4ee898d74dfad498c2f59b3aaae2

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 9f770f209dc6a641bb035536b2635f969f8aad06 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Every item either narrows what the allowed-host list accepts or adds an audit record. The use-audit memo, epoch and lock are there because the review on #18180 asked for the race fix.

What this change ships

Inventory (10 items) — 10 justified

Intent: stop one click on the blocked-link card from trusting an IP or loopback address, and let an operator see in the audit log when an allowed host put a link back on screen. FIX, with an audit addition that the Goal covers.

  1. Allowing an IP literal, an underscore name or a *.localhost host now fails with 400 — justified
  2. Entries of those shapes already in hosts.json are no longer honoured, so their links show as blocked again — justified
  3. The load that drops them logs one warning and writes a dropped_invalid SEL event — justified
  4. The card hides "Allow for this host" for a host the server would refuse and shows a "use Open once" hint — justified
  5. One hint string added to each i18n catalog — justified
  6. A link put back by an allowed host writes a redaction_allowed_host_used SEL event, once per workspace and host per process — justified
  7. Revoking a host makes its next use after a re-allow audited again (epoch, render-memo key, lock) — justified
  8. Save-time projections write no use event — justified
  9. The allowed-host list and the OAuth list now share one host regex and one SEL writer helper — justified
  10. A screenshot capture script and PNGs under temp-screenshots/, as the .gitignore convention says — justified

[FIRST-PRINCIPLES-REVIEWED] 9f770f2

Description read

[DESCRIPTION-READ] 38ae75c03b0085ac841c72717be7db80a0bc074d88f2514848f78feeea8d27f1

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of 9f770f209dc6a641bb035536b2635f969f8aad06 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing blocks. Screenshots 02 and 04 show the new note in place of the missing Allow button for an IP host, in both themes. The blind reader understood what the note means.

Notes

  • link_allow_unsupported: "Use “Open once” instead" points the reader at the action the Reason line just called risky, and the blind reader said they "would not click it". Make it conditional, for example "Only a host name like example.com can be allowed. If you trust this address, use “Open once”."

[UX-REVIEWED] 9f770f2

Description read

[DESCRIPTION-READ] 2f6726ae03d1c38e3da334c55bd12b8ca3af423d7f4432e0f9c0b9ee5406a816

That sha256 names everything this verdict read: the PR description, plus the 8 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 9f770f209dc6a641bb035536b2635f969f8aad06 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 9f770f2

Verdict parsed from the review's SHA-scoped output markers for commit 9f770f209dc6a641bb035536b2635f969f8aad06.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 9f770f209dc6a641bb035536b2635f969f8aad06 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 9f770f209dc6a641bb035536b2635f969f8aad06 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 9f770f2

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 9f770f209dc6a641bb035536b2635f969f8aad06 false-positive: <reason, 20 to 500 characters>

@bolichen97
bolichen97 enabled auto-merge (squash) October 31, 2026 13:39
@bolichen97

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: ae76c47
  • What rule changed: the allowed link host list in redaction_allow.py now takes only lowercase DNS names (the OAuth extension host regex, no *.localhost, top label up to 63 letters), and each use of an allowed host writes one SEL event per workspace and host per process.
  • Before -> after (what was allowed/blocked, now): before, an IPv4 literal, a bracketed IPv6 literal, an underscore name or a *.localhost name could be allowed and then skipped the query-length and base64 checks on a click. After, those hosts are refused on add and dropped on load, so their links stay blocked. DNS names behave as before, and a restore through an allowed host is now audited.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): a valid DNS host could be refused, so a reader sees a blocked link and uses "Open once" instead. Nothing that was blocked before is let through, so no secret can leak through this change.
  • Evidence checked (which sandbox result proves it): test_ip_literals_ports_and_wildcards_are_refused refuses 13 off-shape hosts, test_a_dropped_entry_left_in_the_file_is_logged_and_audited_once checks the load drop and its SEL event, and with the src files reverted to main 19 of the changed tests fail.
  • No regression:
    • Tools still work (which tools/commands were run, result): 1674 backend tests in the 55 exfil, redaction, wire render, transcript and security gate files passed, plus 163 frontend tests in the blocked link and i18n suites.
    • Backward compatible (old config / old data / old callers still work, how checked): DNS hosts in an old hosts.json load unchanged; IP, underscore and *.localhost entries are dropped with a warning and one SEL event, covered by the drop test above. allow_host is the only writer, checked by a grep on this head.
    • Existing tests (which suites passed on this head): test_redaction_allow.py, test_redaction_mirror_parity.py, test_security_gate_liveness.py, test_slot_render_context_key.py, test_display_verdicts.py, all passing, five repeated runs green.
  • How to undo: revert this one commit; saved DNS hosts keep working and no data migration is needed.

@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Security Scope Review -- ✅ PASS

Which legitimate operations does 9f770f209dc6a641bb035536b2635f969f8aad06 newly refuse? Updated in place on each push. A script-confirmed regression blocks; the model proposes candidates and never decides a refusal.

Verdict basis: adjudicated, zero confirmed regressions.

Security scope review -- adjudicated candidates

  • macos-latest (platform posix): 10 classified, 0 newly refused, 10 still allowed.
  • ubuntu-latest (platform posix): 10 classified, 0 newly refused, 10 still allowed.
  • windows-latest (platform windows): 4 classified, 0 newly refused, 4 still allowed.

No candidate flipped from allowed to refused.

Scope-Verdict: PASS

Reason: This change tightens the dashboard's allowed-host validator (redaction_allow._refusal / valid_host, plus _load dropping entries). That validator is not part of the shell deny composite. The shell-side edits in exfil.py and exfil_oauth.py only add audit scope and a shared SEL helper, and change no verdict. No shell regression can come from this change, and the validator gap is named under UNADJUDICATED rather than claimed as a pass.

TIGHTENING: the allowed-host list's host-shape validator -- it refuses IP literals and *.localhost names as "Allow for this host" entries, because those name the reader's own or a private machine. Hunk: -_HOST_RE = re.compile(r"^(?:[a-z0-9._-]{1,253}\.[a-z]{2,63}|\d{1,3}(?:\.\d{1,3}){3}|\[[0-9a-f:.]{1,45}\])$") → +_HOST_RE = _OAUTH_EXTENSION_HOST_RE with + if host.endswith(LOOPBACK_SUFFIX):\n+ return "loopback_name", and the matching isAllowableHost gate in RedactionCards.tsx.

ADJUDICATED: 14 candidates, 0 confirmed newly-refused

PLATFORM COVERAGE: Candidates cover posix and windows. The diff adds no path, separator, interpreter or environment assumption to any shell tier. The only platform-shaped code it touches is the allowed-hosts file load, which goes through config_dir() and is unchanged. So the posix/windows pairs probe the shell spellings the touched area actually uses:

  • running the touched tests (test/… and test\…);
  • the screenshot script (/ and \ separators);
  • querying the local dashboard (curl and curl.exe);
  • reading the allowed-hosts file ($HOME and %USERPROFILE%).

The rule this change tightens is a host-shape rule with no platform dependence, so no platform assumption is left unprobed.

UNADJUDICATED:

  • Guard: redaction_allow._refusal (called by valid_host, allow_host, and _load on every list read), plus its frontend mirror isAllowableHost in website/src/components/RedactionCards.tsx.
  • Call path:
    • For adding a host: an owner clicks "Allow for this host" on a blocked-link card. The card shows that button only when isAllowableHost(record.domain) passes. The click sends POST /api/redaction/allowed-hosts {slot, host} (behind require_owner_dashboard_request), which calls redaction_allow.allow_host → valid_host, and answers 400 invalid_host on refusal.
    • For hosts already saved: _load(path) → _refusal(h) drops the entry and reports redaction.allowed_hosts.dropped_invalid. Display then goes through allowed_hosts_for → scoped_exempt_hosts → restore_allowed_links.
  • Narrowing, argued but not confirmed:
    • Hosts the old regex accepted and the new one refuses lose their allowance. Already-saved entries are silently dropped from the file on load, with a warning and an audit event.
    • The newly refused shapes:
      • IPv4 and bracketed-IPv6 lab or intranet servers (e.g. 10.0.0.5);
      • DNS names with an underscore label (e.g. my_box.corp.example, still common in some internal DNS);
      • names with empty or edge-hyphen labels;
      • dev hosts on *.localhost.
    • The diff names this loss on purpose: the card offers "Open once" instead, and the tests pin it. The underscore-label case is the one I can't tie to the named threat (loopback/private machines). It's a real internal-DNS name that loses Allow only because the OAuth regex is shared.
  • Inputs I would have submitted to this guard:
    • my_box.corp.example
    • build_01.ci.internal.example
    • 10.0.0.5
    • 192.168.1.20
    • [fd00::5]
    • api.localhost
    • wiki.example.org (control, should stay accepted)
    • reviews.corp.example (control)
    • xn--bcher-kva.example (an IDN punycode name, should stay accepted)
    • WIKI.EXAMPLE.ORG (upper case: the card lowercases it but the server regex is lowercase-only, so a parity gap is possible if a record's domain arrives in mixed case)

[SCOPE-REVIEWED] 9f770f2

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 31, 2026
… use

The allowed-host list accepted IPv4 and bracketed IPv6 literals and
underscores. An address names one machine, often a loopback or private
one, rather than a site the reader vouches for. The host check now takes
lowercase DNS names with a letter TLD only; an off-shape entry already in
the file is dropped on load, and the blocked-link card offers no Allow for
such a host.

Adds and revokes were audited, use was not. restore_allowed_links now
writes one redaction_allowed_host_used SEL event per host per process
when an allowed host puts a blocked link back on screen.

Also: one DNS-host regex for both operator lists; explain a missing Allow.

The allowed-link-host list now validates against exfil._OAUTH_EXTENSION_HOST_RE,
unchanged from main, instead of its own copy, and also refuses *.localhost
names, which browsers send to loopback without a lookup (RFC 6761 6.3). The
refusal sits in valid_host and the card's isAllowableHost, so the OAuth list's
shape is unchanged. A parity test pins the card's copy of both. A card whose
host the list refuses says why where Allow would sit.

A load that drops saved entries now logs one warning and writes one
redaction.allowed_hosts.dropped_invalid SEL event per file per process. The
use event names the render scope's workspace and its memo is keyed by
(workspace, host); a revoke forgets the host and bumps an epoch the
render memo keys on, so a re-allowed host is audited again. One lock guards
that memo, so a revoke and a render cannot race on it. Both operator-list events share
one SEL helper, the per-process audit memo has a count ceiling, and the
security package line budget records the growth.

After the exfil split in #22158, the shared SEL helper _log_operator_list_use
lives in exfil_oauth beside the OAuth use event, and the facade imports it.

The save-time display-verdict projection restores links under
allowed_host_use_unaudited, so a render nobody reads writes no use event
and leaves the memo for the reader's first real view.

Allowed link hosts keep the 63-letter cap on the top-level label, beside
the shared regex, as the list did before it shared that regex.

Carried from #18180 on a repository branch so the change can take a
human security review.

Co-authored-by: Pearce Kieser <5055971+Pearcekieser@users.noreply.github.com>
@bolichen97
bolichen97 force-pushed the fix/redaction-hosts-18180 branch from ae76c47 to 9f770f2 Compare October 31, 2026 18:57
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 31, 2026
@bolichen97
bolichen97 merged commit 817316f into main Oct 31, 2026
101 of 111 checks passed
@bolichen97
bolichen97 deleted the fix/redaction-hosts-18180 branch October 31, 2026 20:22
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 31, 2026
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.

Allowed link hosts accept IP literals, and their use is never audited

2 participants