This release hardens how Polotno handles design JSON from untrusted sources, in the editor, polotno-node and the exporters.
If your server renders designs that your users create or upload, use these settings:
// polotno-node
await instance.jsonToImageBase64(json, {
blockPrivateNetwork: true, // no requests to localhost or private networks
allowLocalFiles: false, // reject designs that reference local files
});
// @polotno/pdf-export and @polotno/pptx-export in Node
await jsonToPDF(json, './out.pdf', { blockPrivateNetwork: true });
await jsonToPPTX(json, './out.pptx', { blockPrivateNetwork: true });This settings will be turned true by default in the next major version.
Also restrict outbound network access for the render process at the container or firewall level. Full guidance: Server-side rendering with Node.js.
