Graphics technologies have changed a lot over the years, including on the web, and the web is on the cusp of its next big change with WebGPU on the horizon. In...
WebGPU is low-level, but it's designed specifically for browsers by browser makers, and security is a top design consideration. So I think it's likely to be robust even against malicious use.