Skip to content

fix(security): derive the commit-privacy script path from the file location, not argv - #1230

Merged
Fmarzochi merged 2 commits into
mainfrom
fix/apply-commit-privacy-dirname
Aug 7, 2026
Merged

fix(security): derive the commit-privacy script path from the file location, not argv#1230
Fmarzochi merged 2 commits into
mainfrom
fix/apply-commit-privacy-dirname

Conversation

@Fmarzochi

@Fmarzochi Fmarzochi commented Aug 7, 2026

Copy link
Copy Markdown
Owner

The helper introduced in #1229 resolved the check-state-leak.js path from process.argv[2], letting an externally influenced string reach the git-config command that memory-filters.js executes. The repo root is fixed relative to the helper file, so it is now derived from __dirname (the same resolution mcp-register-cli and dashboard-launch settled on) and the installer no longer passes the argument.

Verified live: running the helper configures the filter with the correct absolute path and exit 0, and the install test suites pass (install-ps1 9/9, install-sh 6/6).


Summary by cubic

Hardened commit-privacy setup by deriving the check-state-leak.js path from this file’s location (__dirname) instead of argv, preventing untrusted input from reaching git-config. The installer no longer passes a repo path argument, and docs/ROADMAP.md records this under Unreleased.

  • Bug Fixes
    • Compute rootDir from __dirname in apply-commit-privacy.js and set scriptPath via path.join(rootDir, 'scripts', 'check-state-leak.js').
    • Update install.ps1 to call the helper without $RootDir.
    • Verified: helper sets the filter with the correct absolute path; install-ps1 (9/9) and install-sh (6/6) tests pass.

Written for commit cd3a443. Summary will update on new commits.

Review in cubic

…cation, not argv

Signed-off-by: Felipe Marzochi <fmarzochi@gmail.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 2 files

Re-trigger cubic

…g under Unreleased

Signed-off-by: Felipe Marzochi <fmarzochi@gmail.com>
@Fmarzochi Fmarzochi moved this from Todo to In Progress in EGC Roadmap Aug 7, 2026
@Fmarzochi
Fmarzochi merged commit 98cf4ee into main Aug 7, 2026
39 checks passed
@Fmarzochi
Fmarzochi deleted the fix/apply-commit-privacy-dirname branch August 7, 2026 21:18
@github-project-automation github-project-automation Bot moved this from In Progress to Done in EGC Roadmap Aug 7, 2026
@sonarqubecloud

sonarqubecloud Bot commented Aug 7, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant