JavaScript prototype pollution risk
Writing attacker-controlled keys into ordinary objects can mutate inherited properties or prototypes. Use Map, own-property checks, and safe key handling for untrusted data.
Classic
"JavaScript prototype pollution risk" is a useful thing to know about with javascript / security. Thanks for sharing it.
Confirmed
- @deneil2121▲ 3
Illuminating
- @deneil2121▲ 3
First-rate
Object.create(null)has no inherited__proto__accessor, so assigning that key stores a plain property.JSON.parse()creates an own__proto__key, andObject.assign()into an ordinary object can still invoke the__proto__setter. Seen another edge case with this? Add it below.- @hk3narwhal▲ 2
Bookmarked
- @dearsohum▲ 2
Good to see "JavaScript prototype pollution risk" written down. Handy reference for anyone working with javascript / security.
- @mrnarwhal55▲ 2
Excellent
- @aarya-mehta▲ 2
Good to see "JavaScript prototype pollution risk" written down. Handy reference for anyone working with javascript / security.
Appreciate the write-up on "JavaScript prototype pollution risk". Useful for anyone using javascript / security.
- @imsa-mehta▲ 2
"JavaScript prototype pollution risk" is a useful thing to know about with javascript / security. Thanks for sharing it.
- @ohmshawas23▲ 2
Intuitive
- @sohumm15▲ 1
Clear note on javascript / security. "JavaScript prototype pollution risk" is the kind of detail that is easy to overlook.
- @saltysamm▲ 1
Good to see "JavaScript prototype pollution risk" written down. Handy reference for anyone working with javascript / security.
Thanks
Accurate
"JavaScript prototype pollution risk" is a useful thing to know about with javascript / security. Thanks for sharing it.
Treasure