Skip to content

Security sweep — 2026-W42 #7

Closed as duplicate
Closed as duplicate

Description

@srmcguirt

Automated weekly security sweep for fellwork/kindly-note (default branch main, public bun/TS monorepo — a typed ESM-only fork of highlight.js). GitHub access limited to mcp__github__* tools (no gh CLI, no raw REST) — see "Not checked" below.

CRITICAL

None requiring immediate escalation. 4 critical-severity dependency advisories were found (see §2) but all trace to dev/test tooling (vitest, happy-dom, tinypool), never shipped in the published @kindly-note/* npm packages — not an active production exposure, but flagged because they are RCE/prototype-pollution-class and local dev machines + CI runners are a real target.

1. Alerts & settings — KNOWN GAP (informational)

Dependabot alerts, code-scanning alerts, secret-scanning alerts, security_and_analysis, branch-protection/ruleset detail, and Actions permissions settings were not checked this run — no available mcp__github__* tool covers these REST endpoints, and raw gh/curl was out of scope. Recommend a human spot-check the Security tab.

2. Dependency audit — bun audit

27 advisories (4 critical, 14 high, 9 moderate) — up from last week's 23 (2/13/8). New/notable:

Package Severity Issue Path
tinypool <2.1.2 Critical ×2 Prototype-pollution gadget in worker options → RCE @kindly-note/*-every-package > vitest > tinypool
happy-dom <20.0.0 Critical VM Context Escape → RCE @kindly-note/browser, @kindly-note/auto-detect > vitest
vitest <3.2.6 Critical Vitest UI server: arbitrary file read and execute direct devDependency, nearly every workspace package
happy-dom High fetch-credentials cross-origin cookie leak; unsanitized export names interpolated as executable code same as above
js-yaml <3.15.x/<4.3.2 High ×4 quadratic-CPU DoS via merge-key chains / !!omap resolution (incl. CVE-2026-59870 backport gap) @changesets/cli > @manypkg/get-packages > read-yaml-file > js-yaml
braces <=3.0.3 High stack-exhaustion DoS on deeply nested patterns lint-staged, @changesets/cli chains
nanoid <3.3.18 High custom/non-secure generators loop indefinitely (DoS) vitest > vite-node > vite > postcss > nanoid
postcss/source-map-js/vite High path traversal / arbitrary .map disclosure same vitest chain
@vitest/mocker Moderate path traversal / arbitrary file read via mock redirect vitest
esbuild Moderate dev server accepts any-origin requests vitest chain
sprintf-js Moderate unbounded-precision DoS @changesets/cli chain

All 27 advisories trace through vitest/happy-dom/tinypool/@changesets/cli/lint-staged — confirmed devDependencies in root package.json — never shipped in the published packages. Not fixed (report-only, no version-bump PRs). No Cargo.lock in this repo — Rust audit N/A.

3. Workflows

  • ci.yml: missing a top-level permissions: block. Triggers on pull_request; actions/checkout@v4 defaults to persist-credentials: true, not overridden — public repo, no secrets used in this workflow, low practical impact but a real hardening gap. Actions pinned by tag, not SHA (actions/checkout@v4, oven-sh/setup-bun@v2).
  • release.yml: triggers on push to main only — never pull_request/pull_request_target, so no untrusted-PR-input exposure for the NPM_TOKEN-using step. Already declares its own permissions: block (contents: write, pull-requests: write, id-token: write) required by changesets/action@v1 — correctly scoped for its job; left untouched (release/publish logic explicitly out of scope). NPM_TOKEN is written to ~/.npmrc via the standard npm-auth pattern (Actions auto-masks secret values in logs) — not a bug, but per the workflow's own comment it's an "Automation"-type token that bypasses 2FA; worth periodic human rotation awareness.
  • changesets/action@v1 is the highest supply-chain exposure surface in this repo's workflows: a third-party action pinned by tag (not SHA) running with contents: write + pull-requests: write and NPM_TOKEN in its environment. A compromised/retagged v1 could exfiltrate the publish token or push arbitrary commits. Reported only — SHA-pinning it would touch the release workflow, out of scope per the "never touch publishing/release-workflow logic" rule even for a pin.
  • No pull_request_target anywhere. No ${{ github.event.* }} interpolated into any run: step.

4. Repo settings

5. Code grep

  • No hardcoded secrets, no eval(/new Function(, no child_process/Bun.spawn calls (none found anywhere under packages/), no tracked .env*, no wrangler.toml/fly.toml (not applicable to this repo), no hardcoded non-org fetch() URLs in build/tooling scripts, no SQL/RLS patterns (pure npm workspace, no database), no real-looking third-party mail/PII in fixtures or test data.
  • innerHTML = sink, re-confirmed: packages/browser/src/highlight-element.ts:254 (setMarkup()). Code comments document the assigned value as pre-escaped by @kindly-note/emitters-html ("Engine-emitted markup is HTML-escaped... writing it through the DOM is the do-not-break contract from upstream Scout §11"). Confirmed the escape module exists and is imported by the emitter package; did not independently trace every emitter code path for 100% coverage this run. — Low: a single, well-commented, intentional sink; a future escaping regression in emitters-html would turn this into a stored-XSS-class sink with no second gate downstream. Recommend a regression test asserting no raw <script>/event-handler markup ever reaches this call.
  • New this run — design-level note, not a confirmed in-repo vulnerability: packages/loader-dynamic-import/src/index.ts (createDynamicImportLoader) resolves a caller-supplied language identifier to a dynamic import() specifier. defaultResolveSpecifier() passes the identifier verbatim as the specifier whenever it starts with @ or contains /, otherwise prefixes it to @kindly-note/lang-${identifier}. No call site within this repo feeds untrusted input to it (only test stubs and the package's own default). But it is a public, documented API (resolveSpecifier/importer options) intended for host applications to wire up — if any downstream consumer feeds an untrusted/user-authored value (e.g., a note's code-fence language tag) directly into loader.load() without an allowlist, it becomes a dynamic-module-load injection surface (importing an arbitrary installed package, or in some bundlers/runtimes an arbitrary path). Medium/informational — worth a one-line callout in this package's README/docs warning integrators to only pass allowlisted language identifiers, never raw user content.

6. Severity ranking

Mechanical PR

No new PR opened this run. PRs #4 (claude/kindly-note-security-2026-W38) and #5 (claude/kindly-note-security-2026-W40) already add the exact needed fixes (top-level permissions: {contents: read} for ci.yml + a root SECURITY.md), and both remain open/unmerged — opening a third would be redundant. Recommend merging #5 (supersedes #4) and closing #4. SHA-pinning changesets/action@v1 remains out of scope for this run (touches the release workflow).

Activity

  1. added
    bug
    needs-spec
    on Oct 16, 2026
  2. srmcguirt commented on Oct 16, 2026

    @srmcguirt
    MemberAuthor

    Marked needs-spec: this is a report bundling several independent follow-ups (merge PR #5 and close #4, SHA-pin changesets/action@v1, add a regression test for the innerHTML sink) rather than one scoped, actionable fix.


    Generated by Claude Code

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

    bugneeds-spec

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions