Skip to content

fix(publish-gate): fold more obfuscations in normalize() #8811

Description

@kyle-sexton

Problem

normalize() in lib/publish-gate.mjs (lines 60-66) folds a few obfuscations and misses others. A credential survives the gate, and fix-ci's leak-scan, which reads the same patterns, when it is written with:

  • Unicode compatibility forms, or zero-width characters and soft hyphens inside it (no NFKC, no stripping)
  • JSON \uXXXX escapes (not decoded)
  • nested tags or entities (folding runs once)
  • single backslashes (only doubled ones are folded)
  • a line break, or a split across two sources (see fix(publish-gate): match a credential split across a line break #8806)

(Lines moved: normalize is now at :66-73. The leak-scan loads lib/publish-gate.mjs from the default branch, .github/workflows/pr-run-activity-read.yml:1865, so a lib/ change covers it with no .github change.)

Proposal

Extend normalize(): NFKC, strip zero-width characters and soft hyphens, decode \uXXXX, fold tags and entities until the text stops changing, and fold single backslashes. Measure false positives against the tracked tree and the test fixtures before adopting each step.

Out of scope for any pattern scanner: base64, hex and reversed encodings.

Context

Gaps shared by the gate and the fix-ci leak-scan; none blocks fix-ci's move to the launcher. To be weighed in the #8282 review, beside #8806.

Done when

  • normalize() applies NFKC, strips zero-width characters and soft hyphens, decodes \uXXXX, folds tags and entities to a fixpoint, and folds single backslashes. Check: the PR's CI runs lib/publish-gate.test.sh and it passes.
  • lib/publish-gate.test.mjs has one case per new fold that detects an obfuscated credential, each failing before the change. Check: as above.
  • False positives are measured before each step is adopted, as a committed test: every file in git ls-files outside the test-fixture paths that findSecret and findMachine pass today still passes after the change. A step that adds a hit there is dropped, with the reason in the PR body. Check: as above.
  • scripts/sync-shared-copies.sh regenerates plugins/review/lib/publish-gate.mjs and plugins/visualization/lib/publish-gate.mjs (scripts/shared-copies.txt:455-456), with fragments from scripts/new-changelog-fragment.sh --carriers-of lib/publish-gate.mjs patch. Check: the PR's CI runs the shared-copy sync check and scripts/check-changelog-fragments.sh --check, and both pass.
  • The line-break fold is fix(publish-gate): match a credential split across a line break #8806, which lands after this or in the same PR. A split across two sources stays open: neither this issue nor fix(publish-gate): match a credential split across a line break #8806 covers it.
  • base64, hex and reversed encodings stay out of scope.

Activity

  1. github-actions commented on Oct 21, 2026

    @github-actions
    Contributor

    Proposed work class: work-class: scoped
    Basis: automated intake triage; the lanes App applied this class.

    Size: Medium
    Complexity: Medium
    Uncertainty: Known
    Flags: none
    Blocked by: none

    Decision recorded.

    The gaps are still on origin/main: normalize() (lib/publish-gate.mjs:67-73) removes tags once, decodes entities and folds only doubled backslashes. That gate decides what a view may publish (lib/publish-gate.mjs:2-6), so this is a secret-leak gap, not hardening deferred under §10. base64, hex and reversed encodings stay out of scope, and the line-break fold stays with #8806. Agents decided this on evidence under standing direction §1.

    [quote truncated; the full decision is at the link]

    #8811 (comment)

    This decision settles the open questions. I understood the request as extending normalize() with NFKC, zero-width and soft-hyphen stripping, \uXXXX decoding, a fixpoint fold of tags and entities, and single-backslash folding. It also covers the tests, the false-positive measurement and the shared-copy sync. #8806 is related but not a duplicate. I changed the priority from low to medium because this closes a leak gap in the publish gate.

    Automated triage, applied by the lanes App.

  2. added
    needs-human
    on Oct 21, 2026
  3. added
    status: confirmed
    and removed
    needs-human
    on Oct 22, 2026
  4. kyle-sexton commented on Oct 31, 2026

    @kyle-sexton
    MemberAuthor

    Decision recorded.

    The gaps are still on origin/main: normalize() (lib/publish-gate.mjs:67-73) removes tags once, decodes entities and folds only doubled backslashes. That gate decides what a view may publish (lib/publish-gate.mjs:2-6), so this is a secret-leak gap, not hardening deferred under §10. base64, hex and reversed encodings stay out of scope, and the line-break fold stays with #8806. Agents decided this on evidence under standing direction §1.

    Done when

    • normalize() applies NFKC, strips zero-width characters and soft hyphens, decodes \uXXXX, folds tags and entities to a fixpoint, and folds single backslashes. Check: the PR's CI runs lib/publish-gate.test.sh and it passes.
    • lib/publish-gate.test.mjs has one case per new fold that detects an obfuscated credential, each failing before the change. Check: as above.
    • False positives are measured before each step is adopted, as a committed test: every file in git ls-files outside the test-fixture paths that findSecret and findMachine pass today still passes after the change. A step that adds a hit there is dropped, with the reason in the PR body. Check: as above.
    • scripts/sync-shared-copies.sh regenerates plugins/review/lib/publish-gate.mjs and plugins/visualization/lib/publish-gate.mjs, with fragments from scripts/new-changelog-fragment.sh --carriers-of lib/publish-gate.mjs patch. Check: the PR's CI runs the shared-copy sync check and scripts/check-changelog-fragments.sh --check, and both pass.
  5. removed
    status: confirmed
    on Oct 31, 2026
  6. added
    status: ready
    admission-deferred
    agent-ready
    and removed
    admission-deferred
    on Oct 31, 2026
  7. github-actions commented on Oct 31, 2026

    @github-actions
    Contributor
    No description provided.
  8. github-actions commented on Oct 31, 2026

    @github-actions
    Contributor
    No description provided.
  9. melodic-automation-lanes commented on Oct 31, 2026

    @melodic-automation-lanes
    Contributor

    The work-resolve-issue lane stopped on this issue (patch-apply-failed): apply-issue-patch failed before it committed or refused the patch, a job fault.
    It keeps agent-ready, and work-unblock starts it again (retry 1 of 2).

    In the run's words:

    The run reported done, but apply-issue-patch did not commit its patch (patch-apply-failed): apply-issue-patch failed before it committed or refused the patch. The run's log names the path or check.

    Run: https://github.com/melodic-software/claude-code-plugins/actions/runs/41186170380

  10. added
    agent-ready
    and removed
    agent-ready
    on Oct 31, 2026
  11. github-actions commented on Oct 31, 2026

    @github-actions
    Contributor
    No description provided.
  12. github-actions commented on Oct 31, 2026

    @github-actions
    Contributor
    No description provided.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readystatus: ready

    Type

    Fields

    No fields configured for Task.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions