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.

853 B
Raw Blame
import { describe, it, expect } from 'vitest';
import http from 'node:http';
import axios from 'axios';
import { createGuardedAgents } from '../mcp-bridge/src/url-guard.js';

describe('mcp-bridge url-guard: connect-time DNS pinning', () => {
	it('refuses a hostname that resolves to loopback at connect time', async () => {
		let hit = false;
		const server = http.createServer((_req, res) => {
			hit = true;
			res.end('internal');
		});
		await new Promise((r) => server.listen(0, '127.0.0.1', r));
		const { port } = server.address();
		try {
			// "localhost" stands in for a rebinding name whose second answer is internal.
			await expect(
				axios.get(`http://localhost:${port}/`, { ...createGuardedAgents(), maxRedirects: 0 }),
			).rejects.toThrow(/private\/blocked/);
			expect(hit).toBe(false);
		} finally {
			server.close();
		}
	});
});