Repository navigation
Conversation
Game code can write the TypeTorch/settings entry, so its URLs are only trusted when the record verifies with typetorch.json's public keys (signingPublicKeys minus revokedKeys, fallbackPublicKey) or the local key files: - doctor: the owner-list check sends the admin token to the record's backend.url only when the record verified (it now also verifies with typetorch.json's keys when the key files don't load here) - experiment list: the admin token goes to typetorch.json backend.url only - backend setup: the kept ingest address and Basin streams come from a verified record only (an unverified one counts as empty, with a warning), so TYPETORCH_API_KEY / BASIN_SEND_TOKEN never reach a forged address - backend migrate --to-basin: the record's streams are used only from a verified record Audit 2026-12-05, S1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Game code can write TypeTorch/heads, deployments, seq and settings unsigned. A seq near Number.MAX_SAFE_INTEGER made the next seq unsafe, so every signed deploy threw in canonicalString and settings push --force couldn't recover. - seqstore: values above SEQ_SANE_MAX (2^40) are ignored as junk (heads, deployments, the counter's answer) - durablehead: a stored head with such a seq never blocks a real one (even with a dummy sig field) - settings --force over an untrusted record caps its seq, so seq + 1 still signs Full signature checks on stored heads stay with the kernel (Registry.luau); see the PR's "Needs your call". Audit 2026-12-05, S2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
childEnv (allowlist) was skipped by a few spawns. Children that need the user's own setup now get inheritedEnv: the real environment minus NEVER_CHILD_VARS, any value equal to a known secret, and what Bun auto-loaded from .env* files (.env.local included): - init: Claude Code (plugin add + the session) - update: the package manager (postinstall scripts) - serve: the cloudflared installer - remote-claude: the dev-server keeps only the Open Cloud key variables it hands to its deploys darkluaVersion now runs with childEnv like the other darklua calls. Audit 2026-12-05, S3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- upsertDotEnv (init) writes the game's .env with mode 0600 and tightens an existing one on POSIX - readKeyFile warns once per path when a signing key file is group/other readable, naming chmod 600 Audit 2026-12-05, S5. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eaks A game folder or Bun path with % was expanded (systemd specifiers, %NAME% in .cmd), and a line break would start a new directive or command. % is now doubled there; line breaks (and " in Windows paths) are refused. The paths are the user's own, so this is robustness more than a security boundary. Audit 2026-12-05, S6. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- OpenCloud.request throws before sending when an absolute URL isn't on https://apis.roblox.com (no caller passes one today; defense in depth), and the network-error debug line is redacted like the thrown error - ssh / the Coolify panel forward put `--` before user@host Audit 2026-12-05, S7 (partly) and S8. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Security fixes from the 2026-12-05 audit (
.audits/cli-2026-12-05.md, written by Gemini). Every finding was checked against the code first; this PR holds the security ones. Correctness and optimizations are in the companion PR (fix/audit-2026-12-05-correctness). The two branches merge cleanly.Threat model used: game code (any script in the place, dev-branch payloads included), other collaborators, and a leaked Open Cloud key with DataStore scope can all write
TypeTorch/settingsandheadswithout signing. That matches whatsettings.tsalready assumes. Note that the record's ownbackend.keyand Basintokencan be read by that same attacker, so leaking those two adds little. The admin token, the signing keys and a redirected history export are the real stakes.Findings
experiment list) and formigrate --to-basin(all history plusBASIN_SEND_TOKENstreamed to the record's URLs). Partly forbackend setup: the game key and Basin token already sit in the record, but a forged Basin URL could be checked and then signed into the recordsettingsTrust/verifySettingsTrusted/trustedBody(typetorch.jsonsigningPublicKeysminusrevokedKeys,fallbackPublicKey, plus the key files when they load). doctor sends the admin token to the record's URL only when the record verified, and now also verifies with typetorch.json's keys when no key files load.experiment listuses typetorch.jsonbackend.urlonly.backend setuptreats an unverified record as empty (with a warning).migrate --to-basintakes the record's streams only from a verified recordseqnear MAX_SAFE_INTEGER blocks deploys and--force--forcefailure are real. A "signed-looking" stored head only skips the CLI's durable-head write, and the kernel verifies heads itself, so the impact is limited to the no-server windowSEQ_SANE_MAX = 2^40: larger values from heads, deployments and the counter are ignored. Such a stored head never blocks a new one.--forcecaps an untrusted record's seqchildEnvinit(Claude Code),update(postinstall scripts) and the cloudflared installer. The dev-server already scrubs every child environment itself, so it is only defence in depth thereinheritedEnv(): the real environment minusNEVER_CHILD_VARS, secret values, and what Bun auto-loaded from.env*files (.env.localtoo). Used for those three spawns and for the dev-server, which keeps only the Open Cloud key variables it hands to its deploys.darkluaVersionnow useschildEnv--no-openprints it and--jsonemits it.--verbosewrites to the user's own terminal. Any URL opened in a browser shows up in argv.env0644; key-file mode not checkedupsertDotEnvwrites 0600 and tightens an existing file.readKeyFilewarns once per path when a key file is group- or world-readable, namingchmod 600%is doubled in systemd units and.cmdfiles. Line breaks are refused, and so is"in Windows pathshttps://apis.roblox.comare refused before sending. The network-error debug line is redacted. The redirect mode is unchanged (see below)--useris validated^[a-z_]…, souser@hostnever starts with---added anyway (one token)Maintainability M1 ("readSettings is unsafe by default") is partly covered by the
trustedBodyhelper. The rename is left for later.Needs your call
readSharedSeq,headReplaces). This would mean porting the kernel's head canonical string and bootstrap-head rules. For now: the 2^40 cap, and the kernel stays the verifier.redirect: "error"/"manual"on Open Cloud requests. Left out because I can't rule out a legitimate redirect on some endpoint without live testing.*.ingest.cloudflare.com). Signature verification already covers the forged-record case. An allowlist would break any custom host.signingPublicKeysand no key files on this machine) is now "untrusted" for these paths: doctor warns,migrate --to-basinneeds--events/--recordings, andbackend setupre-checks from scratch. The write path is unchanged: it still refuses such a record without--force..vbslauncher:WshShell.Runexpands%VAR%in the.cmdpath, and that has no escape. This only matters if the game folder contains%.Test results
bunx tsc --noEmit: passbun test: 913 pass, 4 skip, 1 fail. The failure isbackend bless > … opens the single-use link, which already fails on main (a test-isolation leak). The companion PR fixes it, and with it its full run is 912 pass, 0 fail.bun run build: pass.node scripts/smoke.mjs: all smoke checks passed.🤖 Generated with Claude Code