Describe the bug
In main.js, the profile name is derived directly from the filename of the imported file:
const profileName = path.basename(filePath, '.json');
const profiles = settingsStore.loadProfiles();
profiles[profileName] = sanitizedProfile; // key is filename-derived
settingsStore.saveProfiles(profiles);
Importing a file named __proto__.json executes profiles['__proto__'] = sanitizedProfile, which pollutes Object.prototype with all current visualizer settings properties. This affects every plain object in the main process for the rest of the session.
To Reproduce
- Create a file named
__proto__.json with valid theme profile JSON.
- Use Paraline's Import Profile feature and select this file.
- Observe that
Object.prototype is polluted with settings properties.
Expected behavior
The profile name should be validated to reject reserved JavaScript property names (__proto__, constructor, prototype) before being used as an object key.
Describe the bug
In
main.js, the profile name is derived directly from the filename of the imported file:Importing a file named
__proto__.jsonexecutesprofiles['__proto__'] = sanitizedProfile, which pollutesObject.prototypewith all current visualizer settings properties. This affects every plain object in the main process for the rest of the session.To Reproduce
__proto__.jsonwith valid theme profile JSON.Object.prototypeis polluted with settings properties.Expected behavior
The profile name should be validated to reject reserved JavaScript property names (
__proto__,constructor,prototype) before being used as an object key.