Skip to content

Commit a37fc56

Browse files
author
NoBl
committed
security fix
1 parent 7f4d06b commit a37fc56

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,8 @@ class Senec extends utils.Adapter {
558558
* inserts a value for a given key and year into AllTimeValueStore
559559
*/
560560
async insertAllTimeHistory(system, key, year, value, einheit) {
561+
if (key === '__proto__' || key === 'constructor' || key === 'prototype') return; // Security fix
562+
if (!isNaN(year) || !isNaN(value)) return; // Security fix
561563
const pfx = "_api.Anlagen." + system + ".Statistik.AllTime.";
562564
const valueStore = pfx + "valueStore";
563565
const statsObj = await this.getStateAsync(valueStore);

0 commit comments

Comments
 (0)