Skip to content

fix: resolve double-escaping vulnerability and picomatch alerts#35

Merged
I4cTime merged 1 commit intodevelopfrom
feature/security-fixes
Mar 26, 2026
Merged

fix: resolve double-escaping vulnerability and picomatch alerts#35
I4cTime merged 1 commit intodevelopfrom
feature/security-fixes

Conversation

@I4cTime
Copy link
Copy Markdown
Owner

@I4cTime I4cTime commented Mar 26, 2026

Security Fixes

CodeQL — js/double-escaping (High, Alert #14)

  • File: src/core/import.ts:49-53
  • Issue: Chained .replace() calls processed \\ after \n/\r/\t, causing double-unescape on inputs like \\n
  • Fix: Single-pass regex with replacer map — handles all escape sequences atomically in one pass

Dependabot — picomatch

Alert Severity Resolution
#2 Medium Deleted stale package-lock.json (project uses pnpm) + added to .gitignore
#3 High (ReDoS) Added pnpm.overrides to web/package.json → picomatch 4.0.4
#4 High (ReDoS) Dismissed — picomatch v2 not in dependency tree
#5 Medium Fixed via web override → picomatch 4.0.4
#6 Medium Dismissed — picomatch v2 not in dependency tree

Tests

  • 8 new parseDotenv unit tests covering escape edge cases (133 total, all passing)
  • pnpm audit — 0 vulnerabilities (root + web)

Made with Cursor

- Single-pass regex replacer in parseDotenv() prevents double-unescape
  of backslash sequences (CodeQL js/double-escaping alert #14)
- Add picomatch >=4.0.4 override to web/package.json (Dependabot #3, #5)
- Remove stale package-lock.json + add to .gitignore (Dependabot #2)
- Add 8 parseDotenv unit tests covering escape edge cases

Made-with: Cursor
@I4cTime I4cTime merged commit ea3e3f4 into develop Mar 26, 2026
4 checks passed
I4cTime added a commit that referenced this pull request Mar 26, 2026
* Add Vitest test suite and Homebrew tap automation (#30)

- Install vitest, add test/test:ci scripts and vitest.config.ts
- 125 tests across 17 files covering core modules, CLI, and MCP
- Add test step to CI workflow
- Create update-homebrew.yml to auto-update I4cTime/homebrew-tap on release

Made-with: Cursor

* chore: bump version to v0.9.4 (#31)

Made-with: Cursor

* feat: Cursor marketplace plugin + Homebrew/plugin docs (#33)

* feat: add Cursor marketplace plugin and update README/web with Homebrew + plugin info

- Create cursor-plugin/ with plugin.json manifest, 3 rules, 4 skills,
  2 agents, 5 commands, hooks.json, .mcp.json, and README
- Add .cursor-plugin/marketplace.json at repo root for monorepo discovery
- Update README.md with Homebrew install option and Cursor Plugin section
- Add Homebrew tab to web Hero and docs install commands
- Create CursorPlugin.tsx homepage section component
- Add Plugin nav link, update Footer version to v0.9.4
- Add Cursor Plugin step to docs page
- Remove beforeShellExecution hook (causes circular block with Cursor metadata)

Made-with: Cursor

* fix: resolve picomatch audit + update changelogs for v0.9.5

- Add pnpm override for picomatch >=4.0.4 (ReDoS + method injection)
- Add v0.9.5 entry to CHANGELOG.md (Cursor plugin, Homebrew docs, audit fix)
- Sync web changelog with v0.9.2–v0.9.5 entries

Made-with: Cursor

* chore: bump version to v0.9.5

Made-with: Cursor

* fix: resolve double-escaping vulnerability and picomatch alerts (#35)

- Single-pass regex replacer in parseDotenv() prevents double-unescape
  of backslash sequences (CodeQL js/double-escaping alert #14)
- Add picomatch >=4.0.4 override to web/package.json (Dependabot #3, #5)
- Remove stale package-lock.json + add to .gitignore (Dependabot #2)
- Add 8 parseDotenv unit tests covering escape edge cases

Made-with: Cursor

* chore: bump version to v0.9.6

Made-with: Cursor
@I4cTime I4cTime deleted the feature/security-fixes branch March 26, 2026 13:51
I4cTime added a commit that referenced this pull request Mar 26, 2026
* Add Vitest test suite and Homebrew tap automation (#30)

- Install vitest, add test/test:ci scripts and vitest.config.ts
- 125 tests across 17 files covering core modules, CLI, and MCP
- Add test step to CI workflow
- Create update-homebrew.yml to auto-update I4cTime/homebrew-tap on release

Made-with: Cursor

* chore: bump version to v0.9.4 (#31)

Made-with: Cursor

* feat: Cursor marketplace plugin + Homebrew/plugin docs (#33)

* feat: add Cursor marketplace plugin and update README/web with Homebrew + plugin info

- Create cursor-plugin/ with plugin.json manifest, 3 rules, 4 skills,
  2 agents, 5 commands, hooks.json, .mcp.json, and README
- Add .cursor-plugin/marketplace.json at repo root for monorepo discovery
- Update README.md with Homebrew install option and Cursor Plugin section
- Add Homebrew tab to web Hero and docs install commands
- Create CursorPlugin.tsx homepage section component
- Add Plugin nav link, update Footer version to v0.9.4
- Add Cursor Plugin step to docs page
- Remove beforeShellExecution hook (causes circular block with Cursor metadata)

Made-with: Cursor

* fix: resolve picomatch audit + update changelogs for v0.9.5

- Add pnpm override for picomatch >=4.0.4 (ReDoS + method injection)
- Add v0.9.5 entry to CHANGELOG.md (Cursor plugin, Homebrew docs, audit fix)
- Sync web changelog with v0.9.2–v0.9.5 entries

Made-with: Cursor

* chore: bump version to v0.9.5

Made-with: Cursor

* fix: resolve double-escaping vulnerability and picomatch alerts (#35)

- Single-pass regex replacer in parseDotenv() prevents double-unescape
  of backslash sequences (CodeQL js/double-escaping alert #14)
- Add picomatch >=4.0.4 override to web/package.json (Dependabot #3, #5)
- Remove stale package-lock.json + add to .gitignore (Dependabot #2)
- Add 8 parseDotenv unit tests covering escape edge cases

Made-with: Cursor

* chore: bump version to v0.9.6

Made-with: Cursor

* fix: nav anchor links now route back to homepage from /docs and /changelog (#37)

Replace plain <a> tags with Next.js <Link> for all nav items so /#hash
links perform client-side navigation to / before scrolling to the target
section, instead of looking for anchors on the current page.

Made-with: Cursor

* chore: bump version to v0.9.7

Made-with: Cursor
I4cTime added a commit that referenced this pull request Mar 28, 2026
* Add Vitest test suite and Homebrew tap automation (#30)

- Install vitest, add test/test:ci scripts and vitest.config.ts
- 125 tests across 17 files covering core modules, CLI, and MCP
- Add test step to CI workflow
- Create update-homebrew.yml to auto-update I4cTime/homebrew-tap on release

Made-with: Cursor

* chore: bump version to v0.9.4 (#31)

Made-with: Cursor

* feat: Cursor marketplace plugin + Homebrew/plugin docs (#33)

* feat: add Cursor marketplace plugin and update README/web with Homebrew + plugin info

- Create cursor-plugin/ with plugin.json manifest, 3 rules, 4 skills,
  2 agents, 5 commands, hooks.json, .mcp.json, and README
- Add .cursor-plugin/marketplace.json at repo root for monorepo discovery
- Update README.md with Homebrew install option and Cursor Plugin section
- Add Homebrew tab to web Hero and docs install commands
- Create CursorPlugin.tsx homepage section component
- Add Plugin nav link, update Footer version to v0.9.4
- Add Cursor Plugin step to docs page
- Remove beforeShellExecution hook (causes circular block with Cursor metadata)

Made-with: Cursor

* fix: resolve picomatch audit + update changelogs for v0.9.5

- Add pnpm override for picomatch >=4.0.4 (ReDoS + method injection)
- Add v0.9.5 entry to CHANGELOG.md (Cursor plugin, Homebrew docs, audit fix)
- Sync web changelog with v0.9.2–v0.9.5 entries

Made-with: Cursor

* chore: bump version to v0.9.5

Made-with: Cursor

* fix: resolve double-escaping vulnerability and picomatch alerts (#35)

- Single-pass regex replacer in parseDotenv() prevents double-unescape
  of backslash sequences (CodeQL js/double-escaping alert #14)
- Add picomatch >=4.0.4 override to web/package.json (Dependabot #3, #5)
- Remove stale package-lock.json + add to .gitignore (Dependabot #2)
- Add 8 parseDotenv unit tests covering escape edge cases

Made-with: Cursor

* chore: bump version to v0.9.6

Made-with: Cursor

* fix: nav anchor links now route back to homepage from /docs and /changelog (#37)

Replace plain <a> tags with Next.js <Link> for all nav items so /#hash
links perform client-side navigation to / before scrolling to the target
section, instead of looking for anchors on the current page.

Made-with: Cursor

* chore: bump version to v0.9.7

Made-with: Cursor

* OWASP Full Remediation — v0.9.8 Security Release (#39)

* security: OWASP full remediation for v0.9.8

- Extract SSRF guard into shared src/core/ssrf.ts, apply to validate.ts and provision.ts
- Fix shell injection in hooks.ts: spawn("pgrep") replaces exec("pgrep -f ...")
- Fix dashboard XSS: escape e.action in renderAudit
- Enforce checkKeyReadPolicy on listSecrets, exportSecrets, hasSecret, deleteSecret, getEnvelope
- Replace Math.random with crypto.randomBytes for tunnel IDs
- Store memory encryption key in OS keyring with legacy migration/fallback
- Escape regex metacharacters in glob-to-regex (server.ts, hooks.ts)
- Use word-boundary regex for exec profile denyCommands
- Add path-to-regexp and brace-expansion pnpm overrides
- Add CSP meta tag to web layout
- Add SSRF test suite (12 tests) and tunnel ID uniqueness test
- Version bump to 0.9.8, update CHANGELOG and web changelog

Made-with: Cursor

* fix: remove brace-expansion override — incompatible with minimatch@3 API

brace-expansion v5 breaks minimatch@3.1.5 (used by ESLint) which expects
the v1.x API. This is an upstream transitive dependency that cannot be
overridden without breaking the linter.

Made-with: Cursor
I4cTime added a commit that referenced this pull request Apr 9, 2026
* Add Vitest test suite and Homebrew tap automation (#30)

- Install vitest, add test/test:ci scripts and vitest.config.ts
- 125 tests across 17 files covering core modules, CLI, and MCP
- Add test step to CI workflow
- Create update-homebrew.yml to auto-update I4cTime/homebrew-tap on release

Made-with: Cursor

* chore: bump version to v0.9.4 (#31)

Made-with: Cursor

* feat: Cursor marketplace plugin + Homebrew/plugin docs (#33)

* feat: add Cursor marketplace plugin and update README/web with Homebrew + plugin info

- Create cursor-plugin/ with plugin.json manifest, 3 rules, 4 skills,
  2 agents, 5 commands, hooks.json, .mcp.json, and README
- Add .cursor-plugin/marketplace.json at repo root for monorepo discovery
- Update README.md with Homebrew install option and Cursor Plugin section
- Add Homebrew tab to web Hero and docs install commands
- Create CursorPlugin.tsx homepage section component
- Add Plugin nav link, update Footer version to v0.9.4
- Add Cursor Plugin step to docs page
- Remove beforeShellExecution hook (causes circular block with Cursor metadata)

Made-with: Cursor

* fix: resolve picomatch audit + update changelogs for v0.9.5

- Add pnpm override for picomatch >=4.0.4 (ReDoS + method injection)
- Add v0.9.5 entry to CHANGELOG.md (Cursor plugin, Homebrew docs, audit fix)
- Sync web changelog with v0.9.2–v0.9.5 entries

Made-with: Cursor

* chore: bump version to v0.9.5

Made-with: Cursor

* fix: resolve double-escaping vulnerability and picomatch alerts (#35)

- Single-pass regex replacer in parseDotenv() prevents double-unescape
  of backslash sequences (CodeQL js/double-escaping alert #14)
- Add picomatch >=4.0.4 override to web/package.json (Dependabot #3, #5)
- Remove stale package-lock.json + add to .gitignore (Dependabot #2)
- Add 8 parseDotenv unit tests covering escape edge cases

Made-with: Cursor

* chore: bump version to v0.9.6

Made-with: Cursor

* fix: nav anchor links now route back to homepage from /docs and /changelog (#37)

Replace plain <a> tags with Next.js <Link> for all nav items so /#hash
links perform client-side navigation to / before scrolling to the target
section, instead of looking for anchors on the current page.

Made-with: Cursor

* chore: bump version to v0.9.7

Made-with: Cursor

* OWASP Full Remediation — v0.9.8 Security Release (#39)

* security: OWASP full remediation for v0.9.8

- Extract SSRF guard into shared src/core/ssrf.ts, apply to validate.ts and provision.ts
- Fix shell injection in hooks.ts: spawn("pgrep") replaces exec("pgrep -f ...")
- Fix dashboard XSS: escape e.action in renderAudit
- Enforce checkKeyReadPolicy on listSecrets, exportSecrets, hasSecret, deleteSecret, getEnvelope
- Replace Math.random with crypto.randomBytes for tunnel IDs
- Store memory encryption key in OS keyring with legacy migration/fallback
- Escape regex metacharacters in glob-to-regex (server.ts, hooks.ts)
- Use word-boundary regex for exec profile denyCommands
- Add path-to-regexp and brace-expansion pnpm overrides
- Add CSP meta tag to web layout
- Add SSRF test suite (12 tests) and tunnel ID uniqueness test
- Version bump to 0.9.8, update CHANGELOG and web changelog

Made-with: Cursor

* fix: remove brace-expansion override — incompatible with minimatch@3 API

brace-expansion v5 breaks minimatch@3.1.5 (used by ESLint) which expects
the v1.x API. This is an upstream transitive dependency that cannot be
overridden without breaking the linter.

Made-with: Cursor

* security: fix hono, @hono/node-server, and vite vulnerabilities (#41)

Add pnpm overrides to resolve 9 Dependabot alerts:
- hono >=4.12.12 (5 medium: cookie bypass, IP matching, serveStatic
  traversal, toSSG path traversal)
- @hono/node-server >=1.19.13 (1 medium: serveStatic bypass)
- vite >=8.0.5 (2 high: fs.deny bypass, WebSocket file read;
  1 medium: optimized deps .map traversal)

All are transitive dependencies (hono via @modelcontextprotocol/sdk,
vite via vitest). Fresh lockfile regenerated.

Made-with: Cursor

* chore: bump version to v0.9.9 (#42)

Security patch release — hono, @hono/node-server, and vite pnpm
overrides to resolve 9 Dependabot alerts.

Made-with: Cursor
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.

1 participant