[klona] Prototype pollution
The klona deep-clone library before version 1.1.1 allowed a crafted object to add arbitrary properties to the JavaScript Object prototype during cloning. An attacker could use this to cause denial of service or possibly remote code execution by overriding methods such as toString.
- Fixed in 3 days
- Disclosed after 3 days
I would like to report Prototype pollution in klona It allows adding arbitrary property to Prototype while deep cloning an object
Module
module name: klona
version: <1.1.1
npm page: https://www.npmjs.com/package/klona
Module Description
A tiny (366B) and fast utility to "deep clone" Objects, Arrays, Dates, RegExps, and more!
Module Stats
356 weekly downloads
Vulnerability
Vulnerability Description
See: https://snyk.io/vuln/SNYK-JS-LODASH-450202
Steps To Reproduce:
Described here: https://github.com/lukeed/klona/pull/11/files
Note: This vulnerability was reported directly to owner here https://github.com/lukeed/klona/pull/11 on 10/01/2020. Fix published in v1.1.1 on 15/01/2020
Wrap up
- I contacted the maintainer to let them know: Y
- I opened an issue in the related repository: Y
Hunter's comments and funny memes goes here

Impact
Denial of Service and possible Remote code execution by overriding object's property methods like toString
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
An attacker could cause denial of service and possibly remote code execution by overriding object property methods like toString.
What the attacker needed
Attacker-controlled object passed to klona; klona version below 1.1.1
The fix
The issue was fixed in version 1.1.1.
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 report has not been written yet. The Original tab links to the source.
JavaScript objects inherit shared defaults from a 'prototype' object. If a program copies attacker-supplied data into that shared prototype, every object in the program can be changed, which can break the app or let an attacker run their own code. Here the copying happened inside a small library used to make deep copies of objects.
What is Prototype pollution?
Input changes JavaScript's shared object prototype, altering behaviour across the application, sometimes to XSS or code execution.