Skip to content

fix(security): resolve open code-scanning & Dependabot alerts - #1398

Open
pathosDev wants to merge 2 commits into
developfrom
fix/security-and-quality-alerts
Open

fix(security): resolve open code-scanning & Dependabot alerts#1398
pathosDev wants to merge 2 commits into
developfrom
fix/security-and-quality-alerts

Conversation

@pathosDev

Copy link
Copy Markdown
Owner

Summary

Clears the open GitHub Security & quality items on actor-ts: 6 CodeQL code-scanning alerts and 4 Dependabot alerts.

Code scanning (CodeQL security-and-quality)

# Rule Sev Resolution
11 js/file-system-race High scripts/build-devtools-ui.mjs — read the generated module via try/catch instead of existsSync()+readFile before the write (removes the TOCTOU check→write pair)
10 js/file-system-race High docs/scripts/scaffold.mjs — write stubs with the wx flag (atomic EEXIST) instead of existsSync()-then-write
15 js/log-injection Med examples/voice/static/plain/index.html — log only a sanitized message kind, never the raw server payload
13 js/missing-origin-check Med src/worker/WorkerNode.tsdismissed as false positive + explanatory comment
12 js/missing-origin-check Med src/testkit/internal/ParallelMultiNodeBootstrap.tsdismissed + comment
14 js/missing-origin-check Med tests/smoke/fixtures/parallel-mns-worker-throws-after-ready.mjsdismissed + comment

The three missing-origin-check findings are in dedicated Worker / worker_threads message handlers, where postMessage origin does not apply (messages come only from the trusted parent that spawned the worker; payloads are validated by kind). They were dismissed via the API with that justification; the added comments document why.

Dependabot (4 alerts)

  • nanoid → 3.3.18 (GHSA-2v37-7h3g-55p8, High) in examples/{voice,chat}/frontend-nextpackage-lock.json and bun.lock. The bun.lock next bump (16.2.12 → 16.3.3) is the lockfile catching up to the existing package.json range (^16.3.0); package.json is unchanged.
  • cookie → 0.7.2 (GHSA-pxg6-pf52-xh8x, Low, dev) in examples/{voice,chat}/frontend-svelte via an overrides pin, since @sveltejs/kit constrains cookie to ^0.6.0.

Verification

  • node --check passes on all edited .mjs scripts; TS edits are comment-only.
  • Lockfiles regenerated; nanoid and cookie confirmed at safe versions in both npm and bun lockfiles.
  • CodeQL (.github/workflows/codeql.yml) will re-scan this PR — alerts 10/11/15 should clear; 12/13/14 stay dismissed.

Out of scope — flagged for maintainer

npm audit surfaced two findings that were not in GitHub's open alert list and are left untouched here:

  • @sveltejs/kit ReDoS (moderate, GHSA-29g2-3rmr-qm68) in the svelte examples.
  • A nanoid <3.3.18 transitive in the svelte examples (only the frontend-next ones were flagged by Dependabot).

Happy to address these in a follow-up if desired.

🤖 Generated with Claude Code

pathosDev and others added 2 commits August 31, 2026 20:05
- js/file-system-race (High): remove TOCTOU in build/docs tooling
  - build-devtools-ui.mjs: read the generated module via try/catch
    instead of existsSync()+readFile before the write
  - scaffold.mjs: write stubs with the 'wx' flag (atomic EEXIST) instead
    of existsSync()-then-write
- js/log-injection (Med): log only a sanitized message `kind` in the
  voice plain example, never the raw server payload
- js/missing-origin-check (Med x3): document why origin checks do not
  apply to dedicated Worker / worker_threads handlers (WorkerNode,
  ParallelMultiNodeBootstrap, smoke fixture); these alerts are dismissed
  on GitHub as false positives.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Resolves 4 Dependabot alerts in the example apps:
- nanoid -> 3.3.18 (GHSA-2v37-7h3g-55p8, High) in voice/chat frontend-next;
  both package-lock.json and bun.lock. The bun.lock next bump
  (16.2.12 -> 16.3.3) is the lockfile catching up to the existing
  package.json range (^16.3.0); package.json itself is unchanged.
- cookie -> 0.7.2 (GHSA-pxg6-pf52-xh8x, Low, dev) in voice/chat
  frontend-svelte via an `overrides` pin, since @sveltejs/kit constrains
  cookie to ^0.6.0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
// js/log-injection).
const kind =
typeof m?.kind === 'string' ? m.kind.replace(/[^\w.:-]/g, '') : '(unknown)';
console.debug('unhandled server msg kind:', kind);
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