Skip to content

Ensure spawning of child processes are not susceptible to prototype pollution #49605

@watson

Description

@watson

While there's currently no known prototype pollution gadget in Kibana, if one is found, it might be possible to perform RCE via the child processes being spawned.

Therefore, it's prudent that we harden this attack vector before someone finds a way to utilize it.

We can mitigate this our selves inside of Kibana by ensuring that the arguments passed to the spawn function (and friends) are properly sanitized, eg:

const options = Object.create(null)
options.env = Object.assign(Object.create(null), process.env)
spawn(command, options)

Preferably we should also fix this in Node.js core, so it's harder to fall victim to this sort of attack. I've created a PR to deal with this in Node.js core: nodejs/node#30008

See also the related Node.js core PR to harden process.env in general: nodejs/node#30063

Metadata

Metadata

Assignees

Labels

Feature:HardeningHarding of Kibana from a security perspectiveTeam:SecurityPlatform Security: Auth, Users, Roles, Spaces, Audit Logging, etc t//

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions