Skip to content

Prototype Pollution

Sam Sanoop edited this page Sep 12, 2020 · 2 revisions

Introduction

Prototype Pollution is a vulnerability affecting JavaScript. Prototype Pollution refers to the ability to inject properties into existing JavaScript language construct prototypes, such as objects. JavaScript allows all Object attributes to be altered, including their magical attributes such as _proto_, constructor and prototype. An attacker manipulates these attributes to overwrite, or pollute, a JavaScript application object prototype of the base object by injecting other values. Properties on the Object.prototype are then inherited by all the JavaScript objects through the prototype chain. When that happens, this leads to either denial of service by triggering JavaScript exceptions, or it tampers with the application source code to force the code path that the attacker injects, thereby leading to remote code execution.

Details

Within DVWS, a prototype pollution vulnerability exists within the file upload area.

dvwspp1

A prototype polltion vulnerability exists in express-fileupload <1.1.10 where if the parseNested option is enabled, it is possible to send a corrupt HTTP request which can lead to denial of service or arbitrary code execution (in some cases). More information regarding this vulnerability can be seen here: https://blog.p6.is/Real-World-JS-1/

dvwspp2

Clone this wiki locally