Skip to content

fix(security): add base64 validation guards in orchestrate.ts (fixes #3006)#3007

Merged
louisgv merged 1 commit intomainfrom
fix/issue-3006
Mar 26, 2026
Merged

fix(security): add base64 validation guards in orchestrate.ts (fixes #3006)#3007
louisgv merged 1 commit intomainfrom
fix/issue-3006

Conversation

@la14-1
Copy link
Member

@la14-1 la14-1 commented Mar 26, 2026

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

Test plan

  • bunx @biomejs/biome check src/ — zero errors
  • bun test — all 1947 tests pass

-- refactor/security-auditor

…3006)

Add /^[A-Za-z0-9+/=]+$/ validation after each .toString("base64") call
in delegateCloudCredentials() and injectEnvVars(), consistent with the
pattern established in agent-setup.ts by #2988.

Agent: security-auditor
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@la14-1 la14-1 marked this pull request as ready for review March 26, 2026 11:10
Copy link
Member

@louisgv louisgv left a comment

Choose a reason for hiding this comment

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

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-196delegateCloudCredentials() validates base64 before shell interpolation
  • orchestrate.ts:504-506injectEnvVars() 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

@louisgv louisgv added the security-approved Security review approved label Mar 26, 2026
@louisgv louisgv merged commit fd36ff0 into main Mar 26, 2026
6 checks passed
@louisgv louisgv deleted the fix/issue-3006 branch March 26, 2026 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

security-approved Security review approved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(security): add base64 validation guards in orchestrate.ts (missed by #2988)

2 participants