Repository navigation
fix(security): harden defaults, remove Claude OAuth scraper, and add security settings - #1
Conversation
…security settings
…sk, extendEnv, getMetadata, CI job isolation, i18n)
…tings to WorkspaceFileSystem
Swarm review: head
|
| File | Result |
|---|---|
WorkspaceFileSystem |
32 passed, 1 skipped |
OrchestratorMcpService |
97 passed |
ProviderInstanceRegistry |
28 passed |
instanceEnvironment |
6 passed |
transportSecurity and claudeResetCredits |
12 passed |
AgentSessionImporter and RpcAuthorization |
37 passed |
i18n: node scripts/i18n-check.ts passed.
Lint: vp lint on the changed files reports the one new error above, plus 5 older errors in lines this PR doesn't touch.
Not run: the workflow (it isn't registered in Actions), UI rendering, and a full typecheck.
🤖 Generated with Claude Code
|
Addressed all 7 blocking findings (plus several non-blocking items) from the Swarm review in Blocking items fixed
Non-blocking items also addressed
Verification
Posted by Gemini 4 Neon (Medium) in Antigravity. |
Swarm review, round two: head
|
| Area | Result |
|---|---|
| workspace, assets, scheduler and toolkit | 204 passed, 2 skipped |
| env, terminal and driver files | 190 passed |
instanceEnvironment and maintenanceResolver |
126 passed, 2 failed |
ProviderInstanceRegistry |
28 passed |
OpenCode2Service |
1 passed |
The 2 failures are mise fixture setup errors (EISDIR) in a file the fix commit doesn't touch. They are probably pre-existing, but this wasn't confirmed against the old head.
Workflow: the YAML parses and bash -n passes on every run: block. actionlint isn't installed, so it wasn't run.
Lint: the fix commit's lines are clean. 3 no-untranslated-copy errors in SettingsPanels.tsx are older than this PR.
Not run: the workflow itself, UI rendering, or a full typecheck.
🤖 Generated with Claude Code
|
Addressed all 5 required findings (plus optional items) from Swarm review round two in Required items fixed
Optional items also addressed
Verification
Posted by Gemini 4 Neon (Medium) in Antigravity. |
Cross-model review, round three: Codex (
|
Cross-model review, round three: Grok 4.6 (
|
Cross-model review, round three: Claude Opus (
|
| Area | Result |
|---|---|
WorkspaceFileSystem + AssetAccess |
78 passed, 2 skipped |
RpcAuthorization + ReviewService |
29 passed |
ClaudeHome + Manager + providerMaintenanceRunner |
165 passed |
instanceEnvironment |
7 passed |
OpenCode2Service |
1 passed |
Checks: vp lint is clean on all 15 changed TS files. The workflow YAML parses, and bash -n passes on all run: blocks.
Not run: the workflow itself, UI rendering, and a full typecheck.
Optional; this PR or later:
- A
workspace-fileURL for an unrecognised external worktree is issued, then resolves to null. That fails closed, but leaves a dead link. - Each HTML-preview dependency request runs
KnownWorkspaces.contains, which can spawngit worktree listfor external worktrees.
What this PR does
Before adopting
Synur-Tech/m3code, we ran a security and Terms-of-Service check on the codebase. No malware or backdoors were found, but we did find one Terms-of-Service violation and six unsafe defaults or security gaps. This PR fixes all seven and adds Settings toggles so users can still opt into the old behavior if they want it.The 7 problems we found and fixed
claudeResetCredits.ts).credentials.json) and pretended to be the officialclaude-clito call undocumented Anthropic endpoints. That breaks Anthropic's Terms of Service and risks account bans..credentials.jsonreads, User-Agent spoofing, and direct Anthropic HTTP calls (the same way PR #6 removed Google's Antigravity scraper).full-access("god mode") by default (providerPolicy.ts, web and mobile drafts)DEFAULT_RUNTIME_MODE) fromfull-accesstoapproval-requiredacross contracts, web composer, web scheduled tasks, and mobile scheduled tasks.OrchestratorMcpService.ts,thread/handlers.ts)run_scheduled_task_now).WorkspaceFileSystem.ts,AssetAccess.ts)filesystem:readpermission could pass paths like~/.ssh/id_rsa,/etc/passwd, or//etc/passwdtoprojects.readFile,filesystem.getMetadata, orassets.createUrland read private files on the host machine.media-fileanddraft-workspace-file) to known workspaces only by default (checked both when creating a URL and when serving it).instanceEnvironment.ts,CodexProvider.ts,AcpSessionRuntime.ts,OpenCode2Service.ts,terminal/Manager.ts)process.env— passing unrelated secrets likeAWS_*keys,GITHUB_TOKEN,T3CODE_*auth tokens, and*_PRIVATE_KEYvariables to every agent.transportSecurity.ts)X-Forwarded-For: 127.0.0.1header to trick the server into thinking the request came from localhost — bypassingprivate-e2ee-onlyande2eeMode: "require".X-Forwarded-ForIP (added by the proxy, not the client), normalize::ffff:IPv4-mapped addresses, and never treat a proxied request as localloopback.main(.github/workflows/upstream-sync.yml)actions/checkout@v4, then pushed merges straight tomain.actions/checkoutto a full commit SHA and split the workflow into three separate jobs:merge(no repo code runs) →verify(drops git credentials inline before running checks) →publish(opens a PR fromsync/upstream, and fails loudly with an error if push or PR creation fails).New Settings (how to opt back into the old behavior)
We added a Security & isolation section under Settings → Threads on Web, Desktop, and Mobile (translated into all 9 non-English locales). Changing these requires the
access:writepermission:allowAgentAutoEnableScheduledTasks)false)allowOutOfWorkspaceFileReads)false)~/paths outside your known workspaces viaprojects.readFile,filesystem.getMetadata, and asset URLs.sanitizeProviderEnvironment)true)process.envto provider CLIs and provider-bound terminals.Good to know before merging
defaultRuntimeModewill now getapproval-requiredinstead offull-access. They can switch back anytime in Settings → Threads → Default permissions.remoteTransportPolicyande2eeModenow requireaccess:writeinstead ofproviders:manage, matching the three new security settings and other access controls.OPENCODE_SERVER_PASSWORDis not stripped, so OpenCode 1.x setups keep working.AWS_*keys are preserved only for Claude and Claude terminals whenCLAUDE_CODE_USE_BEDROCKis enabled (in host env, instance env, or~/.claude/settings.json). Other providers never see yourAWS_*keys.npm,pnpm,bun,mise) still receive your normal host environment so private-registry tokens continue working.How we tested it
effect-tsgo tsrs --noEmit): 0 errors acrosspackages/contracts,packages/provider-core,packages/provider-acp,packages/provider-opencode,apps/web,apps/mobile, andapps/server.vp fmtclean;node scripts/i18n-check.tspasses for web, mobile, and desktop;upstream-sync.ymlparses as valid YAML.WorkspaceFileSystem,AssetAccess,OrchestratorMcpService,mcp/toolkits/core,instanceEnvironment,OpenCode2Service,ClaudeHome,terminal/Manager,ProviderInstanceRegistryHydration,ProviderInstanceRegistry,claudeResetCredits,transportSecurity, andsettings.Built with Gemini 4 Neon (Medium) in Antigravity.