Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,075 of 9,075 pages
About the help in other languages
All help pages

Security fixes in themes

The security problems a theme can have - unescaped output, output in the wrong context, inline script injection, links opening other sites, exposed settings - how to find them, and a real fix from a published theme.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/designers/lifecycle/security-fixes-in-themes.md

On this page

Security fixes in themes

This page is for designers maintaining a theme. Templates print content that editors and visitors wrote; a template that prints it without escaping lets someone run script in other people's browsers (cross-site scripting).

Typical problems

ProblemExampleFix
Output not escaped{$node.name} in HTML{$node.name|wash} (Wash and escaping)
Escaped for the wrong contextEscaped for JavaScript only, but the value ends up in HTMLEscape for each context it passes through
Values in inline scriptsA title written into a script blockPass it in a data-* attribute; no inline script
Visitor input in URLsA search term in a linkEscape for the URL, then for HTML
Settings or paths shownDebug output on a live siteDebug only for your IP; never print paths

A real fix

cjw_themes_jumper 0.1.4: "The single-location map escapes the address and the title for HTML before it escapes them for JavaScript (|wash|wash( 'javascript' )). Both go into L.popup().setContent(), which reads HTML, so markup in an address or a title ran in the popup." The value passed through two contexts, so it needed escaping for both.

Step by step: look for problems

  1. Search for output without wash:

    grep -rn -E "\{\\\$[a-z_.]+\}" extension/mytheme/design | grep -v wash | head -50

    Read each hit; numbers and values already escaped are fine.

  2. Search for values written into scripts: grep -rn "<script" extension/mytheme/design.

  3. Fix, test with a title containing <b>"' characters, and release (Publishing a security release).

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x