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
fix(marketplace): require a CSRF token on the four agent writes that were missing one
nirholasa3397371018a
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex d9285b1b1..511b8eb29 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -26,6 +26,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **One bad request can no longer use up the whole hourly AI-governance budget**: The Trust Layer endpoint that screens messages and proposed money moves through IBM Granite Guardian has an hourly platform-wide ceiling on how much model work it will pay for. That ceiling was being charged on every incoming request, including ones that were rejected before any model ran: a malformed body, a missing field, or a request arriving while the service is not configured. A single misbehaving client sending junk could therefore exhaust the shared budget and leave everyone else rate-limited for the rest of the hour without a single real assessment happening. The ceiling is now charged only when an assessment actually runs. Two error replies were also wrong in a way that misled callers: sending the wrong content type or a body over the size limit both came back as generic malformed JSON, so the fix looked like editing your payload when it was really a header or a smaller body. They now return the correct unsupported-media-type and payload-too-large codes, and the endpoint rejects a non-object body with a message that says so. (`/docs/okx-marketplace`) `[fix, improvement]`- **Publishing a Launchpad page can no longer be sniped by a second publisher**: Two people publishing the same Launchpad Studio address at the same moment both got a success and an edit key. Only one of those keys actually worked, and the page the other person published was quietly replaced, leaving them locked out of their own page with no way to tell. The address is now claimed by the save itself, so the first publisher keeps the page and the key that opens it, and the second is told the address is taken while their draft is untouched. Editing an existing page still needs its edit key or the account that created it, and that check now happens inside the same write, so it cannot be raced either. (`/launchpad`) `[fix, security]`- **Publishing a Launchpad page can no longer be sniped by a second publisher**: Two people publishing the same Launchpad Studio address at the same moment both got a success and an edit key. Only one of those keys actually worked, and the page the other person published was quietly replaced, leaving them locked out of their own page with no way to tell. The address is now claimed by the save itself, so the first publisher keeps the page and the key that opens it, and the second is told the address is taken while their draft is untouched. Editing an existing page still needs its edit key or the account that created it, and that check now happens inside the same write, so it cannot be raced either. (`/launchpad`) `[fix, security]`+- **Publishing, forking, bookmarking, and creating an agent are now protected against forged requests**: Every other signed-in write on three.ws (posting a review, buying a skill, pricing an asset) carries a single-use token that proves the request came from a page you were actually on. The four marketplace agent writes did not: creating an agent, forking one, bookmarking one, and publishing one. Publishing is the one that mattered most, because its request replaces an agent's system prompt, category, and tags, so an accepted forgery would change what your agent says to everyone who talks to it. All four now require the token, machine callers using an API key are unaffected, and every place in the site that performs these actions was updated to send it. (`/marketplace`) `[security, fix]`- **Rankings stops counting your own remixes, and the Daily Match board opens up to other sites**: The Remixes Received ranking on /rankings was meant to count derivatives other creators made from your work. It was also counting your own refinements of your own model, and generations that never finished, so a creator could climb the board without anyone else touching their work. It now counts only finished derivatives made by someone else, which is what the board always claimed to measure. Separately, the public Daily Match standings endpoint sent no cross-origin permission header, so any site other than three.ws that tried to read the board was blocked by the browser. It now allows any origin, matching the unified leaderboard, and both boards are covered by tests. (`/rankings`) `[fix]`- **Retro computing prompts are no longer refused by the 3D Studio safety gate**: The free 3D Studio screens every prompt for age-inappropriate content before it starts generating. That screen matched the bare abbreviation "cp" as a whole word, so ordinary modeling prompts like "a CP/M retro computer terminal" or "a CP violation physics diagram" were refused, and refused under the harshest category the screen has. The abbreviation is gone and the spelled-out terms it stood for are now matched directly, so those prompts generate normally while the genuinely harmful ones are still blocked before any work starts. `[fix]`- **Saving a mocap clip works again, and clips now resolve by their share name**: Saving or deleting a recording in Mocap Studio was rejected every time: the page was not sending the security token the platform requires on a signed-in write, so the button reported a failure no matter what you did. Both work again, and a save that does fail now tells you the actual reason instead of a bare status code. Separately, a clip can now be fetched by its short name and not just its long id, so the share link the mocap SDK has always advertised finally opens the clip, in any letter case. (`/mocap-studio`) `[fix]`@@ -49,10 +50,13 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **The Money-Cam stops going dark when its feed stumbles, and stops replaying old transfers as new light**: The Agent Galaxy renders real money moving between agent wallets: every pulse of light is one on-chain transfer you can open in an explorer. The map loads a window of recent flows, then asks every few seconds for only the ones newer than the last it saw. If the feed query failed or ran long, the map was supposed to fall back to the last good window it had built, so it kept its picture instead of blanking. It never could: the saved copy and the small update polls shared one slot, so each poll (which by design carries almost nothing) overwrote the saved window seconds after it was written, leaving nothing to fall back to. Worse, when an update poll itself failed it was answered with that saved window, which is older than what the viewer already had, so the map rewound its place in the stream and could re-animate long-past transfers as if the money were moving right now. The saved window now belongs to the full load alone. A failed update poll returns nothing new and hands the viewer's own position straight back, so it waits for the next poll instead of travelling backwards, and a failed request for older history honestly reports that there is no more to load. Separately, a fractional page size in the address bar (?limit=1.5) made the feed query fail outright and the whole galaxy report itself as quiet while it was busy; page sizes are now rounded before they are used. (`/galaxy`) `[fix]`- **The Rankings remix board now counts only real remixes from other creators**: The Remixes Received board on /rankings was meant to answer one question: how many other people built on top of your work. It was counting more than that. Every time you refined one of your own models the forge recorded the new version as a derivative of the old one, and the board counted it, so re-refining your own model climbed the ranking exactly like someone else remixing you would. Generations that failed partway through were counted too. Both are gone: a row only counts when it is a finished model made by a different creator, and an anonymous remix of your work still counts because that really is someone else. Ranks on that one metric will shift accordingly. Separately, the Daily Match standings endpoint now sends the cross-origin header the rest of our public read-only endpoints send, so anything reading the board from outside three.ws (dashboards, agent tooling, embeds) gets the data instead of a blocked request. (`/rankings`) `[fix, improvement]`- **The Reasoning Ledger stops hiding older history, and private agents stay private**: Every agent's Reasoning Ledger is a public, tamper-evident record of what it decided and why, so the reads behind it have to be honest. Three things were not. Asking for a page larger than the 200-decision maximum quietly returned a trimmed page and then reported that there was nothing after it, so a caller reading the whole history could stop early believing they had seen all of it; page sizes are now checked against the real maximum and the follow-on cursor is always correct. A malformed page cursor (a word where a sequence number belongs) came back as a generic internal error instead of saying what was wrong, and an unbounded search filter could drive a full scan of an agent's history; both now return a clear bad-request reply. And the timeline was publishing the name and picture of agents whose owners had made them private or deleted them: the decision history stays public, but an unlisted agent now appears as its id alone. The independent verification endpoint also shows the on-chain anchor even when verification fails, which is exactly when an auditor needs to see the commitment the altered history no longer matches. (`/ledger`) `[fix, security]`+- **The speech and avatar guides stopped promising formats, counts, and model orders the code does not deliver**: Five studio guides carried claims that had drifted away from the code. The Lipsync page's example asked the speech endpoint for an MP3 and saved the reply as one, but the free NVIDIA lane emits raw audio and always answers in WAV, so anyone following it ended up with a file whose name lied about its contents; the example now saves the response headers alongside the audio, and the page explains that the requested format is a request rather than a guarantee and which header tells you what you actually got. Voice Lab claimed roughly 850 voices with about 500 of them from Microsoft, a count the live Microsoft list no longer matches, and the provider tile in the voice picker quoted the same stale figure; both now point at the catalog endpoint, which reports the real per-provider totals for whatever deployment you are talking to. Voice Lab also promised synthesized clips are cached for 30 days, a limit nothing in the code sets, and now describes the cache as it actually behaves. The Genesis page described persona writing as trying a paid model first and falling back to free ones, the reverse of the platform's real free-providers-first order. And the Selfie to Avatar page attributed one step's image-quality setting to the wrong step, so both numbers it quoted belonged to code it was not describing. (`/docs/lipsync`) `[docs, fix]`- **The three.ws launchpad directory answers a bad filter instead of erroring out**: The public directory of coins launched on the three.ws bonding curve accepts an agent filter, so a page can show only the coins one agent launched. A filter value that was not a real agent id went straight to the database, which rejected it and turned the whole request into an unexplained server error. Anything that is not a valid agent id now comes back immediately as a plain validation error naming the problem, so a mistyped link fails clearly instead of looking like the launchpad is down. The endpoint documentation now states the same contract, including the page-size and offset limits, and the behaviour is pinned by tests. (`/launches`) `[fix]`- **The trial queue headline now names the mint that actually holds the most**: Trial Conversions shows sellers one headline number: the revenue waiting in the trial queue, with the token it is denominated in. Totals are kept separately per token, because ten of a six-decimal token and ten of a nine-decimal one are not the same amount, but the choice of which total to promote to the headline was made by comparing the raw stored integers across tokens. Those integers are scaled differently per token, so 0.9 of one token outranked 5 of another: a seller pricing skills in two currencies saw the smaller pile in the headline while the larger one sat below it. The totals are now compared at the same scale, so the headline is the biggest real one and the per-token list under it is ordered to match. (`/conversions`) `[fix]`- **The x402 Bazaar's service details are readable again, and its price tracker returns a stable shape**: Asking the x402 Bazaar MCP server for one service's full details produced a cramped block: the pay link sat flush against the last payment option, and a listing that advertises no payment options up front showed a bare "Payment options:" header with nothing under it. Both read properly now, and a listing with no advertised options says so and points at the 402 challenge the service returns when you call it. Search and browse results also separate a service's name from its price with a plain hyphen, matching the example output the server advertises to payers. Separately, the price-tracking tool now reports a missing price label as null on a live service instead of dropping the field, so a tracker comparing today's sample against yesterday's sees the same set of keys whether the service is still listed or gone. (`/docs/mcp-x402-bazaar`) `[fix, improvement]`- **Three trading and fact-check guides now match what the code actually does**: The Smart Money Radar guide listed the rules that earn a wallet its label but was missing the one added in August: a wallet with a sustained edge over a real sample (8 or more judged coins at a 35 percent or better win rate) counts as smart money even without a 70+ score, which is how most proven wallets qualify today. The Fact Check guide still described the old verdict math, so a reader computing an expected verdict by hand would get the wrong answer: the verdict is now read off the sources that actually took a stance, needs 70 percent agreement rather than 65, calls a single stance in otherwise-silent evidence insufficient, and scores confidence by how much of the evidence engaged the claim. That page also now lists the Google-grounded search rung at the top of its source chain and shows the real number of searches a check runs. The Guardian console guide said only a beneficiary can arm an inheritance when a guardian can too. (`/docs/smart-money`) `[docs, fix]`+- **Three tutorials quoted settings, fields, and links that had drifted from the code**: The Run TRELLIS on Your Own NVIDIA NIM guide said the high quality tier runs 40 sampling steps when the code runs 50, showed the health check reporting an empty detail string where it really returns null, left the two prompt-strength settings the proxy always sends out of the wire contract it documents, and linked an operations runbook that is not published on the site. The ERC-8004 reputation tutorial printed an MCP response carrying a totalScore field the tool has never returned, and listed the recent vouches as a bare array when the tool wraps them together with the block range it scanned; both now match the real payload. The advanced Shopify store guide pointed its persona reference at a repository file that is not reachable on the web, and pinned an older tour engine than the Tour Builder actually hands you; the link now goes to the published package documentation and the pinned version matches the builder. (`/tutorials/nvidia-nim-self-host`) `[docs, fix]`+- **Two docs pages told you to run a command that no longer exists**: The Quick Start page's tip for shrinking a large 3D model named a tool that was pulled from npm back in 2023, so the command it gave you failed instead of compressing anything. It now names the tool that is actually published, and the page also stopped claiming the avatar builder defaults to a local port; it is served from the site itself. On the ERC-8004 page, the snippet that shows you how to independently re-check a validation compared your freshly computed hash against a field the read function never returns, so the check always came back false. It now reads the field that carries the on-chain hash. The "do I need crypto" page also listed an agent's portable address in a form the resolver rejects, and now shows the form that works. (`/docs/quick-start`) `[docs, fix]`- **Your API keys now show whether they still work, and a key can no longer be issued with no permissions at all**: The API keys table in your developer dashboard listed every key you had ever created, but nothing on the row said which ones were still usable. A key you had already revoked looked exactly like a live one, right down to a Revoke button that could only ever fail, and a key that had passed its expiry date looked perfectly healthy until a request mysteriously stopped working. Every key now carries an Active, Expired, or Revoked label, dead keys are dimmed, and the Revoke button is only shown where it can do something. The connection tester also stops picking an expired key to test with. Separately, creating a key through the API with an explicitly empty permission list used to succeed and hand back a credential that could not do anything, with nothing to tell you so; that request is now rejected with a clear message, and a permission listed twice is stored once. (`/dashboard/api`) `[fix, improvement]`- **Your friends list no longer goes blank when the database is mid-upgrade, and search finds unusual names**: Two problems in the friends area. The friends list is built to survive an environment where the social tables have not been created yet: it shows an empty list instead of an error. That safety net was matching on the wording of the database error rather than its type, and the wording it looked for also appears when a single column is missing, which is what a partly-applied upgrade looks like. So during an upgrade the page answered normally and told you that you had no friends, no incoming requests, and no pending invites, with nothing anywhere reporting a fault. The safety net now recognises only a genuinely missing table, and any other database problem is reported as the error it is. Separately, friend search could not find a display name containing a backslash, and a search term ending in one quietly searched for something else, because the search was not escaping the backslash before handing the term to the database. (`/walk`) `[fix]`- **Your Memetic Launcher settings can no longer be dropped behind a success message**: The launcher's settings endpoint answered "saved" to any request whose body it could not actually read, so a badly formed save from a script or an agent looked like it worked while nothing changed. This config decides whether your launcher mints for real and how much SOL it may spend per day, so "I switched it to preview and got an OK" has to mean it is in preview. An unreadable save is now refused outright with a message naming what was wrong, and only a save the server genuinely understood reports success. (`/launcher`) `[fix]`@@ -846,14 +850,14 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Docs · Forge (text & image to 3D)** (`/docs/forge`): How the Forge turns a text prompt, photos, or a sketch into a downloadable textured 3D model (GLB): the free-first engine grid with live health status, input modes, output formats, job resume, and background generation.- **Docs · Guardian console** (`/docs/guardian`): Recover and inherit agent wallets through a threshold-approved, time-locked process that never exposes a private key.- **Docs · How the Forge works, in plain language** (`/docs/how-forge-works`): The five steps between typing a prompt and downloading a 3D model: reference image, reconstruction, engine selection, self-healing failover, and permanent storage. Plus what the quality tiers mean and what a finished model can do next.-- **Docs · Image to 3D** (`/docs/image-to-3d`): Turn 1 to 4 photos of an object into a textured GLB on the free self-hosted reconstruction lane. When to use it versus Selfie to Avatar for faces, the multi-view flow, and the API.+- **Docs · Image to 3D** (`/docs/image-to-3d`): Turn 1 to 6 photos of an object into a textured GLB on the free self-hosted reconstruction lane. When to use it versus Selfie to Avatar for faces, the multi-view flow, and the API.- **Docs · Instant Agent Genesis** (`/docs/genesis`): A prompt or a selfie becomes a rigged 3D AI agent with its own custodial Solana and EVM wallets and an optional on-chain identity, in under a minute.- **Docs · Integrations** (`/docs/integrations`): The catalog of one-script-tag embeds for any site: 3D avatar viewers, chat agents, walk companions, page narrators, live token widgets, and the MCP server.- **Docs · Lipsync** (`/docs/lipsync`): Two in-browser lipsync demos: TTS-driven mouth animation and live-mic viseme detection, both driving an avatar's viseme morph targets in real time.- **Docs · Mission Control** (`/docs/terminal`): The keyboard-first pump.fun trading terminal: the launch firehose fused with intel scores, firewall verdicts, and smart-money flow, streaming positions with live PnL, and one-keystroke guarded trading.- **Docs · Mocap Studio** (`/docs/mocap-studio`): Drive a 3D avatar's face live from your webcam in the browser: MediaPipe face landmarks mapped to ARKit blendshapes, smoothing, record and replay, and save.- **Docs · Multi-LLM Brain** (`/docs/brain`): Send one prompt to Claude, GPT, Qwen, ModelScope, Groq and more at once, with side-by-side streaming and per-model latency and token stats.-- **Docs · Restyle Studio** (`/docs/restyle`): Re-skin any GLB without regenerating its mesh: 14 PBR material presets, plain-language AI restyle, seeded colorway variants, live metalness and roughness, and a durable revertable version lineage.+- **Docs · Restyle Studio** (`/docs/restyle`): Re-skin any GLB without regenerating its mesh: 18 PBR material presets, plain-language AI restyle, seeded colorway variants, live metalness and roughness, and a durable revertable version lineage.- **Docs · Scene Capture (video to point cloud)** (`/docs/capture`): Turn a phone video of any space into an explorable coloured 3D point cloud with feed-forward reconstruction, tunable sampling parameters, and live WebGL rendering.- **Docs · Scene Composer** (`/docs/compose`): Forge props from text, attach them to your avatar's skeleton bones, arrange and scale freely, then export a GLB or save the result as a reusable outfit.- **Docs · Scene Studio** (`/docs/scene-studio`): The in-browser three.js editor: import GLBs, arrange with transform gizmos, edit materials and lights, script, and export complete glTF scenes.diff --git a/api/marketplace/[action].js b/api/marketplace/[action].jsindex 8d0ff97b1..800a87f64 100644--- a/api/marketplace/[action].js+++ b/api/marketplace/[action].js@@ -23,6 +23,7 @@ import { cors, error, json, method, readJson, wrap, rateLimited } from '../_lib/import { publicUrl, thumbnailUrl } from '../_lib/r2.js';import { pedigreeScore } from '../_lib/genome.js';import { clientIp, limits } from '../_lib/rate-limit.js';+import { requireCsrf } from '../_lib/csrf.js';import { markProviderCooldown, AUTH_COOLDOWN_SECONDS } from '../_lib/provider-health.js';import {vertexGeminiAvailable,@@ -301,6 +302,10 @@ async function handleCreate(req, res) {const auth = await resolveAuth(req);if (!auth) return error(res, 401, 'unauthorized', 'sign in required');+ // Cookie-authenticated writes need the double-submit token; bearer callers are+ // exempt inside requireCsrf (a token a browser never attaches on its own).+ if (!(await requireCsrf(req, res, auth.userId))) return;+const rl = await limits.authIp(clientIp(req));if (!rl.success) return rateLimited(res, rl);@@ -1317,6 +1322,8 @@ async function handleFork(req, res, id) {const auth = await resolveAuth(req);if (!auth) return error(res, 401, 'unauthorized', 'sign in required');+ if (!(await requireCsrf(req, res, auth.userId))) return;+const rl = await limits.authIp(clientIp(req));if (!rl.success) return rateLimited(res, rl);@@ -1365,6 +1372,8 @@ async function handleBookmark(req, res, id) {const auth = await resolveAuth(req);if (!auth) return error(res, 401, 'unauthorized', 'sign in required');+ if (!(await requireCsrf(req, res, auth.userId))) return;+const rl = await limits.authIp(clientIp(req));if (!rl.success) return rateLimited(res, rl);@@ -1390,6 +1399,8 @@ async function handlePublish(req, res, id) {const auth = await resolveAuth(req);if (!auth) return error(res, 401, 'unauthorized', 'sign in required');+ if (!(await requireCsrf(req, res, auth.userId))) return;+const rl = await limits.authIp(clientIp(req));if (!rl.success) return rateLimited(res, rl);diff --git a/data/changelog.json b/data/changelog.jsonindex 4c4ed296a..87a8b1851 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,46 @@{"$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-13",+ "title": "Three tutorials quoted settings, fields, and links that had drifted from the code",+ "summary": "The Run TRELLIS on Your Own NVIDIA NIM guide said the high quality tier runs 40 sampling steps when the code runs 50, showed the health check reporting an empty detail string where it really returns null, left the two prompt-strength settings the proxy always sends out of the wire contract it documents, and linked an operations runbook that is not published on the site. The ERC-8004 reputation tutorial printed an MCP response carrying a totalScore field the tool has never returned, and listed the recent vouches as a bare array when the tool wraps them together with the block range it scanned; both now match the real payload. The advanced Shopify store guide pointed its persona reference at a repository file that is not reachable on the web, and pinned an older tour engine than the Tour Builder actually hands you; the link now goes to the published package documentation and the pinned version matches the builder.",+ "tags": [+ "docs",+ "fix"+ ],+ "link": "/tutorials/nvidia-nim-self-host"+ },+ {+ "date": "2026-08-13",+ "title": "The speech and avatar guides stopped promising formats, counts, and model orders the code does not deliver",+ "summary": "Five studio guides carried claims that had drifted away from the code. The Lipsync page's example asked the speech endpoint for an MP3 and saved the reply as one, but the free NVIDIA lane emits raw audio and always answers in WAV, so anyone following it ended up with a file whose name lied about its contents; the example now saves the response headers alongside the audio, and the page explains that the requested format is a request rather than a guarantee and which header tells you what you actually got. Voice Lab claimed roughly 850 voices with about 500 of them from Microsoft, a count the live Microsoft list no longer matches, and the provider tile in the voice picker quoted the same stale figure; both now point at the catalog endpoint, which reports the real per-provider totals for whatever deployment you are talking to. Voice Lab also promised synthesized clips are cached for 30 days, a limit nothing in the code sets, and now describes the cache as it actually behaves. The Genesis page described persona writing as trying a paid model first and falling back to free ones, the reverse of the platform's real free-providers-first order. And the Selfie to Avatar page attributed one step's image-quality setting to the wrong step, so both numbers it quoted belonged to code it was not describing.",+ "tags": [+ "docs",+ "fix"+ ],+ "link": "/docs/lipsync"+ },+ {+ "date": "2026-08-13",+ "title": "Publishing, forking, bookmarking, and creating an agent are now protected against forged requests",+ "summary": "Every other signed-in write on three.ws (posting a review, buying a skill, pricing an asset) carries a single-use token that proves the request came from a page you were actually on. The four marketplace agent writes did not: creating an agent, forking one, bookmarking one, and publishing one. Publishing is the one that mattered most, because its request replaces an agent's system prompt, category, and tags, so an accepted forgery would change what your agent says to everyone who talks to it. All four now require the token, machine callers using an API key are unaffected, and every place in the site that performs these actions was updated to send it.",+ "tags": [+ "security",+ "fix"+ ],+ "link": "/marketplace"+ },+ {+ "date": "2026-08-13",+ "title": "Two docs pages told you to run a command that no longer exists",+ "summary": "The Quick Start page's tip for shrinking a large 3D model named a tool that was pulled from npm back in 2023, so the command it gave you failed instead of compressing anything. It now names the tool that is actually published, and the page also stopped claiming the avatar builder defaults to a local port; it is served from the site itself. On the ERC-8004 page, the snippet that shows you how to independently re-check a validation compared your freshly computed hash against a field the read function never returns, so the check always came back false. It now reads the field that carries the on-chain hash. The \"do I need crypto\" page also listed an agent's portable address in a form the resolver rejects, and now shows the form that works.",+ "tags": [+ "docs",+ "fix"+ ],+ "link": "/docs/quick-start"+ },{"date": "2026-08-13","title": "The Alibaba Cloud Marketplace blog post was missing the site footer",diff --git a/public/changelog.json b/public/changelog.jsonindex 48c1046cf..5721ca8a3 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-08-13T06:34:39.535Z",+ "generated_at": "2026-08-13T06:40:53.912Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -217,6 +217,17 @@"security"]},+ {+ "date": "2026-08-13",+ "type": "update",+ "title": "Publishing, forking, bookmarking, and creating an agent are now protected against forged requests",+ "summary": "Every other signed-in write on three.ws (posting a review, buying a skill, pricing an asset) carries a single-use token that proves the request came from a page you were actually on. The four marketplace agent writes did not: creating an agent, forking one, bookmarking one, and publishing one. Publishing is the one that mattered most, because its request replaces an agent's system prompt, category, and tags, so an accepted forgery would change what your agent says to everyone who talks to it. All four now require the token, machine callers using an API key are unaffected, and every place in the site that performs these actions was updated to send it.",+ "link": "/marketplace",+ "tags": [+ "security",+ "fix"+ ]+ },{"date": "2026-08-13","type": "update",@@ -461,6 +472,17 @@"security"]},+ {+ "date": "2026-08-13",+ "type": "update",+ "title": "The speech and avatar guides stopped promising formats, counts, and model orders the code does not deliver",+ "summary": "Five studio guides carried claims that had drifted away from the code. The Lipsync page's example asked the speech endpoint for an MP3 and saved the reply as one, but the free NVIDIA lane emits raw audio and always answers in WAV, so anyone following it ended up with a file whose name lied about its contents; the example now saves the response headers alongside the audio, and the page explains that the requested format is a request rather than a guarantee and which header tells you what you actually got. Voice Lab claimed roughly 850 voices with about 500 of them from Microsoft, a count the live Microsoft list no longer matches, and the provider tile in the voice picker quoted the same stale figure; both now point at the catalog endpoint, which reports the real per-provider totals for whatever deployment you are talking to. Voice Lab also promised synthesized clips are cached for 30 days, a limit nothing in the code sets, and now describes the cache as it actually behaves. The Genesis page described persona writing as trying a paid model first and falling back to free ones, the reverse of the platform's real free-providers-first order. And the Selfie to Avatar page attributed one step's image-quality setting to the wrong step, so both numbers it quoted belonged to code it was not describing.",+ "link": "/docs/lipsync",+ "tags": [+ "docs",+ "fix"+ ]+ },{"date": "2026-08-13","type": "update",@@ -503,6 +525,28 @@"fix"]},+ {+ "date": "2026-08-13",+ "type": "update",+ "title": "Three tutorials quoted settings, fields, and links that had drifted from the code",+ "summary": "The Run TRELLIS on Your Own NVIDIA NIM guide said the high quality tier runs 40 sampling steps when the code runs 50, showed the health check reporting an empty detail string where it really returns null, left the two prompt-strength settings the proxy always sends out of the wire contract it documents, and linked an operations runbook that is not published on the site. The ERC-8004 reputation tutorial printed an MCP response carrying a totalScore field the tool has never returned, and listed the recent vouches as a bare array when the tool wraps them together with the block range it scanned; both now match the real payload. The advanced Shopify store guide pointed its persona reference at a repository file that is not reachable on the web, and pinned an older tour engine than the Tour Builder actually hands you; the link now goes to the published package documentation and the pinned version matches the builder.",+ "link": "/tutorials/nvidia-nim-self-host",+ "tags": [+ "docs",+ "fix"+ ]+ },+ {+ "date": "2026-08-13",+ "type": "update",+ "title": "Two docs pages told you to run a command that no longer exists",+ "summary": "The Quick Start page's tip for shrinking a large 3D model named a tool that was pulled from npm back in 2023, so the command it gave you failed instead of compressing anything. It now names the tool that is actually published, and the page also stopped claiming the avatar builder defaults to a local port; it is served from the site itself. On the ERC-8004 page, the snippet that shows you how to independently re-check a validation compared your freshly computed hash against a field the read function never returns, so the check always came back false. It now reads the field that carries the on-chain hash. The \"do I need crypto\" page also listed an agent's portable address in a form the resolver rejects, and now shows the form that works.",+ "link": "/docs/quick-start",+ "tags": [+ "docs",+ "fix"+ ]+ },{"date": "2026-08-13","type": "update",@@ -8063,7 +8107,7 @@"date": "2026-07-18","type": "launch","title": "Docs · Image to 3D",- "summary": "Turn 1 to 4 photos of an object into a textured GLB on the free self-hosted reconstruction lane. When to use it versus Selfie to Avatar for faces, the multi-view flow, and the API.",+ "summary": "Turn 1 to 6 photos of an object into a textured GLB on the free self-hosted reconstruction lane. When to use it versus Selfie to Avatar for faces, the multi-view flow, and the API.","link": "/docs/image-to-3d","tags": ["launch"@@ -8133,7 +8177,7 @@"date": "2026-07-18","type": "launch","title": "Docs · Restyle Studio",- "summary": "Re-skin any GLB without regenerating its mesh: 14 PBR material presets, plain-language AI restyle, seeded colorway variants, live metalness and roughness, and a durable revertable version lineage.",+ "summary": "Re-skin any GLB without regenerating its mesh: 18 PBR material presets, plain-language AI restyle, seeded colorway variants, live metalness and roughness, and a durable revertable version lineage.","link": "/docs/restyle","tags": ["launch"diff --git a/public/changelog.xml b/public/changelog.xmlindex 2ff8b6cf2..12ee296ea 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -166,6 +166,14 @@<category>fix</category><description>Two people publishing the same Launchpad Studio address at the same moment both got a success and an edit key. Only one of those keys actually worked, and the page the other person published was quietly replaced, leaving them locked out of their own page with no way to tell. The address is now claimed by the save itself, so the first publisher keeps the page and the key that opens it, and the second is told the address is taken while their draft is untouched. Editing an existing page still needs its edit key or the account that created it, and that check now happens inside the same write, so it cannot be raced either.</description></item>+ <item>+ <title>Publishing, forking, bookmarking, and creating an agent are now protected against forged requests</title>+ <link>https://three.ws/marketplace</link>+ <guid isPermaLink="false">2026-08-13:Publishing, forking, bookmarking, and creating an agent are now protected against forged requests</guid>+ <pubDate>Thu, 13 Aug 2026 12:00:00 GMT</pubDate>+ <category>security</category>+ <description>Every other signed-in write on three.ws (posting a review, buying a skill, pricing an asset) carries a single-use token that proves the request came from a page you were actually on. The four marketplace agent writes did not: creating an agent, forking one, bookmarking one, and publishing one. Publishing is the one that mattered most, because its request replaces an agent's system prompt, category, and tags, so an accepted forgery would change what your agent says to everyone who talks to it. All four now require the token, machine callers using an API key are unaffected, and every place in the site that performs these actions was updated to send it.</description>+ </item><item><title>Rankings stops counting your own remixes, and the Daily Match board opens up to other sites</title><link>https://three.ws/rankings</link>@@ -350,6 +358,14 @@<category>fix</category><description>Every agent's Reasoning Ledger is a public, tamper-evident record of what it decided and why, so the reads behind it have to be honest. Three things were not. Asking for a page larger than the 200-decision maximum quietly returned a trimmed page and then reported that there was nothing after it, so a caller reading the whole history could stop early believing they had seen all of it; page sizes are now checked against the real maximum and the follow-on cursor is always correct. A malformed page cursor (a word where a sequence number belongs) came back as a generic internal error instead of saying what was wrong, and an unbounded search filter could drive a full scan of an agent's history; both now return a clear bad-request reply. And the timeline was publishing the name and picture of agents whose owners had made them private or deleted them: the decision history stays public, but an unlisted agent now appears as its id alone. The independent verification endpoint also shows the on-chain anchor even when verification fails, which is exactly when an auditor needs to see the commitment the altered history no longer matches.</description></item>+ <item>+ <title>The speech and avatar guides stopped promising formats, counts, and model orders the code does not deliver</title>+ <link>https://three.ws/docs/lipsync</link>+ <guid isPermaLink="false">2026-08-13:The speech and avatar guides stopped promising formats, counts, and model orders the code does not deliver</guid>+ <pubDate>Thu, 13 Aug 2026 12:00:00 GMT</pubDate>+ <category>docs</category>+ <description>Five studio guides carried claims that had drifted away from the code. The Lipsync page's example asked the speech endpoint for an MP3 and saved the reply as one, but the free NVIDIA lane emits raw audio and always answers in WAV, so anyone following it ended up with a file whose name lied about its contents; the example now saves the response headers alongside the audio, and the page explains that the requested format is a request rather than a guarantee and which header tells you what you actually got. Voice Lab claimed roughly 850 voices with about 500 of them from Microsoft, a count the live Microsoft list no longer matches, and the provider tile in the voice picker quoted the same stale figure; both now point at the catalog endpoint, which reports the real per-provider totals for whatever deployment you are talking to. Voice Lab also promised synthesized clips are cached for 30 days, a limit nothing in the code sets, and now describes the cache as it actually behaves. The Genesis page described persona writing as trying a paid model first and falling back to free ones, the reverse of the platform's real free-providers-first order. And the Selfie to Avatar page attributed one step's image-quality setting to the wrong step, so both numbers it quoted belonged to code it was not describing.</description>+ </item><item><title>The three.ws launchpad directory answers a bad filter instead of erroring out</title><link>https://three.ws/launches</link>@@ -382,6 +398,22 @@<category>docs</category><description>The Smart Money Radar guide listed the rules that earn a wallet its label but was missing the one added in August: a wallet with a sustained edge over a real sample (8 or more judged coins at a 35 percent or better win rate) counts as smart money even without a 70+ score, which is how most proven wallets qualify today. The Fact Check guide still described the old verdict math, so a reader computing an expected verdict by hand would get the wrong answer: the verdict is now read off the sources that actually took a stance, needs 70 percent agreement rather than 65, calls a single stance in otherwise-silent evidence insufficient, and scores confidence by how much of the evidence engaged the claim. That page also now lists the Google-grounded search rung at the top of its source chain and shows the real number of searches a check runs. The Guardian console guide said only a beneficiary can arm an inheritance when a guardian can too.</description></item>+ <item>+ <title>Three tutorials quoted settings, fields, and links that had drifted from the code</title>+ <link>https://three.ws/tutorials/nvidia-nim-self-host</link>+ <guid isPermaLink="false">2026-08-13:Three tutorials quoted settings, fields, and links that had drifted from the code</guid>+ <pubDate>Thu, 13 Aug 2026 12:00:00 GMT</pubDate>+ <category>docs</category>+ <description>The Run TRELLIS on Your Own NVIDIA NIM guide said the high quality tier runs 40 sampling steps when the code runs 50, showed the health check reporting an empty detail string where it really returns null, left the two prompt-strength settings the proxy always sends out of the wire contract it documents, and linked an operations runbook that is not published on the site. The ERC-8004 reputation tutorial printed an MCP response carrying a totalScore field the tool has never returned, and listed the recent vouches as a bare array when the tool wraps them together with the block range it scanned; both now match the real payload. The advanced Shopify store guide pointed its persona reference at a repository file that is not reachable on the web, and pinned an older tour engine than the Tour Builder actually hands you; the link now goes to the published package documentation and the pinned version matches the builder.</description>+ </item>+ <item>+ <title>Two docs pages told you to run a command that no longer exists</title>+ <link>https://three.ws/docs/quick-start</link>+ <guid isPermaLink="false">2026-08-13:Two docs pages told you to run a command that no longer exists</guid>+ <pubDate>Thu, 13 Aug 2026 12:00:00 GMT</pubDate>+ <category>docs</category>+ <description>The Quick Start page's tip for shrinking a large 3D model named a tool that was pulled from npm back in 2023, so the command it gave you failed instead of compressing anything. It now names the tool that is actually published, and the page also stopped claiming the avatar builder defaults to a local port; it is served from the site itself. On the ERC-8004 page, the snippet that shows you how to independently re-check a validation compared your freshly computed hash against a field the read function never returns, so the check always came back false. It now reads the field that carries the on-chain hash. The "do I need crypto" page also listed an agent's portable address in a form the resolver rejects, and now shows the form that works.</description>+ </item><item><title>Your API keys now show whether they still work, and a key can no longer be issued with no permissions at all</title><link>https://three.ws/dashboard/api</link>@@ -6132,7 +6164,7 @@<guid isPermaLink="false">2026-07-18:Docs · Image to 3D</guid><pubDate>Sat, 18 Jul 2026 12:00:00 GMT</pubDate><category>launch</category>- <description>Turn 1 to 4 photos of an object into a textured GLB on the free self-hosted reconstruction lane. When to use it versus Selfie to Avatar for faces, the multi-view flow, and the API.</description>+ <description>Turn 1 to 6 photos of an object into a textured GLB on the free self-hosted reconstruction lane. When to use it versus Selfie to Avatar for faces, the multi-view flow, and the API.</description></item><item><title>Docs · Instant Agent Genesis</title>@@ -6188,7 +6220,7 @@<guid isPermaLink="false">2026-07-18:Docs · Restyle Studio</guid><pubDate>Sat, 18 Jul 2026 12:00:00 GMT</pubDate><category>launch</category>- <description>Re-skin any GLB without regenerating its mesh: 14 PBR material presets, plain-language AI restyle, seeded colorway variants, live metalness and roughness, and a durable revertable version lineage.</description>+ <description>Re-skin any GLB without regenerating its mesh: 18 PBR material presets, plain-language AI restyle, seeded colorway variants, live metalness and roughness, and a durable revertable version lineage.</description></item><item><title>Docs · Scene Capture (video to point cloud)</title>diff --git a/src/avatar-page.js b/src/avatar-page.jsindex 91909621f..812098794 100644--- a/src/avatar-page.js+++ b/src/avatar-page.js@@ -11,6 +11,7 @@ import { openTalkMode } from './voice/talk-mode.js';import { downloadAvatar } from './avatar-export.js';import { fbxFromUrl } from './remesh-convert.js';import { safeUrl } from './safe-url.js';+import { apiFetch } from './api.js';import { log } from './shared/log.js';import { emptyStateHTML, errorStateHTML } from './shared/state-kit.js';import { mountViewSwitcher } from './view-switcher.js';@@ -1302,22 +1303,21 @@ async function startAgentWithAvatar() {capabilities: { skills: skillsArr, library: [], bullets: [] },avatar_id: avatar.id || avatarId,};- const r = await fetch('/api/marketplace/agents', {+ // apiFetch attaches the single-use CSRF token every marketplace write needs.+ const r = await apiFetch('/api/marketplace/agents', {method: 'POST',headers: { 'content-type': 'application/json' },- credentials: 'include',body: JSON.stringify(body),});- if (r.status === 401) {- location.href = `/login?next=${encodeURIComponent(location.pathname + location.search)}`;- return;- }const j = await r.json();if (!r.ok) throw new Error(j.error_description || j.error || 'Failed to create agent');const newId = j?.data?.agent?.id;if (!newId) throw new Error('Server did not return new agent id');location.href = `/agent/${encodeURIComponent(newId)}/edit`;} catch (err) {+ // A signed-out caller is already on its way to /login (apiFetch owns that+ // redirect), so there is nothing to say and nothing to retry.+ if (err?.redirected) return;log.error('[avatar] start agent', err);btn.textContent = original;btn.disabled = false;diff --git a/src/dashboard-next/pages/library/brain.js b/src/dashboard-next/pages/library/brain.jsindex 0f1b23a55..09dbadfd2 100644--- a/src/dashboard-next/pages/library/brain.js+++ b/src/dashboard-next/pages/library/brain.js@@ -2,7 +2,7 @@// Per-agent LLM brain configurator: pick a model, edit the system prompt,// and live-test the brain against streaming responses — all from the dashboard.-import { get, put, esc } from '../../api.js';+import { get, put, post, esc } from '../../api.js';import { emptyStateHTML, errorStateHTML, attachRetry, ensureStateKitStyles } from '../../../shared/state-kit.js';import { renderMarkdown } from '../../../shared/markdown.js';ensureStateKitStyles();@@ -513,16 +513,12 @@ export async function renderBrain(host) {promptStatus.textContent = 'Saving…';promptStatus.className = 'br-status';try {- const r = await fetch(`/api/marketplace/agents/${encodeURIComponent(agent.id)}/publish`, {- method: 'POST',- headers: { 'content-type': 'application/json' },- credentials: 'include',- body: JSON.stringify({ system_prompt: newPrompt, category }),+ // post() attaches the single-use CSRF token this endpoint requires and+ // raises an ApiError that friendly() already knows how to phrase.+ await post(`/api/marketplace/agents/${encodeURIComponent(agent.id)}/publish`, {+ system_prompt: newPrompt,+ category,});- if (!r.ok) {- const j = await r.json().catch(() => ({}));- throw new Error(j.message || j.error || `HTTP ${r.status}`);- }agent.system_prompt = newPrompt;agent.category = category;promptStatus.textContent = 'Saved.';diff --git a/tests/api/marketplace-agents-csrf.test.js b/tests/api/marketplace-agents-csrf.test.jsnew file mode 100644index 000000000..c37b59454--- /dev/null+++ b/tests/api/marketplace-agents-csrf.test.js@@ -0,0 +1,167 @@+// Every state-changing route on /api/marketplace/agents must carry the+// double-submit CSRF token.+//+// These four writes (create, fork, bookmark, publish) were the only cookie-authed+// mutations in the marketplace that did not ask for one, while their siblings+// (reviews, purchase, asset-price) all did. Publish is the sharp end: its body+// replaces the agent's system prompt, category, and tags, so an unguarded write+// rewrites what the agent says to everyone who talks to it.+//+// The real api/_lib/csrf.js runs here on a stubbed database, so this exercises the+// actual token check rather than a restatement of it. Bearer callers stay exempt:+// a browser never attaches an Authorization header on its own.++import { describe, it, expect, vi, beforeEach } from 'vitest';+import { Readable } from 'node:stream';++const authState = { session: { id: 'aaaa0000-0000-0000-0000-000000000001' }, bearer: null };+vi.mock('../../api/_lib/auth.js', () => ({+ getSessionUser: vi.fn(async () => authState.session),+ authenticateBearer: vi.fn(async () => authState.bearer),+ extractBearer: vi.fn((req) => {+ const h = req?.headers?.authorization || '';+ return h.startsWith('Bearer ') ? h.slice(7) : null;+ }),+}));++const sqlQueue = [];+const sqlCalls = [];+vi.mock('../../api/_lib/db.js', () => ({+ sql: Object.assign(+ vi.fn(async (strings) => {+ sqlCalls.push(Array.isArray(strings) ? strings.join('?') : String(strings));+ return sqlQueue.length ? sqlQueue.shift() : [];+ }),+ { transaction: vi.fn(async (fns) => Promise.all(fns)) },+ ),+ isDbUnavailableError: () => false,+ isDbCapacityError: () => false,+}));++const rlState = { success: true };+vi.mock('../../api/_lib/rate-limit.js', () => ({+ limits: {+ authIp: vi.fn(async () => rlState),+ widgetRead: vi.fn(async () => rlState),+ previewIp: vi.fn(async () => rlState),+ previewAgent: vi.fn(async () => rlState),+ },+ clientIp: vi.fn(() => '127.0.0.1'),+}));++vi.mock('../../api/_lib/redis.js', () => ({ getRedis: async () => null }));+vi.mock('../../api/_lib/skill-price-cache.js', () => ({+ getSkillPrices: async () => [],+ skillPriceMap: () => ({}),+}));+vi.mock('../../api/_lib/nft-gate.js', () => ({ viewerNftGatedSkills: async () => [] }));++// ── Helpers ──────────────────────────────────────────────────────────────────++const AGENT_ID = '11111111-2222-3333-4444-555555555555';+const USER_ID = 'aaaa0000-0000-0000-0000-000000000001';++function makeReq(method, url, { body = null, headers = {} } = {}) {+ const s = body ? Readable.from([Buffer.from(JSON.stringify(body))]) : Readable.from([]);+ s.method = method;+ s.url = url;+ s.headers = { host: 'localhost', 'content-type': 'application/json', ...headers };+ return s;+}++function makeRes() {+ return {+ statusCode: 200,+ headers: {},+ body: '',+ writableEnded: false,+ setHeader(k, v) { this.headers[k.toLowerCase()] = v; },+ end(chunk) { if (chunk != null) this.body += chunk; this.writableEnded = true; },+ };+}++async function invoke(req, res) {+ const { default: handler } = await import('../../api/marketplace/[action].js');+ await handler(req, res);+ let json = {};+ try { json = JSON.parse(res.body); } catch { /* empty body */ }+ return { res, json };+}++// A valid token: requireCsrf consumes it with DELETE ... RETURNING user_id.+const VALID_TOKEN = { 'x-csrf-token': 'a'.repeat(64) };+const tokenAccepted = () => sqlQueue.push([{ user_id: USER_ID }]);++beforeEach(() => {+ sqlQueue.length = 0;+ sqlCalls.length = 0;+ authState.session = { id: USER_ID };+ authState.bearer = null;+ rlState.success = true;+});++// Each entry is one cookie-authed mutation the browser can reach.+const WRITES = [+ { name: 'create', method: 'POST', url: '/api/marketplace/agents', body: { name: 'A', description: 'B', system_prompt: 'C' } },+ { name: 'fork', method: 'POST', url: `/api/marketplace/agents/${AGENT_ID}/fork` },+ { name: 'bookmark add', method: 'POST', url: `/api/marketplace/agents/${AGENT_ID}/bookmark` },+ { name: 'bookmark drop', method: 'DELETE', url: `/api/marketplace/agents/${AGENT_ID}/bookmark` },+ { name: 'publish', method: 'POST', url: `/api/marketplace/agents/${AGENT_ID}/publish`, body: { category: 'general' } },+];++describe('/api/marketplace/agents writes require a CSRF token', () => {+ for (const w of WRITES) {+ it(`rejects ${w.name} with no token`, async () => {+ const { res, json } = await invoke(makeReq(w.method, w.url, { body: w.body }), makeRes());+ expect(res.statusCode).toBe(403);+ expect(json.error).toBe('csrf_missing');+ // Nothing was written, and nothing was even read.+ expect(sqlCalls).toHaveLength(0);+ });++ it(`rejects ${w.name} with a token the server does not hold`, async () => {+ sqlQueue.push([]); // the consuming DELETE matches no row+ const { res, json } = await invoke(+ makeReq(w.method, w.url, { body: w.body, headers: VALID_TOKEN }),+ makeRes(),+ );+ expect(res.statusCode).toBe(403);+ expect(json.error).toBe('csrf_invalid');+ });+ }++ it('still requires a session before it looks at the token', async () => {+ authState.session = null;+ const { res, json } = await invoke(+ makeReq('POST', `/api/marketplace/agents/${AGENT_ID}/fork`),+ makeRes(),+ );+ expect(res.statusCode).toBe(401);+ expect(json.error).toBe('unauthorized');+ });++ it('accepts a bookmark carrying a valid token', async () => {+ tokenAccepted();+ sqlQueue.push([]); // INSERT ... ON CONFLICT DO NOTHING+ const { res, json } = await invoke(+ makeReq('POST', `/api/marketplace/agents/${AGENT_ID}/bookmark`, { headers: VALID_TOKEN }),+ makeRes(),+ );+ expect(res.statusCode).toBe(200);+ expect(json.data).toEqual({ bookmarked: true });+ });++ it('exempts a bearer caller, which no browser sends by itself', async () => {+ authState.session = null;+ authState.bearer = { userId: USER_ID };+ sqlQueue.push([]); // INSERT ... ON CONFLICT DO NOTHING+ const { res, json } = await invoke(+ makeReq('POST', `/api/marketplace/agents/${AGENT_ID}/bookmark`, {+ headers: { authorization: 'Bearer machine-token' },+ }),+ makeRes(),+ );+ expect(res.statusCode).toBe(200);+ expect(json.data).toEqual({ bookmarked: true });+ });+});