You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-19 15:06:20 +00:00
🆙 Camera Security fix / small fix for beds
- Validate data URL format (must start with data:image/png) - Validate PNG magic bytes on binary data before sending - Enforce 2MB size limit matching server - Add try/catch around atob() to handle invalid base64 gracefully - Fix XSS vulnerability in editor download: replace unsafe window.open()+document.write() with safe anchor-based download that also validates data URL scheme
This commit is contained in:
@@ -3,7 +3,7 @@ import { GetAssetManager } from '@nitrots/assets';
|
||||
import { GetConfiguration } from '@nitrots/configuration';
|
||||
import { GetEventDispatcher, RoomCameraWidgetManagerEvent } from '@nitrots/events';
|
||||
import { TextureUtils } from '@nitrots/utils';
|
||||
import { BLEND_MODES, ColorMatrix, ColorMatrixFilter, Container, Filter, Sprite, Texture } from 'pixi.js';
|
||||
import { BLEND_MODES, ColorMatrix, ColorMatrixFilter, Container, Filter, RenderTexture, Sprite, Texture } from 'pixi.js';
|
||||
import { RoomCameraWidgetEffect } from './RoomCameraWidgetEffect';
|
||||
|
||||
const COLOR_MATRIX_OFFSET_INDICES = [4, 9, 14, 19] as const;
|
||||
@@ -112,7 +112,12 @@ export class RoomCameraWidgetManager implements IRoomCameraWidgetManager
|
||||
|
||||
container.filters = filters;
|
||||
|
||||
return await TextureUtils.generateImage(container);
|
||||
const resolution = texture.source.resolution || 1;
|
||||
const renderTexture = RenderTexture.create({ width: texture.width, height: texture.height, resolution });
|
||||
|
||||
TextureUtils.writeToTexture(container, renderTexture);
|
||||
|
||||
return await TextureUtils.generateImage(renderTexture);
|
||||
}
|
||||
|
||||
public get effects(): Map<string, IRoomCameraWidgetEffect>
|
||||
|
||||
Reference in New Issue
Block a user