Skip to content

Prototype pollution in ObjectUtils.mutateFieldData via primereact/utils #8553

Description

@Dremig

Summary

ObjectUtils.mutateFieldData exposed from primereact/utils appears to allow prototype pollution when the field argument contains prototype-related path segments such as __proto__.

Affected package

  • Package: primereact
  • Version tested: 10.9.8
  • Entry point: primereact/utils
  • API: ObjectUtils.mutateFieldData(data, field, value)

Reproduction

// Maybe sent in a more private way

Expected behavior

mutateFieldData should reject or safely handle dangerous path segments such as __proto__, constructor, and prototype.

Actual behavior

The function splits the caller-controlled field by . and walks the object path before assigning the final value. With __proto__.polluted, traversal reaches Object.prototype and assigns the attacker-controlled value there.

After the call, newly created objects inherit the polluted property.

Impact

If an application passes attacker-controlled field names into ObjectUtils.mutateFieldData, an attacker may pollute Object.prototype. Depending on application behavior, this can affect downstream authorization, configuration, feature-flag, or control-flow checks that read inherited properties.

Suggested fix

Reject dangerous path segments before traversal or assignment:

  • __proto__
  • constructor
  • prototype

This validation should happen at every nesting level before reading, recursing into, or assigning a property. It would also be safer to use own-property-only traversal semantics for nested writes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: SecurityIssue contains a security problem or enhancement related to a specific component

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions