8000 plannotator: pkgscan-allow the 0.28.x CredentialAccess findings (one group is an accepted real capability) by bryan-minimal · Pull Request #1265 · gominimal/pkgs · GitHub
[go: up one dir, main page]

Skip to content

plannotator: pkgscan-allow the 0.28.x CredentialAccess findings (one group is an accepted real capability) - #1265

Merged
bryan-minimal merged 1 commit into
mainfrom
pkgscan-allow-plannotator
Nov 3, 2026
Merged

bryan-minimal merged 1 commit into
mainfrom
pkgscan-allow-plannotator

Conversation

@bryan-minimal
Copy link
Copy Markdown
Member

Adds packages/plannotator/pkgscan-allow.toml so that the plannotator 0.27.16 -> 0.28.x bot update can ship. Today's run (2026-11-02T17:13Z, update_outcome = failed, reason "pkgscan Critical — needs --allow-critical-pkgscan to publish") aborted on 29 gating CredentialAccess findings across 11 files. This PR adds one hash-pinned entry per file.

Important

Not every entry is a false positive. The two entries for package-changes-service.ts and package-metadata.ts allowlist a real, accepted capability. The shipped binary reads ~/.npmrc at runtime. Bryan, who maintains this recipe, accepted it as intended behaviour: "the tool is meant to do those things, so people understand". The other nine entries are false positives.

The accepted capability

  • It ships. build.sh compiles apps/hook/server/index.ts, which imports @plannotator/server/review, which uses @plannotator/shared/package-changes-service. That code is in the plannotator binary.
  • What it reads. When a reviewed diff has package.json or lockfile changes, it reads ~/.npmrc (or $npm_config_userconfig), npm's global npmrc and the reviewed repo's .npmrc, plus the Yarn and Bun equivalents.
  • It is on by default. You can opt out with PLANNOTATOR_PACKAGE_LOOKUP=0.
  • What it does with the contents. readNpmrc() keeps only registry= and @scope:registry= lines, so an _authToken line never matches. The result is used only to decide which package names to withhold from the npm lookup. That lookup is opt-in (config.json packageChanges.lookup, default false) and only ever contacts re 8000 gistry.npmjs.org and api.npmjs.org; a test override is accepted for loopback addresses only. Nothing read from the files leaves the machine.
  • Where it came from. Added by the maintainer in c0010c8, "feat(review): package changes under package.json and lockfile diffs", 2026-10-26.

Findings

These are from the production image (pkgmgr:0b705d3-sc2e851aa) running pkgscan diff plannotator --old 0.27.16 --new 0.28.44 in Cloud Build. Every file was read in context from the upstream tag.

file:line pattern severity verdict
packages/shared/package-changes-service.ts:138 .npmrc High ACCEPTED REAL CAPABILITY. The list of settings files read in each directory
packages/shared/package-changes-service.ts:160 .npmrc High ACCEPTED REAL CAPABILITY. join(home, ".npmrc")
packages/shared/package-changes-service.ts:16 .npmrc High FP. A JSDoc comment in the same file, covered by the same entry
packages/shared/package-metadata.ts:257 .npmrc High ACCEPTED REAL CAPABILITY. Parses the npmrc text (registry= lines only)
packages/shared/doc-resolve.ts:172 .ssh/id_ Critical FP. A JSDoc comment describing a symlink that is refused. Added in 311b283
apps/vscode-extension/src/guides/safe-path.ts:4, :36 .aws/credentials Critical FP. JSDoc comments, in the VS Code extension, which is not compiled or shipped. Added in 16c8ee2
packages/server/doc-any-path.scenarios.ts:12, :186, :190, :243 .ssh/id_ Critical FP. A security test: it writes a decoy SECRET-SSH-KEY into a temp HOME (process.env.HOME = <makeTempDir>/home) and asserts the server refuses to serve it. Line 12 is JSDoc. Added in 96e4a36
packages/server/reference-readers.scenarios.ts:149, :153 .ssh/id_ Critical FP. The same decoy pattern, in a temp HOME. Added in a92e3eb
packages/server/inbox-attachments-kinds.test.ts:324 .docker/config.json Critical FP. The test asserts that a 127.0.0.1 test server does not serve the path (404). Added in f742bd5
packages/core/inbox-actions.test.ts:147 (line 133 is already Info) .ssh/id_ Critical FP. An expected string containing ssh-copy-id … instruction text in a markdown-parser test. Added in 94a4709
packages/shared/package-metadata.test.ts:7 .npmrc High FP. An inline npmrc string with a placeholder _authToken=x; no file is read. Added in c0010c8
packages/server/package-changes-endpoint.test.ts:12, :14, :91, :98, :99, :186 .npmrc High FP. Fixture .npmrc files written into mkdtempSync repos; lines 12 and 14 are comments. Added in c0010c8
packages/shared/package-changes-service.test.ts:111, :113, :134, :143, :280, :286, :315 .npmrc High FP. Fixture and in-memory npmrc sources (home: tempDir()). Added in c0010c8 and e92b102
  • Tests are not shipped or run. build.sh runs bun install, the two UI builds and bun build --compile on the hook server. It runs no tests, and no test or scenario file is imported by the compiled entrypoint.
  • Authors. Every introducing commit is by the maintainer (backnotprop).

