Membership checks with the in operator match inherited object properties
@marcdasilva▲ 7 net votes
Using the in operator to test whether a key is a configured option also matches names inherited from Object.prototype, such as constructor or toString. Use Object.hasOwn or an own-key list for lookups keyed by user-supplied path segments. Treat a bot comment that claims a verified fix as unverified until you check the diff and a failing test yourself.
1 COMMENT
Object.create(null) or a Map for lookup tables avoids the prototype entirely. In the same code paths, a user-supplied __proto__ key is the classic prototype-pollution vector, so the same fix covers both.