Skip to content

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.

fix(workers): block internal-host navigation in the screen pool and load text2motion weights with weights_only

nirholas315e96f9619d
diff --git a/workers/agent-screen-pool/index.js b/workers/agent-screen-pool/index.js
index 3c5cbef78..55355e29a 100644
--- a/workers/agent-screen-pool/index.js
+++ b/workers/agent-screen-pool/index.js
@@ -32,7 +32,7 @@ import http from 'node:http';
import { chromium } from 'playwright';
import { pickTask } from './tasks/index.js';
import { generateNarration, runTaskSteps } from './task-runner.js';
-import { applyEvents } from './control.js';
+import { applyEvents, isNavAllowed } from './control.js';
const BASE_URL = (process.env.BASE_URL || 'https://three.ws').replace(/\/$/, '');
const WANTED_URL = process.env.WANTED_URL || `${BASE_URL}/api/agent/watch-wanted`;
@@ -175,7 +175,9 @@ async function fetchWanted() {
function resolveUrl(homeUrl, agentId) {
const u = homeUrl || `/agent/${agentId}`;
- if (/^https?:\/\//.test(u)) return u;
+ // homeUrl is agent-owner supplied: refuse loopback, private and metadata
+ // hosts so the casting browser cannot be pointed at internal services.
+ if (/^https?:\/\//.test(u)) return isNavAllowed(u) ? u : `${BASE_URL}/agent/${agentId}`;
return `${BASE_URL}${u.startsWith('/') ? '' : '/'}${u}`;
}
diff --git a/workers/model-text2motion/mdm_sampler.py b/workers/model-text2motion/mdm_sampler.py
index 44af76264..51274f2b1 100644
--- a/workers/model-text2motion/mdm_sampler.py
+++ b/workers/model-text2motion/mdm_sampler.py
@@ -93,7 +93,7 @@ class MdmSampler:
# branch (which doesn't need it) is ever reached.
dummy_data = SimpleNamespace(dataset=SimpleNamespace())
model, diffusion = create_model_and_diffusion(args, dummy_data)
- state = torch.load(os.path.join(self.model_dir, "model.pt"), map_location="cpu")
+ state = torch.load(os.path.join(self.model_dir, "model.pt"), map_location="cpu", weights_only=True)
load_model_wo_clip(model, state)
# NOT `model.to(device).eval()`: torch's Module.to() returns
# `self._apply(convert)` (verified against torch 2.3.1's own source),