Advisor
Wiki Threats & Attacks Application Attacks Prototype Pollution

Prototype Pollution

1 min read
Jump to:

Summary

Prototype Pollution is a type of application attack targeting JavaScript applications by manipulating the prototype of base objects, enabling attackers to inject or modify properties that affect the behavior of all objects inheriting from that prototype. This can lead to severe security issues including privilege escalation, denial of service, and arbitrary code execution.

Key Characteristics

  • Exploits the dynamic nature of JavaScript prototypes to alter object behavior globally.
  • Targets vulnerable libraries or application code that improperly handle user input in object properties.
  • Can result in data corruption, bypassing security controls, or executing malicious code.
  • Often leverages deep object merging or property assignment functions without proper validation.
  • Primarily affects server-side and client-side JavaScript environments.

Defensive Controls

  • Validate and sanitize all user inputs, especially those used in object property assignments.
  • Use secure coding practices that avoid unsafe merging or extending of objects.
  • Keep dependencies and libraries up to date to incorporate patches for known prototype pollution vulnerabilities.
  • Implement strict property checks and avoid modifying built-in prototypes.
  • Employ runtime protection tools that detect anomalous prototype modifications.

Related Security Solutions

Security solutions relevant to mitigating Prototype Pollution include static application security testing (SAST) tools for detecting vulnerable code patterns, runtime application self-protection (RASP) for monitoring suspicious prototype changes, and dependency management tools that identify and update insecure libraries. Web application firewalls (WAFs) can also help by filtering malicious payloads that attempt prototype pollution.

Tags: Application Attacks Dependency Management JavaScript Security Prototype Pollution RASP SAST Threats & Attacks WAF web security