diff --git a/packages/cli/package.json b/packages/cli/package.json index be1e999f..c6092d7d 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/spawn", - "version": "0.27.6", + "version": "0.27.7", "type": "module", "bin": { "spawn": "cli.js" diff --git a/packages/cli/src/shared/agent-setup.ts b/packages/cli/src/shared/agent-setup.ts index a7ed108b..af65880d 100644 --- a/packages/cli/src/shared/agent-setup.ts +++ b/packages/cli/src/shared/agent-setup.ts @@ -299,6 +299,9 @@ export async function offerGithubAuth(runner: CloudRunner, explicitlyRequested?: let ghCmd = "curl --proto '=https' -fsSL https://openrouter.ai/labs/spawn/shared/github-auth.sh | bash"; if (githubToken) { const tokenB64 = Buffer.from(githubToken).toString("base64"); + if (!/^[A-Za-z0-9+/=]+$/.test(tokenB64)) { + throw new Error("Unexpected characters in base64 output"); + } ghCmd = `export GITHUB_TOKEN=$(printf '%s' ${shellQuote(tokenB64)} | base64 -d) && ${ghCmd}`; }