devalue: Sparse arrays emitted by uneval cause eager allocation when evaluatedGHSA-wf3x-273g-mvxv
Fix: sveltejs/devalue@6861dbbGHSA-wf3x-273g-mvxv is a security vulnerability in devalue. A fix is available for devalue — see the affected versions and patch details below.
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
devaluenpmDescription
Evaluating legitimate uneval output for a sparse array can allocate memory proportional to its declared length. A tiny serialized value can therefore cause large memory allocation in a consuming browser/runtime. This occurs during evaluation of generated code, not in default parse sparse-array construction.
You would only be affected by this if you were serializing very large sparse arrays and then evaluating the results. In the general use case for uneval of sending data to the client, the worst that could happen is the browser tab running out of memory.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | devalue | ≥ 1.0.0&&< 5.9.3 | 5.9.3npm install devalue@5.9.3 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for devalue, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update devalue to 5.9.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-wf3x-273g-mvxv is resolved across your whole dependency graph.
Workarounds
Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.
Frequently Asked Questions
Is GHSA-wf3x-273g-mvxv in your dependencies?
Find it across npm, including transitive dependencies.