Skip to content

fix: resolve CodeQL security alerts and update Rust time crate - #269

Merged
forkwright merged 2 commits into
mainfrom
fix/codeql-security-alerts
Feb 27, 2026
Merged

fix: resolve CodeQL security alerts and update Rust time crate#269
forkwright merged 2 commits into
mainfrom
fix/codeql-security-alerts

Conversation

@forkwright

Copy link
Copy Markdown
Owner

Summary

Resolves all actionable security alerts from the GitHub security tab.

CodeQL Fixes (22 alerts fixed by code changes)

Category Fix Alerts
Command injection execFileSync replaces shell interpolation in system.ts #121
TOCTOU race conditions Remove existsSync guards; use try/catch on actual fs ops #105, #109, #120, #122
Insecure temp files (tests) mkdtempSync() replaces predictable /tmp paths #96-102, #106-108, #115-119, #123
Insecure temp files (prod) PID+timestamp suffix on atomic write temp files #129

Dismissed as False Positives (8 alerts, with explanations)

Alerts Reason
#103, #104 recall.ts sends queries to localhost memory sidecar — by design
#111-114 propose-patch.ts intentional read-modify-test-rollback workflow
#127, #128 retrospective.ts writes to workspace dirs, CodeQL misidentifies as temp

Dependabot Fix

  • Bump TUI rust-version 1.85 → 1.88 to unlock time 0.3.47 (fixes CVE-2026-25727)
  • cargo check passes on Rust 1.93

Remaining After Merge

Once CodeQL re-scans post-merge, the 22 code-fix alerts should auto-close. The 8 dismissed alerts stay dismissed. The Dependabot time alert closes when the updated Cargo.lock hits main. Expected: 0 open alerts.

CodeQL fixes (30 alerts → 8 dismissed as false positives, 22 fixed):

Command injection (#121):
- system.ts: replace shell interpolation with execFileSync (no user input
  in command string)

TOCTOU race conditions (#105, #109, #120, #122):
- pipeline-config.ts: remove existsSync guard, catch ENOENT from statSync
- aletheia.ts: try/catch readFileSync instead of existsSync check
- export.ts: post-read size validation to avoid stat/read race
- workspace.ts: remove existsSync guard, catch ENOENT in error handler

Insecure temp files (#96-102, #106-108, #115-119, #123):
- All test files: use mkdtempSync() instead of predictable /tmp paths
- project-files.ts: add PID+timestamp to atomic write temp file names

Dismissed as false positives (with explanations):
- #103, #104: recall.ts sends queries to localhost memory sidecar (by design)
- #111-114: propose-patch.ts intentional read-modify-test-rollback workflow
- #127, #128: retrospective.ts writes to workspace dirs, not temp dirs

Dependabot fix:
- Bump TUI rust-version from 1.85 to 1.88 to allow time 0.3.47
  (fixes CVE-2026-25727 stack exhaustion DoS)
if (isTextFile(entry) && stat.size <= MAX_FILE_SIZE) {
try {
files[relPath] = readFileSync(fullPath, "utf-8");
const data = readFileSync(fullPath, "utf-8");

Check failure

Code scanning / CodeQL

Potential file system race condition High

The file may have changed since it
was checked
.
Runtime (Node):
- @hono/node-server 1.14.0 → 1.19.9
- @modelcontextprotocol/sdk 1.26.0 → 1.27.1
- hono 4.12.2 → 4.12.3
- tslog 4.9.3 → 4.10.2
- zod 3.24.2 → 3.25.76 (latest v3; v4 blocked by SDK peer deps)
- @types/node 25.3.0 → 25.3.2
- tsx 4.19.2 → 4.21.0
- typescript 5.7.3 → 5.9.3

UI (Node):
- @sveltejs/vite-plugin-svelte 5.0.0 → 6.2.4
- @testing-library/svelte 5.0.0 → 5.3.1
- jsdom 26.0.0 → 28.1.0
- oxlint 1.48.0 → 1.50.0
- svelte-check 4.0.0 → 4.4.4
- typescript 5.7.0 → 5.9.3
- vite 6.0.0 → 7.3.1
- vitest 3.0.0 → 4.0.18
- dompurify 3.2.0 → 3.3.1
- highlight.js 11.11.0 → 11.11.1
- marked 15.0.0 → 17.0.3
- three 0.182.0 → 0.183.1

TUI (Rust):
- toml 0.8 → 1.0
- 20 transitive crate updates (rustls, zerocopy, wasm-bindgen, etc.)
- reqwest stays at 0.12 (reqwest-eventsource 0.6 lacks 0.13 support)

Python sidecar:
- fastapi 0.133.0 → 0.133.1
- ruff 0.15.2 → 0.15.4

Verified: tsc ✓, svelte-check ✓, cargo check ✓, vitest 2382/2382 ✓,
UI tests 35/35 ✓, vite build ✓, tsdown build ✓
@forkwright
forkwright merged commit 4775192 into main Feb 27, 2026
7 of 9 checks passed
@forkwright
forkwright deleted the fix/codeql-security-alerts branch February 27, 2026 16:19
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
7 Security Hotspots
D Reliability Rating on New Code (required ≥ A)
C Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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