Junglewise Threat Intelligence

Svelte devalue CPU and memory exhaustion in sparse arrays

Severity: medium · CVSS 4 · Published 2026-02-19

Executive brief

Devalue is a JavaScript library used to serialize complex data structures beyond what JSON.stringify can handle. When processing specially crafted sparse arrays, devalue's uneval or stringify functions can consume excessive CPU and memory, potentially causing a denial of service. In practice, this is difficult to exploit because an attacker would need to create a sparse array on the server—which is virtually impossible through standard web protocols—and then pass it through the vulnerable serialization functions.

Technical details

This vulnerability is a denial-of-service (DoS) issue in the sparse array handling of devalue's uneval and stringify functions (CWE-770: Allocation of Resources Without Limits or Throttling). The root cause is inefficient encoding of sparse arrays that can lead to disproportionate CPU and memory consumption during serialization. The attack vector is network-based but has a high complexity bar: an attacker must somehow create a sparse array on the server-side and trigger its serialization through devalue. This is not feasible through standard wire formats (JSON, form data, etc.), making real-world exploitation extremely unlikely. When the conditions are met, an attacker can cause the server to exhaust resources and stop responding. The fix was released in devalue version 5.6.3, which implements better encoding for sparse arrays.

Affected products

  • Svelte devalue <=5.6.2

Timeline

  • 2026-02-19: disclosed

References

Related threats