Skip to content

fix(mcp): add RejectDenied env-var protection to run_command tool#328

Merged
danieljustus merged 13 commits into
mainfrom
session/20260602-144532
Jun 3, 2026
Merged

fix(mcp): add RejectDenied env-var protection to run_command tool#328
danieljustus merged 13 commits into
mainfrom
session/20260602-144532

Conversation

@danieljustus
Copy link
Copy Markdown
Owner

@danieljustus danieljustus commented Jun 2, 2026

Bundles fixes for multiple open issues. The list below grows as commits land; every linked issue will close automatically on merge.

Add secrets.RejectDenied() check in tools_run.go before passing env to
RunCommand, mirroring the existing check in execute_with_secret. Also
deny-list PATH to prevent executable hijacking via PATH override.

Closes #317
Replace string(passphrase) with unsafe.String(unsafe.SliceData(...), len(...))
in EncryptWithPassphraseArgon2id and DecryptWithPassphraseArgon2id, matching
the pattern already used in the scrypt-based EncryptWithPassphrase/
DecryptWithPassphrase. This prevents an unwiped GC-heap copy of the passphrase.

Closes #318
…Locked

Add vaultcrypto.Wipe(plaintext) via defer after json.Marshal succeeds,
ensuring the plaintext buffer is zeroed before going out of scope even
if the subsequent file write fails.

Closes #319
…hing new one

Store a cancel channel on the Server struct. Close the previous channel
before launching a new auto-clear goroutine, and also close it in
Server.Close(). This prevents goroutine leaks on repeated clipboard
copies and on server shutdown.

Closes #327
Replace bare fmt.Errorf("X: %w", err) in cmd/crud RunE functions with
appropriate errorspkg constructors (NotFound, ReadFailed, WriteFailed, Wrap).
This preserves typed errors, correct exit codes, and actionable hints
through the error chain.

Affected commands: add, delete, edit, find, get, list, set.

Closes #320
@danieljustus danieljustus marked this pull request as ready for review June 3, 2026 08:09
Updates govulncheck and osv-scanner failures caused by stdlib
vulnerabilities fixed in Go 1.26.4.

Refs PR #328
- Use retry polling loop for token registry background cleanup test to avoid flakiness on slow CI

Refs PR #328
@danieljustus
Copy link
Copy Markdown
Owner Author

The merge is blocked because the repository's branch protection rules require status checks for Go 1.26.3 ('Test (ubuntu-latest, 1.26.3)', etc.). However, this PR bumps the Go version to 1.26.4 to address the security vulnerabilities GO-2026-5039 and GO-2026-5037, causing the CI to run with Go 1.26.4 instead. Reverting to Go 1.26.3 is not recommended as it would reintroduce the vulnerabilities. This PR must be merged via admin bypass (--force) or the branch protection settings must be updated.

@danieljustus danieljustus merged commit efdee26 into main Jun 3, 2026
19 checks passed
@danieljustus danieljustus deleted the session/20260602-144532 branch June 3, 2026 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment