Vulnerabilities in the hidden magic of Lodash, Ramda and Underscore
The utility libraries Lodash, Ramda and Underscore trust special properties on user-supplied objects, which can lead to denial of service, control flow manipulation and, in contrived cases, remote code execution. The impact depends on how the libraries are used; the maintainers of Ramda and Underscore declined to fix the issues, and Lodash did not respond.
positive.security
Published on positive.security
As mentioned in the TL;DR, the XSS/RCE case is very unlikely to occur naturally.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The libraries do not separate code from data: they read special property names from input objects and act on them, so user-controlled objects can influence internal behaviour.
Impact
Depending on usage, an attacker could crash a browser or server, bypass authorization checks, or, in highly unlikely cases, achieve remote code execution; the text notes that real-world prevalence is hard to gauge and only low to medium severity issues were found in closed-source projects.
What the attacker needed
Application passes untrusted objects to the library; attacker can control object properties
The fix
The libraries should sanitise or ignore special properties on user-supplied objects, or developers should remove those properties before passing data to the libraries; the text says Ramda and Underscore decided not to implement fixes and Lodash did not respond.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
These libraries provide helper functions that many JavaScript programs use. If a program passes data from users directly into these helpers, an attacker can include extra hidden properties in that data to make the helpers behave unexpectedly, such as using excessive memory or skipping security checks. The authors of the libraries say it is the application's job to clean the data first.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.