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: clear post-merge security findings

auroracapital9bfdc150bae1
diff --git a/claude-ops/scripts/crsproxy-reauth/bu_reauth.py b/claude-ops/scripts/crsproxy-reauth/bu_reauth.py
index 59b4ab42..557d7af9 100644
--- a/claude-ops/scripts/crsproxy-reauth/bu_reauth.py
+++ b/claude-ops/scripts/crsproxy-reauth/bu_reauth.py
@@ -72,7 +72,6 @@ import hashlib
import json
import os
import re
-import shutil
import signal
import socket
import subprocess
@@ -295,10 +294,12 @@ def _stop_candidate_proxy(process: subprocess.Popen):
try:
os.killpg(process.pid, signal.SIGKILL)
except OSError:
+ # The process group may have exited during escalation.
pass
try:
process.wait(timeout=2)
except subprocess.TimeoutExpired:
+ # Shutdown is best-effort after SIGKILL.
pass
@@ -571,6 +572,7 @@ def _write_lease(data: dict):
try:
tmp.unlink()
except OSError:
+ # Preserve the original lease-write error.
pass
raise
@@ -1379,6 +1381,7 @@ def _restore_failed_candidate(auth_file: Path, stale_backup: Path):
try:
auth_file.unlink()
except FileNotFoundError:
+ # Another cleanup path already removed the candidate.
pass
except Exception as e:
log(f"Failed candidate cleanup error: {e}")
diff --git a/claude-ops/scripts/crsproxy-reauth/test_candidate_validation.py b/claude-ops/scripts/crsproxy-reauth/test_candidate_validation.py
index 6efccf0f..cf5bd010 100644
--- a/claude-ops/scripts/crsproxy-reauth/test_candidate_validation.py
+++ b/claude-ops/scripts/crsproxy-reauth/test_candidate_validation.py
@@ -85,7 +85,7 @@ def test_candidate_specific_success_and_permissions():
root = Path(tmpdir)
auth = root / "claude-user.json"
auth.write_text(json.dumps(valid_auth(token="good-token")))
- os.chmod(auth, 0o640)
+ os.chmod(auth, 0o600)
proxy, record = make_proxy(root)
with proxy_env(proxy):
valid, reason = bu_reauth.validate_candidate(
@@ -96,7 +96,7 @@ def test_candidate_specific_success_and_permissions():
assert Path(used["auth_file"]).name == auth.name
assert Path(used["auth_dir"]) != auth.parent
assert used["host"] == "127.0.0.1"
- assert stat.S_IMODE(auth.stat().st_mode) == 0o640
+ assert stat.S_IMODE(auth.stat().st_mode) == 0o600
print("PASS: validator launches a loopback proxy with only the exact isolated candidate")
@@ -192,7 +192,7 @@ def test_failed_candidate_rollback_and_activation_mode():
stale_payload = {"email": "[email protected]", "type": "claude", "disabled": True, "access_token": "old"}
auth.write_text(json.dumps(valid_auth("[email protected]")))
stale.write_text(json.dumps(stale_payload))
- os.chmod(stale, 0o640)
+ os.chmod(stale, 0o600)
proc = object()
with patch.object(bu_reauth, "paste_callback_url", return_value=True), \
patch.object(bu_reauth.time, "sleep"), \
@@ -202,13 +202,13 @@ def test_failed_candidate_rollback_and_activation_mode():
"[email protected]", "claude", bu_reauth.PROVIDERS["claude"])
assert result == bu_reauth.EXIT_FAILURE
assert json.loads(auth.read_text()) == stale_payload
- assert stat.S_IMODE(auth.stat().st_mode) == 0o640
+ assert stat.S_IMODE(auth.stat().st_mode) == 0o600
auth.write_text(json.dumps(valid_auth()))
- os.chmod(auth, 0o640)
+ os.chmod(auth, 0o600)
assert bu_reauth.activate_auth_file(auth) is True
assert json.loads(auth.read_text())["disabled"] is False
- assert stat.S_IMODE(auth.stat().st_mode) == 0o640
+ assert stat.S_IMODE(auth.stat().st_mode) == 0o600
print("PASS: failed candidates roll back atomically and activation preserves permissions")