Skip to content

Business operating system for Claude Code — 57 skills, 21 agents, smart daemon. Unified inbox (WhatsApp/Email/Slack/Telegram), autonomous PR merge, full-AWS monitoring, revenue (Stripe+RevenueCat), e-commerce (Shopify), marketing (Klaviyo/Meta/GA4), voice (Bland/ElevenLabs), APM (Datadog/NewRelic/OTEL), YOLO mode.

fix(security): capture the OAuth URL under umask 077 (#713)

Aurora Capital6e49056e1b41
diff --git a/claude-ops/scripts/account-rotation/rotate.mjs b/claude-ops/scripts/account-rotation/rotate.mjs
index 271fc93f..a0afeb39 100644
--- a/claude-ops/scripts/account-rotation/rotate.mjs
+++ b/claude-ops/scripts/account-rotation/rotate.mjs
@@ -3294,12 +3294,19 @@ async function browserOAuthFallback(account) {
// one step, owner-only: 0o700 already carries the owner exec bit, so the old
// widening chmod to 0o755 is gone. A leftover from a crashed run is cleared
// first; if the create still fails, we refuse rather than trust the file.
+ //
+ // The script itself redirects under `umask 077`, because the URL it captures
+ // carries the OAuth state and code challenge and would otherwise land at the
+ // ambient umask — readable by anyone on the box, at a path they can guess.
try {
unlinkSync(capScript);
} catch {
/* nothing left over */
}
- writeFileSync(capScript, `#!/bin/bash\necho "$1" > "${urlFile}"\n`, { flag: 'wx', mode: 0o700 });
+ writeFileSync(capScript, `#!/bin/bash\numask 077\necho "$1" > "${urlFile}"\n`, {
+ flag: 'wx',
+ mode: 0o700,
+ });
const proc = spawn('claude', ['auth', 'login', '--email', account.email], {
env: { ...process.env, BROWSER: capScript },