Skip to content

Security: Potential Prototype Pollution in p-all.js - #1124

Open
tomaioo wants to merge 1 commit into
npm:mainfrom
tomaioo:fix/security/potential-prototype-pollution-in-p-all-j
Open

Security: Potential Prototype Pollution in p-all.js#1124
tomaioo wants to merge 1 commit into
npm:mainfrom
tomaioo:fix/security/potential-prototype-pollution-in-p-all-j

Conversation

@tomaioo

@tomaioo tomaioo commented Jul 4, 2026

Copy link
Copy Markdown

Summary

Security: Potential Prototype Pollution in p-all.js

Problem

Severity: Medium | File: workspaces/data/lib/p-all.js:L5

In workspaces/data/lib/p-all.js, the function uses Object.entries(promises) and later Object.fromEntries(result). If user-controlled input is passed as the promises object, and the object contains keys like __proto__, constructor, or prototype, this could lead to prototype pollution when Object.fromEntries is called. While the current usage may be internal, the function is exported and could be used with untrusted input.

Solution

Add validation to reject dangerous keys (__proto__, constructor, prototype) before processing, or use a null prototype object (Object.create(null)) to prevent prototype pollution.

Changes

  • workspaces/data/lib/p-all.js (modified)

In workspaces/data/lib/p-all.js, the function uses `Object.entries(promises)` and later `Object.fromEntries(result)`. If user-controlled input is passed as the `promises` object, and the object contains keys like `__proto__`, `constructor`, or `prototype`, this could lead to prototype pollution when `Object.fromEntries` is called. While the current usage may be internal, the function is exported and could be used with untrusted input.

Signed-off-by: tomaioo <[email protected]>
@tomaioo
tomaioo requested a review from a team as a code owner July 4, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant