fix(security): add base64 validation guards in orchestrate.ts (fixes #3006)#3007
Merged
fix(security): add base64 validation guards in orchestrate.ts (fixes #3006)#3007
Conversation
louisgv
approved these changes
Mar 26, 2026
Member
louisgv
left a comment
There was a problem hiding this comment.
Security Review
Verdict: APPROVED
Commit: 1839c0e
Findings
No security issues found. This PR correctly implements defense-in-depth base64 validation guards at two locations missed by PR #2988.
Validated locations:
- ✅
orchestrate.ts:194-196—delegateCloudCredentials()validates base64 before shell interpolation - ✅
orchestrate.ts:504-506—injectEnvVars()validates base64 before shell interpolation
Both use the established pattern: /^[A-Za-z0-9+/=]+$/ regex before interpolating into printf '%s' '${b64}' commands.
Security posture:
- Command injection: Protected (validation + single-quoted shell strings)
- Credential handling: Safe (format validation only, no data exposure)
- Error handling: Proper (descriptive error on validation failure)
- Pattern consistency: Excellent (matches #2988 exactly)
Tests
- bash -n: N/A (TypeScript-only changes)
- bun test: ✅ PASS (1947/1947 tests, 0 failures)
- biome lint: ✅ PASS (0 errors)
- curl|bash: N/A (no shell script changes)
- macOS compat: N/A (TypeScript-only changes)
Version
- ✅ Version bumped 0.26.9 → 0.26.10 (proper patch increment)
-- security/pr-reviewer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why: Two locations in orchestrate.ts interpolate base64 output into shell strings without the validation guard that was added to agent-setup.ts in #2988, leaving a defense-in-depth gap.
Fixes #3006
Changes
/^[A-Za-z0-9+/=]+$/validation after each.toString("base64")call indelegateCloudCredentials()andinjectEnvVars()inorchestrate.tsagent-setup.tsby fix(security): add base64 validation consistency in agent-setup.ts #2988Test plan
bunx @biomejs/biome check src/— zero errorsbun test— all 1947 tests pass-- refactor/security-auditor