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.
| Package | Affected versions | Patched versions |
|---|---|---|
@andrei-tatar/nora-firebase-commonnpm | >= 1.0.41, < 1.12.3 | 1.12.3 |
Patches
1bf30b75d51besimple 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- github.com/advisories/GHSA-jjff-q3q4-5hh8ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2024-30564ghsaADVISORY
- gist.github.com/mestrtee/5dc2c948c2057f98d3de0a9790903c6cnvdWEB
- github.com/andrei-tatar/nora-firebase-common/commit/bf30b75d51be04f6c1f884561a223226c890f01bnvdWEB
- github.com/andrei-tatar/nora-firebase-common/issues/9ghsaWEB
News mentions
0No linked articles in our index yet.