VYPR
Critical severity9.8NVD Advisory· Published Apr 18, 2024· Updated Apr 15, 2026

CVE-2024-30564

CVE-2024-30564

Description

An issue inandrei-tatar nora-firebase-common between v.1.0.41 and v.1.12.2 allows a remote attacker to execute arbitrary code via a crafted script to the updateState parameter of the updateStateInternal method.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
@andrei-tatar/nora-firebase-commonnpm
>= 1.0.41, < 1.12.31.12.3

Patches

1
bf30b75d51be

simple fix for prototype pollution

2 files changed · +14 0
  • src/update-state.test.ts+9 0 modified
    @@ -222,5 +222,14 @@ describe('updateState', () => {
                 }],
             });
         });
    +
    +    it('should not update via prototype props', () => {
    +        var BAD_JSON = JSON.parse('{"__proto__":{"polluted":true}}')
    +
    +        const { hasChanges } = updateState(BAD_JSON, {})
    +
    +        expect(hasChanges).to.be.false;
    +        expect((Object.prototype as any).polluted).to.be.undefined;
    +    });
     });
     
    
  • src/update-state.ts+5 0 modified
    @@ -16,6 +16,9 @@ const arrayItemKeyMap = new Map<string, string>([
         ['currentSensorStateData', 'name'],
     ]);
     
    +// https://github.com/andrei-tatar/nora-firebase-common/issues/9
    +const ignoreKeys: any[] = ['__proto__', 'constructor', 'prototype'];
    +
     function updateArrayState(update: any[], state: any[], path = ''): boolean {
         let hasChanges = false;
     
    @@ -51,6 +54,8 @@ function updateStateInternal(update: any, state: any, path = ''): boolean {
     
         let hasChanges = false;
         for (const [key, newValue] of entries(update)) {
    +        if (ignoreKeys.includes(key)) { continue; }
    +
             const oldValue = state[key];
             const newType = typeof newValue;
             const oldType = typeof oldValue;
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

5

News mentions

0

No linked articles in our index yet.