Details
Mitigation
The patch could be:
- Blocking paths that start with
__, which represent double under (dunder) or magic variables/methods - Set a blacklist for the path, such as
RESTRICTED_KEYS = ("__globals__", "__builtins__")adopted by pydash.
Related Materials
For more information about class pollution please refer to:
[1] CWE-915: Improperly Controlled Modification of Dynamically-Determined Object Attributes
[2] Report: Class Pollution leading to RCE in pydash