
Cloud Vulnerability DB
A community-led vulnerabilities database
seroval writes a RegExp as a regular expression literal or a RegExp constructor call. In affected versions, the pattern and the flags in the output are read from properties that an own property on the value can replace, and the flags are written without checks. A RegExp that received such properties can put arbitrary code into the serialized output (CWE-94, CWE-79).
These functions are affected:
serialize, serializeAsynccrossSerialize, crossSerializeAsync, crossSerializeStreamSerializer classcompileJSONfromJSON and fromCrossJSON are not affected: they rebuild the value with the RegExp constructor, which rejects invalid flags.
An application is affected only when it serializes a RegExp that has an own source or flags property set from untrusted data. Both are getter-only properties on RegExp.prototype, so plain assignment and Object.assign cannot set them. The application has to define the property itself, for example with Object.defineProperty, or wrap the RegExp in a Proxy. This is unusual, so the severity is rated Low, even though the result is script execution in the page that receives the output.
<= 1.7.5
Fixed in 1.7.6. The pattern and the flags now come from the RegExp's internal state, which properties on the value cannot change.
If you cannot upgrade, do not define source or flags properties on a RegExp from untrusted data, and do not serialize a Proxy that wraps a RegExp.
Source: NVD
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."