This document outlines security considerations and implementation status for OpenEncoder in production.
- Context isolation enabled
- Node integration disabled
- Preload scripts used for IPC
- Sandbox mode enabled
- Remote module disabled
- Insecure content disabled
- IPC validation at preload level
- No eval() or dynamic code execution
- Code signing (Windows, macOS)
- Notarization (macOS)
- Auto-update with signature verification
- Crash reporting (Sentry or similar)
- Security audits for FFmpeg filter chains
- Rate limiting on IPC handlers
- Path validation for file access (prevent directory traversal)
- Sandbox enabled in BrowserWindow
- No direct access to Node.js APIs from renderer
- Preload bridge validates all IPC calls
Consider adding CSP headers in preload or main process:
mainWindow.webContents.session.webRequest.onHeadersReceived((details, callback) => {
callback({
responseHeaders: {
...details.responseHeaders,
'Content-Security-Policy': [
"default-src 'self'",
"script-src 'self'",
"style-src 'self' 'unsafe-inline'",
"img-src 'self' data:"
]
}
})
})- All IPC handlers are centralized in
src/main/ipc-handlers.ts - Inputs are loosely validated; consider adding stricter validation
- No sensitive data is logged or sent to renderer unexpectedly
- File dialogs restrict selection to media files
- Output paths are validated before writing
- No direct file system access from renderer
To enable code signing for production:
- Windows: Obtain an EV code signing certificate and use
build.win.certificateFilein electron-builder config - macOS: Obtain Apple Developer certificate and configure
build.mac.identity - Linux: Package signing varies by distro
Implement electron-updater with signature verification:
npm install electron-updaterConsider integrating Sentry or similar service for production error tracking.
Run security-focused tests:
npm run test
npm run lint- FFmpeg/FFprobe: Pinned via
ffmpeg-staticandffprobe-staticfor consistency - Electron: Security updates released regularly; update quarterly or as needed
- React/TypeScript: Monitor for security advisories
If a security vulnerability is discovered:
- File a private security report
- Create a patch release with the fix
- Publish security advisory in GitHub releases
- Recommend users update immediately