Severity:

HIGH RISK

(7.3)

Prototype Pollution / Code Injection in brikcss merge

CVE-2026-6594

Deferred

Vulnerability type

Category:

Prototype Pollution / Code Injection

CWE:

CWE-94, CWE-1321

Impact:

Potential Remote Code Execution and Application Compromise

Severity:

HIGH RISK

(7.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

brikcss merge up to version 1.3.0 is vulnerable to a prototype pollution issue via specially crafted arguments such as __proto__, constructor.prototype, or prototype, allowing modification of base object attributes.

In JavaScript environments where polluted prototypes influence application logic, this can escalate to arbitrary code execution or other unexpected behavior when trusted objects are later used.

Affected context

The vulnerability affects applications that import and use the brikcss merge utility (≤ 1.3.0) to merge user-controlled or otherwise untrusted objects into application state.

It is particularly relevant in Node.js or browser-based code where:

  • Application logic iterates over or trusts object properties created via merging
  • Frameworks, configuration loaders, or templating systems rely on plain objects that may inherit from Object.prototype
  • Security assumptions are made about which properties can exist on request, configuration, or model objects

The vulnerability does not manifest unless the library is used on data that an attacker can influence.

Exploit preconditions

  • Attack surface: Any API endpoint, CLI interface, or browser code path that passes attacker-controlled objects into brikcss merge.
  • Required access: Ability to supply JSON-like data, query/body parameters, or configuration values that are merged (remote network access is sufficient in many web scenarios).
  • Trigger point: Invocation of merge with an object containing keys like __proto__, constructor.prototype, or prototype.
  • Why exploitation is possible: The merge logic does not filter or block special prototype-related keys, allowing writes to Object.prototype or other shared prototypes. Subsequent object instantiation or property access then operates on a polluted prototype chain.

Why this happens

This issue stems from an unsafe object merge implementation that fails to treat prototype-related properties as sensitive.

When merging arbitrary objects, keys such as __proto__, constructor, or nested constructor.prototype are treated like normal properties and are recursively assigned.

This maps to CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution'), where attacker input can mutate the prototypes of core objects.

In environments that later evaluate or execute data derived from these polluted objects (e.g., building dynamic function strings or injecting into template engines), the problem can align with CWE-94: Code Injection, as modified prototypes may influence control flow or introduce executable payloads.

Potential impact

  • Global modification of Object.prototype or other shared prototypes across the process
  • Bypassing security checks that depend on checking own-properties or whitelisting object keys
  • Alteration of application logic, leading to privilege escalation or authorization bypass
  • Injection of unexpected values into logging, templating, or configuration subsystems
  • Under certain application-specific conditions, escalation to arbitrary code execution

General mitigation guidance

Defenses typically focus on hardening merge utilities and reducing trust in object structure:

  • Treat prototype-related keys (__proto__, prototype, constructor, constructor.prototype, etc.) as reserved and block or drop them before merging.
  • Prefer safe, well-reviewed deep-merge utilities that explicitly guard against prototype pollution.
  • Constrain where and how untrusted data is merged; favor explicit mapping of input fields to known schema-backed objects over generic deep merges.
  • Use objects without a prototype (e.g., Object.create(null) or Map) for structures derived from untrusted input to limit damage if pollution occurs.
  • Apply least-privilege design to critical objects and configuration structures so that polluted properties are less likely to affect sensitive behavior.

How teams detect issues like this

Detection can combine static analysis, code review, and runtime monitoring:

  • Static analysis / SAST: Flag use of deep-merge helpers where untrusted input flows directly into generic merge calls without filtering prototype-related keys.
  • Code review signals: Look for calls to merge (or similar utilities) with request bodies, query parameters, or deserialized JSON, especially when merging into global configuration or shared state.
  • Policy enforcement: Establish secure coding guidelines that forbid merging unvalidated user input into application-wide objects and require schema-based validation.
  • Runtime monitoring: In Node.js environments, monitor for unexpected properties appearing on Object.prototype or other core prototypes as an indicator of potential pollution.

Sources

SourceLink
github.comgithub.com/sudo-secure/security-research/blob/main/brikcss-merge/prototype-pollution/PoC.md
vuldb.comvuldb.com/submit/791805
vuldb.comvuldb.com/vuln/358229
vuldb.comvuldb.com/vuln/358229/cti

Frequently asked

questions

Yes, if a remote user can supply objects (for example via HTTP JSON bodies, query parameters, or WebSocket messages) that are passed into brikcss merge, they may be able to trigger prototype pollution.

The attacker generally needs only the ability to send crafted data to an interface that eventually passes that data to merge. No local filesystem or shell access is required; typical web client access can be sufficient.

The most robust pattern is to prevent prototype-related properties from ever being merged. This includes filtering or rejecting keys like __proto__, prototype, and constructor before merging, using a merge implementation that enforces this, and using prototype-less containers for untrusted data where feasible.

Avoid generic deep merges of untrusted data into shared objects, adopt strict input schemas, and make prototype pollution checks part of code review and automated analysis. Using vetted libraries with explicit protections against prototype pollution and adhering to secure coding guidelines for object handling significantly reduces this class of risk.

Find out what's already
exploitable in your codebase.