Skip to content

fix(validate): do not read a mount's own path in the ownership table as a project-code leak - #118

Merged
pasrom merged 1 commit into
mainfrom
fix/ownership-gate-leak
Nov 27, 2026
Merged

pasrom merged 1 commit into
mainfrom
fix/ownership-gate-leak

Conversation

@pasrom

@pasrom pasrom commented Nov 27, 2026 •

Copy link
Copy Markdown
Owner

In a brain with project_prefix, a mount inside a project folder (for example projects/acme01/manual) puts its path into the generated table of ## Ownership in CONVENTIONS.md. The code-leak scan then reported gate-leak:code on CONVENTIONS.md, so upgrading such a brain to 1.27.0 fails validate.

The code scan of CONVENTIONS.md now blanks one cell per mount: the Mount cell km writes inside the generated block, for a path under project_prefix that is a gitlink in the index (so it names its own project folder, as .gitmodules does). Everything else is scanned as before: the other cells of the generated table (url, branch, km-owns), a row for a path that is no mount, a code hand-written into the block, the hand-written topics table and all text outside the markers. The secret and term scans are unchanged.

An automated security review flagged the first version, which skipped the whole generated block (a hand edit between the markers would have bypassed the scan); this version blanks only the exact cells.

Tests

gate_smoke, with a real submodule at projects/acme01/manual:

  • its path in the generated table passes;
  • a code hand-written into a cell of the generated table is still blocked;
  • a row for a path that is no mount is still blocked;
  • a code next to the table is still blocked.

Mutation: without the blanking the first case fails. gate 397/0, ownership 44/0, index 82/0, team 285/0 locally.

@pasrom
pasrom force-pushed the fix/ownership-gate-leak branch from 4feb43d to 156e559 Compare November 27, 2026 21:11
@pasrom pasrom changed the title fix(validate): do not read the generated ownership table as a project-code leak fix(validate): do not read a mount's own path in the ownership table as a project-code leak Nov 27, 2026
@pasrom
pasrom merged commit 3b54a57 into main Nov 27, 2026
5 checks passed
@pasrom pasrom mentioned this pull request Nov 27, 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.

1 participant