live2d-web documentation

Security and licenses

Set asset boundaries, CSP, privacy and license responsibilities.

CSP and untrusted models

Treat model3.json as an input manifest. Inspect limits, external URLs and CORS before rendering. URL inspection fetches HTTP(S) references. Browsers apply CORS; Node servers do not have a browser CORS or private-network wall, so server-side inspection of untrusted URLs requires an application host allow-list and network policy. Local archive inspection never fetches declared external URLs.

  • Allow script-src for Cubism Core.
  • Allow connect-src for model, WASM and tracking assets.
  • Allow worker-src for module Worker tracking.
  • Self-host assets and configure CORS deliberately.

Licenses and privacy

live2d-web is unofficial. Core, Framework, models and MediaPipe have separate terms. Face tracking runs on-device, but your application remains responsible for consent, indicators and any analytics it adds.

Define the trust boundary

Do not render an untrusted archive merely because its JSON parses. Inspect first, cap compressed and expanded sizes, reject traversal and unexpected external references, and serve approved files from a controlled origin. Server-side URL inspection needs outbound network restrictions in addition to an allow-list.

const report = await inspectModelSource({
  src: submittedUrl,
  limits: {
    maxAssetBytes: 32 * 1024 * 1024,
    maxTotalBytes: 128 * 1024 * 1024,
    maxReferences: 512,
  },
})
 
if (report.status === 'incompatible')
  throw new Error('The model cannot be rendered safely.')

Review before deployment

Confirm Core and every model may be distributed in the intended product, document where MediaPipe WASM and task files come from, and keep third-party notices with the application. Test CSP in report-only mode before enforcement, then verify model loading, Worker creation and camera permission without widening policies to *.