Versions and hashes

  • Versions checked. The run proposed 0.28.44. Upstream has since released v0.28.45 and v0.28.46 (16:55Z today), so the next run may propose either one.
  • The hashes hold for all three. All 11 flagged files are byte-identical in v0.28.44, v0.28.45 and v0.28.46; I recomputed each with shasum -a 256. A second production pkgscan diff 0.27.16 -> 0.28.46 gives exactly the same 30 findings and hashes.
  • Coverage. The 11 entries cover every gating (file, category, pattern, sha256) key, with none missing and none extra. Every entry passes the parser's rules.
  • What a match does. A matched Critical drops to Medium, which stays visible in the PR's warning block. A matched High drops to Info.

After merge

The plannotator update must be re-triggered by hand. The package has been parked in a failed action state since 10-31, so the nightly run won't pick it up by itself. Use the Slack upgrade button, or run pkgmgr update --package=plannotator --create-pr. The allowlist is read when the gate runs, so that run re-scans and regrades these findings. If any listed file changes in a later release, its hash stops matching and the finding gates again.

The CODEOWNERS change for pkgscan-allow.toml (#1113) is still open, and its self-approval deadlock applies to this PR too. The agent did not merge or approve this PR.

🤖 Generated with Claude Code

The 0.27.16 -> 0.28.44 bot update aborted on 2026-11-02 with 29 gating
CredentialAccess findings across 11 files. Each file gets one hash-pinned
entry.

Two entries are an ACCEPTED REAL CAPABILITY, not false positives:
package-changes-service.ts and package-metadata.ts make the shipped binary
read ~/.npmrc (plus the global and project npmrc) at runtime, by default,
when a reviewed diff has package changes. It parses only `registry=` lines
and uses them only to decide which names to withhold from the opt-in
registry.npmjs.org lookup. Bryan accepted this as intended behaviour of a
code-review tool.

The other nine are false positives: JSDoc comments, security tests that
write decoy credentials into a temp HOME, and the VS Code extension, which
build.sh does not compile.

Hashes match v0.28.44, v0.28.45 and v0.28.46 (the files are identical),
and a production pkgscan diff to 0.28.46 gives the same findings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bryan-minimal
bryan-minimal requested a review from a team as a code owner November 2, 2026 17:40
@coderabbitai
coderabbitai Bot commented Nov 2, 2026
Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 1 billable file and costs up to $0.25.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 2 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 75 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 4613142 and 54e6641.

Files selected for processing: 1
  • packages/plannotator/pkgscan-allow.toml
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@mitodrummer mitodrummer left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked all 11 pinned sha256 values against the v0.28.44 and v0.28.46 tag archives, and every one matches. I read each flagged line in context. The nine false positives are JSDoc comments, the VS Code extension (build.sh never compiles it), or tests that write decoys into a temp HOME and assert that nothing is served. I also checked that no shipped file imports them. For the two accepted-capability entries, I confirmed in package-changes-service.ts and package-metadata.ts that the ~/.npmrc read happens only when PLANNOTATOR_PACKAGE_LOOKUP is not 0, that readNpmrc() keeps only registry= lines, and that the result only decides which names are withheld from the opt-in npmjs.org lookup. Approving accepts that runtime read as intended behaviour.

@bryan-minimal
bryan-minimal added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 8aa23b3 Nov 3, 2026
13 checks passed
@bryan-minimal
bryan-minimal deleted the pkgscan-allow-plannotator branch November 3, 2026 00:22
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.

2 participants

0