Skip to main content

YesWiki CVE-2026-52762

HIGH
Improper Neutralization of Special Elements Used in a Template Engine (CWE-1336)
2026-07-09 https://github.com/YesWiki/yeswiki GHSA-65p8-9433-jpcp
7.1
CVSS 4.0 · Vendor: https://github.com/YesWiki/yeswiki
Share

Severity by source

Vendor (https://github.com/YesWiki/yeswiki) PRIMARY
7.1 HIGH
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
vuln.today AI
9.1 CRITICAL

PR:H reflects required admin access for planting; S:C and C:H/I:H/A:H reflect confirmed OS-level shell escalation beyond application boundary.

3.1 AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H

Primary rating from Vendor (https://github.com/YesWiki/yeswiki).

CVSS VectorVendor: https://github.com/YesWiki/yeswiki

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
X

Lifecycle Timeline

6
Analysis Updated
Sep 05, 2026 - 00:31 vuln.today
v2 (cvss_changed)
Re-analysis Queued
Sep 05, 2026 - 00:22 vuln.today
cvss_changed
CVSS changed
Sep 05, 2026 - 00:22 NVD
7.1 (HIGH)
Source Code Evidence Fetched
Jul 27, 2026 - 10:51 vuln.today
Analysis Generated
Jul 09, 2026 - 21:25 vuln.today
CVE Published
Jul 09, 2026 - 20:54 cve.org
HIGH

DescriptionCVE.org

Summary

YesWiki Bazar contains a stored Server-Side Template Injection (SSTI) vulnerability in the semantic template feature that can be escalated to confirmed Remote Code Execution (RCE). An authenticated administrator can place arbitrary Twig expressions into the Semantic template (Twig) field (bn_sem_template), and that content is later executed server-side when public semantic endpoints are requested.

This was first confirmed through a harmless proof payload where {{ 7 * 7 }} was rendered as 49 through the public JSON-LD endpoint. The finding was then further validated locally by storing a Twig payload that invoked a system-level callable, resulting in command execution and an interactive shell on the test machine.

Because the payload is stored in the form configuration and later triggered through a public endpoint, this issue is both persistent and remotely triggerable after an administrator plants the malicious template.

Details

The vulnerable behavior is in the Bazar semantic rendering flow.

The administrator-editable fields:

  • bn_sem_template
  • bn_sem_reverse_template

allow Twig template content to be stored inside a form definition. That content is later rendered by the backend semantic transformer through TemplateEngine::renderFromStringNoEscape(), which passes the user-controlled string into Twig for execution.

Relevant sink:

php
$json = $this->templateEngine->renderFromStringNoEscape($form['bn_sem_template'], $data);

The rendering helper evaluates the supplied string as a live Twig template:

php
public function renderFromStringNoEscape(string $templateString, array $data = []): string
{
    $wrapped = '{% autoescape false %}' . $templateString . '{% endautoescape %}';
    return $this->twig->createTemplate($wrapped)->render($data);
}

This is unsafe because administrator-controlled semantic template text is executed as server-side Twig code rather than treated as inert data. In the validated environment, Twig expressions were first confirmed to execute through a harmless arithmetic payload and were then escalated to operating-system-level command execution by invoking a callable through Twig.

The public trigger path used during validation was:

text
GET /api/forms/2/entries/json-ld

The attack chain is:

  1. An administrator stores malicious Twig code in the semantic template field.
  2. YesWiki saves that payload in the form configuration.
  3. A later request to the public semantic endpoint causes the backend to render and execute the stored Twig.
  4. Because the Twig environment is not adequately constrained, the stored payload can escalate from template execution to system command execution.

PoC

The following steps reproduce the issue on the locally validated YesWiki instance.

Stage 1: Confirm Server-Side Template Execution

  1. Log in to YesWiki as an administrator.
  2. Open Bazar form management.
  3. Edit form ID 2 (Agenda in the validated instance).
  4. Locate the field labeled Semantic template (Twig).
  5. Replace its content with the following harmless payload:
json
{"proof":"{{ 7 * 7 }}"}
  1. Save the form.
  2. Trigger the public semantic endpoint:
bash
curl -s 'https://target.example/?api/forms/2/entries/json-ld'
  1. Observe that the server returns evaluated Twig output instead of the literal string {{ 7 * 7 }}.

Confirmed response:

json
{"@context":null,"@id":"https:\/\/target.example\/?api\/fiche\/2","@type":["ldp:Container","ldp:BasicContainer"],"dcterms:title":"Agenda","ldp:contains":[{"proof":"49","id":"https:\/\/target.example\/?TesT2"},{"proof":"49","id":"https:\/\/target.example\/?Bordeaux"}]}

Key execution proof:

json
"proof":"49"

Stage 2: Confirm Remote Code Execution

After confirming SSTI with the harmless payload above, a second locally controlled payload was stored in the same semantic template field to test whether Twig execution could be escalated to command execution. When the public semantic endpoint was requested, the payload executed on the server and established an interactive shell back to the test listener.

Observed local evidence included:

  • an inbound connection to the attacker's listener
  • an interactive shell prompt on the YesWiki host
  • successful command execution from the shell inside the YesWiki project directory

Observed shell output:

text
Connection received on 172.31.60.19 60308
khizar@Victus:/mnt/c/Users/khiza/Documents/Codex/2026-05-24/i-am-trying-to-make-a/yeswiki-src$ ls
INSTALL.md
LICENSE
Makefile
README.md
SECURITY.md
actions
cache
codex-admin-login.php
composer.json
composer.lock
custom
docker
docs
files
formatters
handlers
includes
index.php
interwiki.conf
javascripts
lang
package.json
private
robots.txt
setup
styles
templates
tests
themes
tools
vendor
wakka.config.php
wakka.php
yeswicli

This confirms that the issue is not limited to template evaluation or data disclosure. In the validated local environment, the stored Twig payload reached full operating-system-level command execution.

Impact

An authenticated administrator can inject arbitrary Twig expressions into Bazar semantic templates, and those expressions are executed server-side when public semantic endpoints are requested.

In the validated environment, this leads to confirmed Remote Code Execution. An attacker with administrator access can:

  • execute arbitrary Twig expressions on the server
  • store a persistent payload in form configuration
  • have that payload triggered later by unauthenticated requests to public semantic endpoints
  • execute operating-system commands on the host
  • gain interactive shell access to the underlying server
  • pivot from application-level administration to full server compromise

This breaks the expected trust boundary between application administration and host-level execution. In practical terms, YesWiki administrator privileges become sufficient to obtain command execution on the server in affected deployments.

AnalysisAI

Stored Server-Side Template Injection in YesWiki's Bazar module allows an authenticated administrator to plant arbitrary Twig expressions into form semantic template fields (bn_sem_template, bn_sem_reverse_template), which are persistently stored and later executed server-side when unauthenticated requests reach the public JSON-LD semantic endpoint. Published proof-of-concept in the GHSA advisory confirms full escalation from harmless template evaluation ({{ 7 * 7 }}49) to interactive OS-level reverse shell. The fix is confirmed in YesWiki v4.6.6, a dedicated security release addressing 12 CVEs; no CISA KEV listing at time of analysis, but publicly available exploit code exists.

Technical ContextAI

YesWiki is an open-source PHP wiki platform whose Bazar module provides form-based structured data management. The root cause (CWE-1336 - Improper Neutralization of Special Elements Used in a Template Engine) is located in TemplateEngine::renderFromStringNoEscape(), which wraps administrator-supplied strings in a Twig {% autoescape false %} block and passes them directly to $this->twig->createTemplate()->render(). The Twig environment is not sandboxed and does not apply an allowlist policy that would prevent access to PHP callables capable of invoking OS commands. The affected composer package is yeswiki/yeswiki (pkg:composer/yeswiki_yeswiki) in all versions prior to 4.6.6. Because the malicious payload is written to form configuration at admin time and later rendered for any request to GET /api/forms/{id}/entries/json-ld, the vulnerability has both a privileged write phase and an unauthenticated trigger phase.

RemediationAI

Upgrade YesWiki to version 4.6.6 or later, which is the vendor-confirmed patched release; the specific fix is in commit 89462f1577a8a1fe7fcff75e77b5058a74d8047b. The release is available at https://github.com/YesWiki/yeswiki/releases/tag/v4.6.6. If immediate upgrade is not possible, restrict administrative account access to the Bazar form management interface to the minimum required set of trusted users and enforce strong authentication (MFA) on all admin accounts - this eliminates the planting phase prerequisite. As a secondary compensating control, block or rate-limit access to the /api/forms/*/entries/json-ld public endpoint via WAF or web server ACL; note this will disable the JSON-LD semantic API for all consumers. Audit existing Bazar form definitions for unexpected Twig expressions in bn_sem_template and bn_sem_reverse_template fields to detect payloads already planted by a compromised admin account.

More in PHP

View all
CVE-2019-11043 CRITICAL POC
9.8 Oct 28

In PHP versions 7.1.x below 7.1.33, 7.2.x below 7.2.24 and 7.3.x below 7.3.11 in certain configurations of FPM setup it

CVE-2012-1823 CRITICAL POC
9.8 May 11

sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not

CVE-2016-1555 CRITICAL POC
9.8 Apr 21

(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear

CVE-2018-11138 CRITICAL POC
9.8 May 31

The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by

CVE-2024-11680 CRITICAL POC
9.8 Nov 26

ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C

CVE-2025-49113 CRITICAL POC
9.9 Jun 02

Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au

CVE-2017-9841 CRITICAL POC
9.8 Jun 27

Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c

CVE-2025-0108 HIGH POC
8.8 Feb 12

Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers

CVE-2021-25298 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2021-25296 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2013-4983 CRITICAL POC
10.0 Sep 10

The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows

CVE-2023-6553 CRITICAL POC
9.8 Dec 15

The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1

Share

CVE-2026-52762 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy