radashi Allows Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
Moderate severity
GitHub Reviewed
Published
May 23, 2025
in
radashi-org/radashi
•
Updated May 27, 2025
Description
Published by the National Vulnerability Database
May 27, 2025
Published to the GitHub Advisory Database
May 27, 2025
Reviewed
May 27, 2025
Last updated
May 27, 2025
Impact
This is a prototype pollution vulnerability. It impacts users of the
set
function within the Radashi library. If an attacker can control parts of thepath
argument to theset
function, they could potentially modify the prototype of all objects in the JavaScript runtime, leading to unexpected behavior, denial of service, or even remote code execution in some specific scenarios.Patches
The vulnerability has been patched in commit
8147abc8cfc3cfe9b9a17cd389076a5d97235a66
. Users should upgrade to a version of Radashi that includes this commit. The fix utilizes a new helper function,isDangerousKey
, to prevent the use of__proto__
,prototype
, orconstructor
as keys in the path, throwing an error if any are encountered. This check is bypassed for objects with anull
prototype.Workarounds
Users on older versions can mitigate this vulnerability by sanitizing the
path
argument provided to theset
function to ensure that no part of the path string is__proto__
,prototype
, orconstructor
. For example, by checking each segment of the path before passing it to theset
function.References
8147abc8cfc3cfe9b9a17cd389076a5d97235a66
References