Public: anyone can read this; the crew can change it.

Issue search leaves out sealed security reports for a reader who may not see them #15006

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

searchIssuesVisibleTo (src/core/issues.ts) no longer returns sealed security reports. Before this change it filtered only by whether the viewer could read the repository. That meant anyone who could read a public repository, signed-out readers included, could find a sealed report by searching its title.

Notes

shipped production is serving it deploy 6dfa34b

opened this

searchIssuesVisibleTo (src/core/issues.ts) no longer returns sealed security reports. Before this change it filtered only by whether the viewer could read the repository. That meant anyone who could read a public repository, signed-out readers included, could find a sealed report by searching its title. No code calls the function today, so nothing was exposed yet. The finding was that a search box wired to it would leak these titles.

The fix adds AND issue.sealed = 0 to the query, the same default listIssues applies. Sealed rows are left out for every viewer. Who may see a sealed report depends on the repository (sealed.ts), and a search across all repositories has no per-repository rule to apply. Writers and the crew still see sealed reports in the repository's own issue list. I chose not to carry sealedBy/writer scoping into this cross-repository query, so the fix stays one line. The function's other answers are unchanged: the existing tests for private repositories, empty queries and wildcards pass as before.

Ticks in #14777:

Test: test/scale.test.ts adds "search leaves out a sealed security report on a repo the viewer can read". It files a sealed report on a public repository and checks that searching for its title returns nothing, both for another signed-in user and for a signed-out viewer. It also checks that a normal issue in the same repository is still found. Against today's main it fails, with 1 hit where 0 were expected.

Checks run here: bun scripts/gate.ts --fix (nothing to rewrap), bun x tsc --noEmit, and bun test test/scale.test.ts test/sealed-issues.test.ts test/sealed-predicates.test.ts all pass (51 tests). scripts/fast.ts named 3329 test files for this diff, far too many to run here, so I ran these three covering files instead. The forge's check runs the full suite on this push.

No open pull already carried this finding.

🤖 Generated with Claude Code

Closes #14994

commented

searchIssuesVisibleTo (src/core/issues.ts) no longer returns sealed security reports. Before this change it filtered only by whether the viewer could read the repository. That meant anyone who could read a public repository, signed-out readers included, could find a sealed report by searching its title. No code calls the function today, so nothing was exposed yet. The finding was that a search box wired to it would leak these titles.

The fix adds AND issue.sealed = 0 to the query, the same default listIssues applies. Sealed rows are left out for every viewer. Who may see a sealed report depends on the repository (sealed.ts), and a search across all repositories has no per-repository rule to apply. Writers and the crew still see sealed reports in the repository's own issue list. I chose not to carry sealedBy/writer scoping into this cross-repository query, so the fix stays one line. The function's other answers are unchanged: the existing tests for private repositories, empty queries and wildcards pass as before.

Ticks in #14777:

Test: test/scale.test.ts adds "search leaves out a sealed security report on a repo the viewer can read". It files a sealed report on a public repository and checks that searching for its title returns nothing, both for another signed-in user and for a signed-out viewer. It also checks that a normal issue in the same repository is still found. Against today's main it fails, with 1 hit where 0 were expected.

Checks run here: bun scripts/gate.ts --fix (nothing to rewrap), bun x tsc --noEmit, and bun test test/scale.test.ts test/sealed-issues.test.ts test/sealed-predicates.test.ts all pass (51 tests). scripts/fast.ts named 3329 test files for this diff, far too many to run here, so I ran these three covering files instead. The forge's check runs the full suite on this push.

No open pull already carried this finding.

🤖 Generated with Claude Code

Approved

One-line fix, matches listIssues default (issue.sealed = 0), regression test covers signed-in and signed-out viewers plus a neighbour that still answers. No page/TUI surface (function has no caller), so no preview behaviour or docs apply. Next: (1) when a search box is wired to this, decide whether writers should find sealed reports in it, scoped per repo via sealed.ts, with its own test; (2) add a test that a writer/crew viewer also gets nothing, so the intent is pinned.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs