Skip to content

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

@Dremig

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: Needs TriageIssue will be reviewed by Core Team and a relevant label will be added as soon as possible

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions