mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 20:30:39 -07:00
Deploying to gh-pages from @ harttle/liquidjs@457fae0736 🚀
This commit is contained in:
@@ -92,7 +92,7 @@
|
||||
|
||||
</header>
|
||||
<div class="article-content" itemprop="articleBody">
|
||||
<p>LiquidJS provides DoS-oriented limits (<code>parseLimit</code>, <code>renderLimit</code>, <code>memoryLimit</code>) to reduce risk. This page explains what each limit protects, and the security boundary you should assume in production.</p>
|
||||
<p>LiquidJS provides DoS-oriented limits (<code>parseLimit</code>, <code>renderLimit</code>, <code>memoryLimit</code>) to reduce risk. This page summarizes those limits, <a href="/api/interfaces/LiquidOptions.html#ownPropertyOnly"><code>ownPropertyOnly</code></a>, custom <a href="/api/classes/Drop.html"><code>Drop</code></a> usage, and the security boundary to assume in production.</p>
|
||||
<h2 id="Security-boundary" class="article-heading"><a href="#Security-boundary" class="headerlink" title="Security boundary"></a>Security boundary<a class="article-anchor" href="#Security-boundary" aria-hidden="true"></a></h2><p>The built-in limits are cooperative safeguards, not strict runtime isolation.</p>
|
||||
<ul>
|
||||
<li>They do <strong>not</strong> equal process RSS/heap usage.</li>
|
||||
@@ -126,6 +126,8 @@
|
||||
<span class="token liquid language-liquid"><span class="token delimiter punctuation">{%</span> <span class="token keyword">endfor</span> <span class="token delimiter punctuation">%}</span></span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span></span></code></pre>
|
||||
|
||||
<p>As <a target="_blank" rel="noopener external nofollow noreferrer" href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Memory_management">JavaScript uses GC to manage memory</a>, <code>memoryLimit</code> may not reflect the actual memory footprint.</p>
|
||||
<h2 id="ownPropertyOnly-and-scope-data" class="article-heading"><a href="#ownPropertyOnly-and-scope-data" class="headerlink" title="ownPropertyOnly and scope data"></a><code>ownPropertyOnly</code> and scope data<a class="article-anchor" href="#ownPropertyOnly-and-scope-data" aria-hidden="true"></a></h2><p>With <a href="/api/interfaces/LiquidOptions.html#ownPropertyOnly"><code>ownPropertyOnly</code></a> <code>true</code>, plain scope objects only expose <strong>own</strong> properties (no inherited / <code>Object.prototype</code> keys). Default <code>false</code> follows normal JS property access. Use <code>true</code> for untrusted or polluted objects; add <a href="/api/interfaces/LiquidOptions.html#strictVariables"><code>strictVariables</code></a> if missing paths should error. Override per render via <a href="/api/interfaces/RenderOptions.html#ownPropertyOnly"><code>RenderOptions</code></a>. This is a read policy for scope data—not a sandbox for filters, tags, or your code.</p>
|
||||
<h2 id="Custom-Drop-classes" class="article-heading"><a href="#Custom-Drop-classes" class="headerlink" title="Custom Drop classes"></a>Custom <code>Drop</code> classes<a class="article-anchor" href="#Custom-Drop-classes" aria-hidden="true"></a></h2><p><a href="/api/classes/Drop.html"><code>Drop</code></a> values are not restricted the same way: LiquidJS still reads the prototype chain and may call <a href="/api/classes/Drop.html#liquidMethodMissing"><code>liquidMethodMissing</code></a>. <strong>You</strong> control what a drop exposes; narrow APIs and never feed unsafe data into drops unless the class is built for template access. <code>ownPropertyOnly</code> alone does not harden custom drops—audit them like any privileged code.</p>
|
||||
<h2 id="Online-service-guidance" class="article-heading"><a href="#Online-service-guidance" class="headerlink" title="Online service guidance"></a>Online service guidance<a class="article-anchor" href="#Online-service-guidance" aria-hidden="true"></a></h2><p>If you run an online service, avoid rendering fully user-defined templates whenever possible.</p>
|
||||
<ul>
|
||||
<li>Prefer curated templates or a restricted template subset.</li>
|
||||
@@ -136,7 +138,7 @@
|
||||
|
||||
</div>
|
||||
<footer class="article-footer">
|
||||
<time class="article-footer-updated" datetime="2026-05-11T16:00:04.052Z" itemprop="dateModified">Last updated: 2026-05-11</time>
|
||||
<time class="article-footer-updated" datetime="2026-05-14T14:18:33.230Z" itemprop="dateModified">Last updated: 2026-05-14</time>
|
||||
<a href="truthy-and-falsy.html" class="article-footer-prev" title="Truthy and Falsy"><i class="icon-chevron-left"></i><span>Prev</span></a><a href="static-analysis.html" class="article-footer-next" title="Static Analysis"><span>Next</span><i class="icon-chevron-right"></i></a>
|
||||
</footer>
|
||||
</div>
|
||||
@@ -145,7 +147,7 @@
|
||||
<div id="article-toc-inner">
|
||||
<div id="article-toc-inner-list">
|
||||
<strong class="sidebar-title">Contents</strong>
|
||||
<ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#Security-boundary"><span class="toc-text">Security boundary</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Limits-at-a-glance"><span class="toc-text">Limits at a glance</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Limit-details"><span class="toc-text">Limit details</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#parseLimit"><span class="toc-text">parseLimit</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#renderLimit"><span class="toc-text">renderLimit</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#memoryLimit"><span class="toc-text">memoryLimit</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Online-service-guidance"><span class="toc-text">Online service guidance</span></a></li></ol>
|
||||
<ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#Security-boundary"><span class="toc-text">Security boundary</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Limits-at-a-glance"><span class="toc-text">Limits at a glance</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Limit-details"><span class="toc-text">Limit details</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#parseLimit"><span class="toc-text">parseLimit</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#renderLimit"><span class="toc-text">renderLimit</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#memoryLimit"><span class="toc-text">memoryLimit</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#ownPropertyOnly-and-scope-data"><span class="toc-text">ownPropertyOnly and scope data</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Custom-Drop-classes"><span class="toc-text">Custom Drop classes</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Online-service-guidance"><span class="toc-text">Online service guidance</span></a></li></ol>
|
||||
</div>
|
||||
<a href="#" id="article-toc-top">Back to Top</a>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user