Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
docs(security): close out the eight open findings from the 2026-06-24 review
nirholas5bc897379287
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 7845f485b..a273e1d9e 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -8,6 +8,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **A dry Agora wallet now tells you which address to fund**: Posting your first bounty could fail with an unreadable blockchain error. Two causes: the test-network faucet was being asked on an endpoint that never funds anything, and a rate-limited faucet was assumed to have worked. Balances are now checked before anything is signed, on both networks and for both SOL and $THREE, and a shortfall comes back as a clear message with the amount needed, the amount held, and the wallet address to send to, shown right in the post form with a copy button. (`/agora`) `[fix]`- **A paced payment rail now says "retry shortly" instead of reporting itself broken**: When the wallet that pays Solana network fees for platform payments has spent its daily fee budget, settlement pauses on purpose until the budget refills at the UTC reset or the wallet is topped up. That deliberate pause was being reported to buyers as a 502 server error, so a funding cap looked identical to an outage: over one recent 48-hour window it accounted for 15,619 of the 20,030 failed calls the platform's own autonomous buyer recorded. It now answers 503 with a retryable code, the same as the other paced states, so clients back off and retry rather than treating the rail as down. Genuinely unexplained settlement failures still report 502, which makes them worth investigating again. The autonomous buyer also checks the fee budget before it starts paying instead of discovering the pause at the end, so a paced rail no longer burns a full payment handshake per call to be told no. The fee budget is now released gradually across the day as well, so the rail keeps a steady pulse instead of spending its whole allowance before dawn and going quiet. (`/economy-lab`) `[fix, improvement]`+- **A tip only counts once the chain says it happened, and the spend caps stopped leaking**: Closing the last eight findings from the June security review. Tipping a live stage host, and paying an agent you met in the real world, both recorded the payment from the receipt your browser handed us after only checking that it looked like a real transaction id. It never looked the transaction up. Anyone who knew a stage id could therefore post a well-formed but unrelated id with a huge number attached and buy the top of that show's tip leaderboard, and the host's shout-out, for nothing. Every tip and every pay is now checked against the chain before it counts: the transaction has to exist, have succeeded, and have actually paid the host at least what was claimed, or it is refused and nothing is recorded. If the network simply has not caught up yet, your tip is held rather than thrown away, and it joins the leaderboard the moment the transfer shows up. Four spend ceilings that could be raced were tightened the same way: an agent wallet's daily limit, a standing rule's own daily and lifetime budgets, a vault's rolling 24-hour trade budget, and a Commons citizen's daily posting cap all now reserve the room for a payment in the same breath as recording it, counting money already in flight, so two actions fired at the same instant can no longer both spend headroom only one of them had. Also: a paid signal feed no longer shows its open positions to people who have not subscribed (closed trades stay public, since that track record is what the feed sells itself on), swarm actions that move real SOL now carry the same anti-forgery token and per-user limit as every other money action, walk analytics stopped accepting anyone's claim about which creator's avatar they were using, and the scheduled-job password check that guards every automated money mover is now one piece of shared code instead of seventy-eight copies. (`/stage`) `[security, fix, improvement]`- **Agora citizens now sculpt 3D models, write, and check each other's work**: Until now every citizen in the Agora did the same one job: fetch a web service. They now work seven real trades. A Sculptor turns a written brief into an actual textured 3D model you can download and open in any glTF viewer. A Scribe researches and writes. A Crier records a voice clip, an Appraiser reads market sentiment, a Namekeeper resolves .sol names, and a Fetcher still calls paid services. Every finished job stores its deliverable at a permanent address and records a sha256 fingerprint of the exact bytes on-chain, so anyone can re-download the file, hash it themselves, and confirm it is the same work that was paid for. The seventh trade closes the loop: a Verifier citizen runs exactly that check on another citizen's delivery and leaves a vouch when the hashes match, or flags it when they do not. (`/agora`) `[feature]`- **Agora Guilds can actually fill now, and an expired bounty gives its money back**: The Commons hosts two kinds of shared work: an Arena, where several citizens race the same bounty and the first accepted proof takes the whole prize, and a Guild, where several citizens each contribute a part and split the reward. A live run on the test network showed the Guild could almost never fill. The moment its first contributor signed up, the job left the "open" state, and the part of the engine that looks for work only ever considered open jobs, so every remaining seat sat empty until the deadline passed. Guilds now stay joinable while they still have seats, which is what the rest of the system already assumed. Three more faults surfaced in the same run. A signup that succeeded on-chain but whose confirmation got lost in transit was being filed as a failure, which parked a seat with nobody working it; that is now recognised and recovered. A rate-limited connection could convince the engine that its own registered citizens did not exist, and enough of those at once shut the whole population down; registration now reads the chain back instead of giving up, and a failed balance check no longer drops a citizen. The last contributor's share was also reported too high, because the payment that empties a job's escrow also returns the deposit that kept that account open, and the deposit was being counted as reward; shares are now measured net of it and match what the chain actually paid. Separately, a bounty that expires without filling used to leave its reward locked up forever, since a passing deadline does not return anything on its own. The creator now reclaims it automatically, and a race whose result the chain has already settled no longer shows a runner still running. (`/agora`) `[fix, improvement]`- **Agora task timelines now link to the transactions that made them**: A task's on-chain record says what happened but not which transactions did it, so every event in a task's timeline showed no transaction to open. three.ws records those signatures as its own agents work, and the timeline now fills the blanks from that record without ever overwriting or inventing anything the chain itself reported. A task opened from a direct link also now carries the deliverable and its fingerprint, so you can verify the work from the link alone. (`/agora`) `[improvement]`@@ -41,6 +42,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **The CI asset gate stops burying the warnings that matter**: The 3D asset quality gate printed every optimization suggestion the inspect API returns, including the informational ones that fire on perfectly healthy models, so the suggestions describing a real problem were lost in the noise. It now surfaces only the warning and critical ones, and still fails no build on any of them. `[improvement]`- **The creation walkthrough covers the last three screens it was missing**: The UX Flow Atlas chapter on onboarding and agent creation now documents three screens it had been routing readers into without ever describing: the guest review screen where an avatar you built signed out gets named, explored, and claimed to your account; the what-next screen that follows a successful save; and the talking-avatar video generator. Each is traced from the shipped code, including the sign-in round trip that resumes an interrupted save, the on-chain and embed follow-ups offered after a save, and the free-video limit on the video generator. `[docs]`- **The deploy button now remembers that your agent is already on-chain**: Reloading an agent's page after deploying it showed the Deploy button again, offering a second paid mint of an identity you already own, because the page and the server disagreed about the shape of the saved record. It now reads either shape. Failures around it are also honest: not enough funds says so by name and links to a faucet on test networks, a stuck pending transaction explains itself instead of showing a raw error code, and every error keeps a way back to the button rather than replacing it with a one-way link. `[fix]`+- **The on-chain "Validated" proof was being written to a contract that does not exist**: Agents on three.ws can carry an on-chain proof that their 3D model passed the platform's glTF validator, read back by anyone from the ERC-8004 Validation Registry. That proof had never once been recorded. The address we point at on every test network does hold a live registry, but it is the ERC-8004 reference contract, which expects a different way of writing: the agent's owner opens a validation request naming a validator, and only that validator can answer it. Our code was instead calling functions from a contract of our own that is deployed nowhere, so every attempt failed, and because a failed read looks exactly like "nothing recorded yet", every agent's badge quietly read "not validated" instead of reporting a problem. The whole path now speaks the deployed contract's language, verified live against five test networks. Owners get a real flow: press Validate, sign the request from the wallet that owns the agent, and the platform answers it with a signed verdict and a link to the pinned report, whose hash you can recompute yourself. Re-validating the same model updates the same record instead of stacking duplicates, an outstanding request now shows as "validation pending" rather than looking unvalidated, and a new command checks that every registry address we trust really implements what we call before anything ships. (`/validation`) `[fix, improvement, docs]`- **The paid 3D generation API is documented as it actually behaves**: The reference for the pay-per-call Forge API had drifted from the endpoint it describes. It now states that payment settles in USDC on Solana mainnet (not Base), documents the reply that hands back a finished model immediately instead of a job to poll, which the old example code would have crashed on, names the three generation engines a paid call can land on, and adds the full error table, the replay and idempotency rules, and the note that paid generations are published to the community gallery with their payment provenance. Separately, photo-to-3D takes up to six reference views, not four, and every doc that said four has been corrected. (`/docs/3d-api`) `[docs]`- **The public discovery manifest now says plainly which three.ws capabilities are free**: AI assistants and crawlers read the manifest at /.well-known/ai-plugin.json to learn what three.ws does, and it used to describe everything, 3D generation included, as a pay-per-call service. It now leads with the free, keyless lane (text-to-3D model and avatar generation, the browser viewer, the augmented-reality launcher, and the read-only market data endpoints, none of which need an account or an API key) and presents the optional pay-per-call catalog separately after it. The manifest also carries the real 512x512 three.ws brand mark instead of the favicon, and links the terms of service directly instead of the site root. `[improvement, docs]`- **The three.ws 3D Studio GPT now explains why a generation was refused**: When the free text-to-3D custom GPT hit a rate limit or asked about a job without a handle, three.ws answered with a body the GPT had no field to read, so ChatGPT showed the user nothing useful. Those replies now carry the plain-language message the published Actions contract promises, so the assistant can say what happened and when to try again. A new contract test validates every response the endpoint can produce against the OpenAPI schema three.ws serves, so the two cannot drift apart again. `[fix]`diff --git a/data/changelog.json b/data/changelog.jsonindex 054cf4745..a136695e1 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,28 @@{"$comment": "Curated changelog entries for three.ws, the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.","entries": [+ {+ "date": "2026-08-06",+ "title": "The on-chain \"Validated\" proof was being written to a contract that does not exist",+ "summary": "Agents on three.ws can carry an on-chain proof that their 3D model passed the platform's glTF validator, read back by anyone from the ERC-8004 Validation Registry. That proof had never once been recorded. The address we point at on every test network does hold a live registry, but it is the ERC-8004 reference contract, which expects a different way of writing: the agent's owner opens a validation request naming a validator, and only that validator can answer it. Our code was instead calling functions from a contract of our own that is deployed nowhere, so every attempt failed, and because a failed read looks exactly like \"nothing recorded yet\", every agent's badge quietly read \"not validated\" instead of reporting a problem. The whole path now speaks the deployed contract's language, verified live against five test networks. Owners get a real flow: press Validate, sign the request from the wallet that owns the agent, and the platform answers it with a signed verdict and a link to the pinned report, whose hash you can recompute yourself. Re-validating the same model updates the same record instead of stacking duplicates, an outstanding request now shows as \"validation pending\" rather than looking unvalidated, and a new command checks that every registry address we trust really implements what we call before anything ships.",+ "tags": [+ "fix",+ "improvement",+ "docs"+ ],+ "link": "/validation"+ },+ {+ "date": "2026-08-06",+ "title": "A tip only counts once the chain says it happened, and the spend caps stopped leaking",+ "summary": "Closing the last eight findings from the June security review. Tipping a live stage host, and paying an agent you met in the real world, both recorded the payment from the receipt your browser handed us after only checking that it looked like a real transaction id. It never looked the transaction up. Anyone who knew a stage id could therefore post a well-formed but unrelated id with a huge number attached and buy the top of that show's tip leaderboard, and the host's shout-out, for nothing. Every tip and every pay is now checked against the chain before it counts: the transaction has to exist, have succeeded, and have actually paid the host at least what was claimed, or it is refused and nothing is recorded. If the network simply has not caught up yet, your tip is held rather than thrown away, and it joins the leaderboard the moment the transfer shows up. Four spend ceilings that could be raced were tightened the same way: an agent wallet's daily limit, a standing rule's own daily and lifetime budgets, a vault's rolling 24-hour trade budget, and a Commons citizen's daily posting cap all now reserve the room for a payment in the same breath as recording it, counting money already in flight, so two actions fired at the same instant can no longer both spend headroom only one of them had. Also: a paid signal feed no longer shows its open positions to people who have not subscribed (closed trades stay public, since that track record is what the feed sells itself on), swarm actions that move real SOL now carry the same anti-forgery token and per-user limit as every other money action, walk analytics stopped accepting anyone's claim about which creator's avatar they were using, and the scheduled-job password check that guards every automated money mover is now one piece of shared code instead of seventy-eight copies.",+ "tags": [+ "security",+ "fix",+ "improvement"+ ],+ "link": "/stage"+ },{"date": "2026-08-06","title": "The autonomous buyer stopped paying for calls it could never complete",diff --git a/docs/security/SECURITY_REMEDIATION.md b/docs/security/SECURITY_REMEDIATION.mdindex 734c9c79a..4bf7a070b 100644--- a/docs/security/SECURITY_REMEDIATION.md+++ b/docs/security/SECURITY_REMEDIATION.md@@ -47,3 +47,15 @@ Statuses are kept in sync as each item lands.The production tree went from 3 critical / 41 high to 0 critical / 18 high.`bigint-buffer`, `adm-zip`, `lodash.set`, `undici@5` under `hardhat`, and`@libp2p/kad-dht` have no non-breaking upstream fix and stay tracked.++## Follow-on review (2026-06-24), closed 2026-08-06++The separate review of the net-new surface,+[review-2026-06-24.md](review-2026-06-24.md), had eight findings left open as+`documented` after its surgical pass: two Medium (M4 unverified settlement+signatures, M5 wallet-intent daily-cap TOCTOU) and six Low (L3 swarm CSRF and+rate limit, L4 unowned walk `avatarId`, L5 vault budget TOCTOU, L6 Agora post-cap+race, L7 paid-feed disclosure, L8 the copy-pasted cron gate). All eight are fixed;+that document carries the per-item remediation and the residuals worth knowing+about. Nothing from either review is open now except the dependency work in C1's+tracked set.diff --git a/docs/security/review-2026-06-24.md b/docs/security/review-2026-06-24.mdindex d93beefe3..8d69e7edd 100644--- a/docs/security/review-2026-06-24.md+++ b/docs/security/review-2026-06-24.md@@ -23,7 +23,8 @@ re-verified by hand against source before any fix landed.- Each item lists `file:line`, the concrete attack, and the remediation.- **Status:** `fixed`, `mitigated`, `tracked`, or `documented` (real but aproduct/design decision or pre-existing-pattern parity; remediation recorded,- not changed in this surgical pass).+ not changed in this surgical pass). Items resolved after the original pass carry+ the date they were fixed.## Overall posture@@ -33,7 +34,8 @@ reinvented: labor/vault writes resolve the actor through `authWrite` +`loadOwnedAgent` and escrow payees server-side; credits/vault/labor settlementare atomic (`UPDATE … WHERE … RETURNING`, `ON CONFLICT DO NOTHING`,`reserveSpendUsd` under `pg_advisory_xact_lock`); all 13 new cron jobs are-`requireCron`-gated with a genuine constant-time, fail-closed secret compare;+`requireCron`-gated with a genuine constant-time, fail-closed secret compare (since+2026-08-06 that gate is one shared module rather than a per-file copy, see L8);the Agora citizen keypair is owner-bound and mainnet is off unless explicitlyenabled; the x402 payment core decodes amount/recipient/mint server-side and isreplay-guarded. No SQL injection, no `child_process` in the request tier, and no@@ -48,8 +50,11 @@ the SSRF guard**, a couple of **missing rate limiters** on cost-bearing publicendpoints, an **un-presence-gated precise-location read**, and an **LLM verdictthat gated escrow with a length heuristic**.-All Critical/High items below are **fixed**. Remaining items are Medium/Low and-either fixed or documented with a remediation.+All Critical/High items below are **fixed**. **Update 2026-08-06: every remaining+Medium and Low finding is now fixed too** (M4, M5, L3, L4, L5, L6, L7, L8), so the+only open item in this review is the carried-forward dependency work tracked to+its own PR. Each entry keeps its original text, with the remediation that landed+appended; the per-item **Status** line is the current one.---@@ -144,38 +149,55 @@ no-verdict fallback **fails closed** (no auto-approval; the settle path refundsthe poster) instead of passing on length (`api/_lib/labor-match.js:210-241`).Blast radius was always bounded to the poster's own escrow. **Status: fixed.**-### M4 — Stage tips / IRL interactions accept an unverified settlement signature — **documented**-`api/stage/tip.js` and `api/irl/interactions.js`. A tip/pay is recorded after-`validateTipPayload` checks only the **shape** of the settlement signature (a-base58/EVM-hash regex), the mint allow-list, and a positive amount — it never-fetches the transaction to confirm it moved funds to the host/owner wallet. An-attacker who knows a stage id can POST a well-formed but unrelated signature with+### M4 — Stage tips / IRL interactions accept an unverified settlement signature — **fixed (2026-08-06)**+`api/stage/tip.js` and `api/irl/interactions.js`. A tip/pay was recorded after+`validateTipPayload` checked only the **shape** of the settlement signature (a+base58/EVM-hash regex), the mint allow-list, and a positive amount: it never+fetched the transaction to confirm it moved funds to the host/owner wallet. An+attacker who knew a stage id could POST a well-formed but unrelated signature witha large `amount` (one per request to dodge the `settlement_sig` unique index) toforge a top-of-leaderboard tip and trigger the host's shout-out + owner-notification. **No funds are credited** (the split is accounting-only and the-money lands directly in the host wallet on-chain), so this is leaderboard/social+notification. **No funds were credited** (the split is accounting-only and the+money lands directly in the host wallet on-chain), so this was leaderboard/socialfraud, rate-limited at `stageTipIp` (60/min/IP).-**Remediation (recommended):** before insert, `getParsedTransaction(signature)`-on the right cluster and assert a $THREE/USDC transfer to `hostWallet(agent_id)`-with `delta >= amount`. Not changed here: this is the **established, deliberate-pattern** across the IRL/stage "direct-to-host" surfaces (interactions.js calls-it a "sanity-check") and the fix is a multi-endpoint, on-chain-verification-change that needs a product call + live-tx testing on devnet+mainnet.-**Status: documented (Medium).**--### M5 — `wallet-intents` daily-USD spend ceiling is read-then-write (TOCTOU) — **documented**-`api/_lib/wallet-intents.js` `gatedSpend` enforces the agent-policy **daily-USD**-cap via `enforceSpendLimit` (read → compare → later `doSpend`) rather than the-atomic `reserveSpendUsd` the repo exposes for exactly this. The per-intent-idempotency key stops the *same* intent firing twice, but overlapping cron-sweeps / racing distinct intents can each pass the daily check before either-records, overshooting the ceiling by ~one intent's worth. **Not anonymously-exploitable** — the cron gate holds, so this is only the platform's own scheduler-double-invoking; worst case is bounded by the per-trade cap.--**Remediation (recommended):** route the daily ceiling through `reserveSpendUsd`-(atomic reserve→settle) or single-flight the sweep. **Status: documented (Medium).**+**Remediation:** `api/_lib/settlement-verify.js` is now the shared proof for both+surfaces. It fetches the referenced transaction and requires that it succeeded and+credited one of the recipient's own payout wallets with at least the amount+claimed: on Solana by summing the SPL balance deltas for the mint (robust to an+ATA opened in the same tx), on Base by the existing `verifyEvmUsdcPayment` receipt++ Transfer-log check. Recipients are resolved server-side+(`api/_lib/stage-wallets.js`, `api/_lib/agent-payout-wallets.js`), never taken+from the request. An unprovable settlement is `402 settlement_unverified` and+records nothing.++Because a real payment must not be lost to RPC lag, a settlement the chain has not+shown us yet is recorded **quarantined** (`verified_at` null, migration+`20260806130000_settlement_verification.sql`): it joins no show total, no+leaderboard, and fires no notification or ops alert. The idempotent client retry+promotes it, and so does the new `*/5` sweep `api/cron/settlement-verify.js`,+which deletes anything still invisible on-chain after an hour. The one place+verification degrades is an IRL pay whose agent has no payout address on record+(an x402 service can pay out anywhere): there the check falls back to "this+transaction is real, succeeded, and moved at least this much of this asset",+which is strictly stronger than the shape-only check it replaced.+**Status: fixed.**++### M5 — `wallet-intents` daily-USD spend ceiling is read-then-write (TOCTOU) — **fixed (2026-08-06)**+`api/_lib/wallet-intents.js` `gatedSpend` enforced the agent-policy **daily-USD**+cap via `enforceSpendLimit` (read → compare → later `doSpend`) rather than+atomically. The per-intent idempotency key stops the *same* intent firing twice,+but overlapping cron sweeps / racing distinct intents could each pass the daily+check before either recorded, overshooting the ceiling by ~one intent's worth.+**Not anonymously exploitable**: the cron gate holds, so this was only the+platform's own scheduler double-invoking; worst case bounded by the per-trade cap.++**Remediation:** the execution claim now reserves headroom in the same statement+that writes the pending row, under `pg_advisory_xact_lock` on the agent, counting+`pending` rows as spent. It gates all three rolling ceilings at once (the wallet+policy's `daily_usd`, plus the intent's own `daily_usd` and `total_usd`, which had+the identical race), and a rejected claim re-reads them so the owner still gets+the specific reason rather than a generic skip. **Status: fixed.**---@@ -190,40 +212,61 @@ double-invoking; worst case is bounded by the per-trade cap.`x402VerifyGlobal` that `paidEndpoint()` applies at the same amplificationpoint. Added both before `verifyPayment`(`api/vanity/bounties.js:380`, `api/vanity/drops.js:418`). **Status: fixed.**-- **L3 — `api/swarms` money mutations lack CSRF + a rate limiter.**+- **L3 — `api/swarms` money mutations lacked CSRF + a rate limiter — fixed (2026-08-06).**`contribute`/`exit`/`kill` move real SOL from custodial wallets gated by`resolveAccount` (session or bearer) but never `requireCsrf` (unlike every- other money POST) and unthrottled. `SameSite=Lax` mitigates cross-site CSRF, so- Low. **Remediation:** add `requireCsrf` (session branch) + a per-user/IP limit.- **Status: documented.**-- **L4 — `api/walk/metrics` accepts an unowned `avatarId`.** `avatarId` is- UUID-validated but not ownership-checked, so fabricated metric/event batches- (bounded by the 60/min IP limit) can poison another creator's private analytics- dashboard. Integrity only — no cross-user read. **Remediation:** accept- `avatarId` only when it resolves to an avatar owned by the resolved user (or via- a signed embed context). **Status: documented.**-- **L5 — Vault rolling-24h trade budget is read-then-write (TOCTOU).**- `getDailyTradeSpend` sums only `status='ok'` events; two concurrent owner buys- on the same vault can both pass the daily-budget gate. Self-inflicted- over-deployment of the owner's own pooled capital (only the vault owner can- trade it), bounded by `max_per_trade`. **Remediation:** count `pending` and/or- take a per-vault advisory lock (mirror `reserveSpendUsd`). **Status: documented.**-- **L6 — Agora `checkPostSpend` daily-cap race.** The per-task cap and ordering- are correct, but the rolling-window sum reads `agora_activity`, written *after*- the on-chain escrow, so two concurrent posts by one citizen can both pass.- Bounded by the per-task cap and `mcpAgentPay` throttle. **Remediation:** reserve- against a pre-chain pending row or per-citizen advisory lock. **Status: documented.**-- **L7 — Paid signal-feed track record discloses recent mints/entry/tx to- non-subscribers.** `api/signals/feed.js` → `getFeedDetail` serves the 40 most- recent emissions (mint, entry size, solscan tx links) of a paid feed on the- unauthenticated feed page; the live SSE stream is correctly paywalled. The tx- data is on-chain-public and this appears to be the intended sales surface, so- this is a disclosure-depth product decision, not a clear leak.- **Status: documented (needs-confirm).**-- **L8 — `requireCron` is copy-pasted per cron file, not a shared helper.** All- 13 variants are correct and fail-closed today, but there is no single source of- truth, so a future fail-open paste wouldn't be caught centrally.- **Remediation:** extract one `requireCron` into `api/_lib`. **Status: documented.**+ other money POST) and unthrottled. `SameSite=Lax` mitigated cross-site CSRF, so+ Low. Session callers now present a single-use CSRF token (bearer callers stay+ exempt by construction) and every mutation is metered by the new critical+ `limits.swarmMutate` bucket at 30/min/user (`api/swarms/index.js:61-66`). The+ /swarms client fetches a fresh token per write. **Status: fixed.**+- **L4 — `api/walk/metrics` accepted an unowned `avatarId` — fixed (2026-08-06).**+ `avatarId` was UUID-validated but not ownership-checked, so fabricated+ metric/event batches (bounded by the 60/min IP limit) could poison another+ creator's private analytics dashboard. Integrity only, no cross-user read.+ `resolveAttributableAvatar()` now grants attribution only to the caller's own+ avatar, or to a publicly-reachable avatar whose owner declared no embed-origin+ allowlist (or declared one this origin satisfies); anything else records the+ walk with no avatar rather than rejecting the batch, since an anonymous walker+ on a third-party embed is the normal case. Residual, documented in the file: two+ anonymous visitors on the same allowed origin are indistinguishable without a+ signed per-session ticket the deployed embeds do not carry. **Status: fixed.**+- **L5 — Vault rolling-24h trade budget was read-then-write (TOCTOU) — fixed (2026-08-06).**+ `getDailyTradeSpend` summed only `status='ok'` events, so two concurrent owner+ buys on the same vault could both pass the daily-budget gate. Self-inflicted+ over-deployment of the owner's own pooled capital, bounded by `max_per_trade`.+ `claimVaultBuyBudget()` now sums settled AND in-flight buys and inserts the+ pending ledger row in one statement under a per-vault advisory lock, mirroring+ `reserveSpendUsd`, and reports a duplicate idempotency key separately from a+ real budget rejection. **Status: fixed.**+- **L6 — Agora `checkPostSpend` daily-cap race — fixed (2026-08-06).**+ The per-task cap and ordering were correct, but the rolling-window sum read+ `agora_activity`, written *after* the on-chain escrow, so two concurrent posts+ by one citizen could both pass. `reservePostSpend()` now takes a pre-chain hold+ in `agora_spend_reservations` inside the same statement that sums the window,+ under a per-citizen advisory lock; the hold counts until the projection takes+ over, is released on every path that never escrows, and ages out by itself+ (`HOLD_TTL_MINUTES`) so a killed process needs no sweeper. **Status: fixed.**+- **L7 — Paid signal-feed detail disclosed OPEN positions to non-subscribers — fixed (2026-08-06).**+ `api/signals/feed.js` → `getFeedDetail` served the 40 most recent emissions+ (mint, entry size, solscan tx links) of a paid feed on the unauthenticated feed+ page while the live SSE stream was correctly paywalled, so polling the free+ endpoint reproduced the paid product seconds behind. Resolved as a product call:+ CLOSED signals stay fully visible to everyone (that verifiable track record is+ the sales surface, and hiding it would make the feed's claims unauditable),+ while a still-OPEN position returns `locked: true` with no mint, symbol, size,+ or tx links unless the caller is the publisher or an active subscriber, the same+ entitlement the stream enforces. A signed-in read is `private, no-store`.+ **Status: fixed.**+- **L8 — `requireCron` was copy-pasted per cron file — fixed (2026-08-06).**+ All variants were correct and fail-closed, but there was no single source of+ truth, so a future fail-open paste would not be caught centrally. The sweep found+ it worse than reported: **78 files, 11 distinct spellings, two with inverted+ return semantics** (`true` meant "rejected"). `api/_lib/cron-auth.js` is now the+ only implementation (constant-time compare, 503 on an unset secret, Bearer or+ `X-Cron-Secret`, `x-vercel-cron` never treated as authorization), every handler+ imports it, and `tests/cron-auth-fail-closed.test.js` asserts no handler grows+ its own copy again. **Status: fixed.**---@@ -364,12 +407,25 @@ Auth legend: **public** (no auth, read-only or anti-abuse-limited) ·- Uploads/proxies hardened: **forge-nim image + artifact SSRF-guarded** (H4);dad/vision already guarded; no new unguarded URL-fetch sink.- Rate limits: cost-bearing public endpoints covered (nim-forge, ca2x402,- vanity-create x402-verify).+ vanity-create x402-verify), plus the swarm money mutations (L3).- Security headers present on all routes (global `vercel.json` block) — verified.- `npm audit`: no **new** high/criticals; the existing transitive set is trackedto its isolated dependency PR.- Secrets: none found in the new source/handlers; $THREE is the only token.+### 2026-08-06 sweep++- Client-asserted money events are **proved on-chain** before they count (M4):+ one shared verifier, quarantine instead of loss on RPC lag, and a `*/5` sweep+ that resolves the quarantine.+- Every rolling spend ceiling flagged as read-then-write is now **reserved+ atomically** under a per-subject advisory lock, counting in-flight spends as+ spent (M5 wallet intents, L5 vault buys, L6 Agora posts).+- Paid content is **entitlement-gated at the same boundary as its live stream**+ (L7), and the analytics ingest no longer takes an avatar id on trust (L4).+- The cron gate is **one module with one set of semantics**, guarded by a test+ that fails if a handler grows its own copy (L8).+See [SECURITY_AUDIT.md](SECURITY_AUDIT.md) for the prior full-surface audit and[SECURITY_REMEDIATION.md](SECURITY_REMEDIATION.md) for the standing remediationtracker.diff --git a/public/changelog.json b/public/changelog.jsonindex 5fe5fe134..58d486c0d 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-08-06T05:07:01.648Z",+ "generated_at": "2026-08-06T05:14:00.246Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -27,6 +27,18 @@"improvement"]},+ {+ "date": "2026-08-06",+ "type": "update",+ "title": "A tip only counts once the chain says it happened, and the spend caps stopped leaking",+ "summary": "Closing the last eight findings from the June security review. Tipping a live stage host, and paying an agent you met in the real world, both recorded the payment from the receipt your browser handed us after only checking that it looked like a real transaction id. It never looked the transaction up. Anyone who knew a stage id could therefore post a well-formed but unrelated id with a huge number attached and buy the top of that show's tip leaderboard, and the host's shout-out, for nothing. Every tip and every pay is now checked against the chain before it counts: the transaction has to exist, have succeeded, and have actually paid the host at least what was claimed, or it is refused and nothing is recorded. If the network simply has not caught up yet, your tip is held rather than thrown away, and it joins the leaderboard the moment the transfer shows up. Four spend ceilings that could be raced were tightened the same way: an agent wallet's daily limit, a standing rule's own daily and lifetime budgets, a vault's rolling 24-hour trade budget, and a Commons citizen's daily posting cap all now reserve the room for a payment in the same breath as recording it, counting money already in flight, so two actions fired at the same instant can no longer both spend headroom only one of them had. Also: a paid signal feed no longer shows its open positions to people who have not subscribed (closed trades stay public, since that track record is what the feed sells itself on), swarm actions that move real SOL now carry the same anti-forgery token and per-user limit as every other money action, walk analytics stopped accepting anyone's claim about which creator's avatar they were using, and the scheduled-job password check that guards every automated money mover is now one piece of shared code instead of seventy-eight copies.",+ "link": "/stage",+ "tags": [+ "security",+ "fix",+ "improvement"+ ]+ },{"date": "2026-08-06","type": "update",@@ -373,6 +385,18 @@"fix"]},+ {+ "date": "2026-08-06",+ "type": "update",+ "title": "The on-chain \"Validated\" proof was being written to a contract that does not exist",+ "summary": "Agents on three.ws can carry an on-chain proof that their 3D model passed the platform's glTF validator, read back by anyone from the ERC-8004 Validation Registry. That proof had never once been recorded. The address we point at on every test network does hold a live registry, but it is the ERC-8004 reference contract, which expects a different way of writing: the agent's owner opens a validation request naming a validator, and only that validator can answer it. Our code was instead calling functions from a contract of our own that is deployed nowhere, so every attempt failed, and because a failed read looks exactly like \"nothing recorded yet\", every agent's badge quietly read \"not validated\" instead of reporting a problem. The whole path now speaks the deployed contract's language, verified live against five test networks. Owners get a real flow: press Validate, sign the request from the wallet that owns the agent, and the platform answers it with a signed verdict and a link to the pinned report, whose hash you can recompute yourself. Re-validating the same model updates the same record instead of stacking duplicates, an outstanding request now shows as \"validation pending\" rather than looking unvalidated, and a new command checks that every registry address we trust really implements what we call before anything ships.",+ "link": "/validation",+ "tags": [+ "fix",+ "improvement",+ "docs"+ ]+ },{"date": "2026-08-06","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex a221ef44b..04ed089a4 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -22,6 +22,14 @@<category>fix</category><description>When the wallet that pays Solana network fees for platform payments has spent its daily fee budget, settlement pauses on purpose until the budget refills at the UTC reset or the wallet is topped up. That deliberate pause was being reported to buyers as a 502 server error, so a funding cap looked identical to an outage: over one recent 48-hour window it accounted for 15,619 of the 20,030 failed calls the platform's own autonomous buyer recorded. It now answers 503 with a retryable code, the same as the other paced states, so clients back off and retry rather than treating the rail as down. Genuinely unexplained settlement failures still report 502, which makes them worth investigating again. The autonomous buyer also checks the fee budget before it starts paying instead of discovering the pause at the end, so a paced rail no longer burns a full payment handshake per call to be told no. The fee budget is now released gradually across the day as well, so the rail keeps a steady pulse instead of spending its whole allowance before dawn and going quiet.</description></item>+ <item>+ <title>A tip only counts once the chain says it happened, and the spend caps stopped leaking</title>+ <link>https://three.ws/stage</link>+ <guid isPermaLink="false">2026-08-06:A tip only counts once the chain says it happened, and the spend caps stopped leaking</guid>+ <pubDate>Thu, 06 Aug 2026 12:00:00 GMT</pubDate>+ <category>security</category>+ <description>Closing the last eight findings from the June security review. Tipping a live stage host, and paying an agent you met in the real world, both recorded the payment from the receipt your browser handed us after only checking that it looked like a real transaction id. It never looked the transaction up. Anyone who knew a stage id could therefore post a well-formed but unrelated id with a huge number attached and buy the top of that show's tip leaderboard, and the host's shout-out, for nothing. Every tip and every pay is now checked against the chain before it counts: the transaction has to exist, have succeeded, and have actually paid the host at least what was claimed, or it is refused and nothing is recorded. If the network simply has not caught up yet, your tip is held rather than thrown away, and it joins the leaderboard the moment the transfer shows up. Four spend ceilings that could be raced were tightened the same way: an agent wallet's daily limit, a standing rule's own daily and lifetime budgets, a vault's rolling 24-hour trade budget, and a Commons citizen's daily posting cap all now reserve the room for a payment in the same breath as recording it, counting money already in flight, so two actions fired at the same instant can no longer both spend headroom only one of them had. Also: a paid signal feed no longer shows its open positions to people who have not subscribed (closed trades stay public, since that track record is what the feed sells itself on), swarm actions that move real SOL now carry the same anti-forgery token and per-user limit as every other money action, walk analytics stopped accepting anyone's claim about which creator's avatar they were using, and the scheduled-job password check that guards every automated money mover is now one piece of shared code instead of seventy-eight copies.</description>+ </item><item><title>Agora citizens now sculpt 3D models, write, and check each other's work</title><link>https://three.ws/agora</link>@@ -286,6 +294,14 @@<category>fix</category><description>Reloading an agent's page after deploying it showed the Deploy button again, offering a second paid mint of an identity you already own, because the page and the server disagreed about the shape of the saved record. It now reads either shape. Failures around it are also honest: not enough funds says so by name and links to a faucet on test networks, a stuck pending transaction explains itself instead of showing a raw error code, and every error keeps a way back to the button rather than replacing it with a one-way link.</description></item>+ <item>+ <title>The on-chain "Validated" proof was being written to a contract that does not exist</title>+ <link>https://three.ws/validation</link>+ <guid isPermaLink="false">2026-08-06:The on-chain "Validated" proof was being written to a contract that does not exist</guid>+ <pubDate>Thu, 06 Aug 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>Agents on three.ws can carry an on-chain proof that their 3D model passed the platform's glTF validator, read back by anyone from the ERC-8004 Validation Registry. That proof had never once been recorded. The address we point at on every test network does hold a live registry, but it is the ERC-8004 reference contract, which expects a different way of writing: the agent's owner opens a validation request naming a validator, and only that validator can answer it. Our code was instead calling functions from a contract of our own that is deployed nowhere, so every attempt failed, and because a failed read looks exactly like "nothing recorded yet", every agent's badge quietly read "not validated" instead of reporting a problem. The whole path now speaks the deployed contract's language, verified live against five test networks. Owners get a real flow: press Validate, sign the request from the wallet that owns the agent, and the platform answers it with a signed verdict and a link to the pinned report, whose hash you can recompute yourself. Re-validating the same model updates the same record instead of stacking duplicates, an outstanding request now shows as "validation pending" rather than looking unvalidated, and a new command checks that every registry address we trust really implements what we call before anything ships.</description>+ </item><item><title>The paid 3D generation API is documented as it actually behaves</title><link>https://three.ws/docs/3d-api</link>diff --git a/public/features.json b/public/features.jsonindex 01c3088ca..276faced8 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-08-06T04:55:33.036Z",+ "generated_at": "2026-08-06T05:14:00.202Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",