Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V1 - Encoding and Sanitization Template injection prevention
|
| Impact | CVSS 5.5 with PR:H (high privilege required) significantly constrains real-world risk; this is not a remote unauthenticated attack. However, the vulnerability chain demonstrates a dangerous pattern: incomplete security fixes and inconsistent use of security controls create exploitability gaps. The attacker requires staff-level access and settings modification permissions, which limits the threat model to insider threats or accounts compromised with high privileges. SSVC analysis suggests this is remediation-triggered exposure: the incomplete fix to CVE-2026-27629 re-introduced the vulnerability in a form bypassing the intended sandbox. The tags confirm SSTI and RCE capability, elevating concern despite high privilege requirements. Organizations should prioritize patching based on their internal access controls; if staff accounts are widely distributed or poorly managed, risk escalates. The fact that versions 1.2.3-1.2.6 were shipped with a known-incomplete remediation is a process failure that warrants review of release practices. |
| Exploit ScenarioDerived | A staff user with access to InvenTree's settings pages (specifically the PART_NAME_FORMAT configuration) crafts a Jinja2 template such as '{{ part.name }}{% if part.pk %}{{ __import__("os").system("id") }}{% endif %}' that includes conditional template injection. During validation, the sandboxed environment rejects the injection, but because the validator uses a dummy Part with pk=None, the conditional evaluates to False and the malicious code is never tested. The template is stored. When actual parts are rendered (pk has a real value), the production renderer uses the unsandboxed environment, the conditional evaluates to True, and arbitrary Python code executes with the privileges of the InvenTree application process. No public exploit code has been identified at the time of analysis; the attack requires intimate knowledge of the inconsistency between validator and renderer. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Apr 08, 2026
Remote code execution in InvenTree 1.2.3 through 1.2.6 allows staff users with settings access to execute arbitrary code by crafting malicious Jinja2 templates that bypass sandbox validation. The vulnerability exists because the PART_NAME_FORMAT validator uses a sandboxed Jinja2 environment, but the actual rendering engine in part/helpers.py uses an unsandboxed environment, combined with a validation bypass via dummy Part instances with pk=None that behave differently during validation versus production execution. No public exploit code or active exploitation confirmed at time of analysis.
RemediationAI
Upgrade InvenTree to version 1.2.7 or 1.3.0 or later. The patch synchronizes the PART_NAME_FORMAT renderer in part/helpers.py to use the same jinja2.sandbox.SandboxedEnvironment as the validator, and corrects the validation bypass by ensuring template rendering behavior is consistent between validation and production. Organizations unable to upgrade immediately should restrict staff-level access and settings modification permissions to only trusted administrators, and audit recent changes to part naming format templates for suspicious template syntax. For detailed remediation guidance, consult the GitHub Security Advisory at https://github.com/inventree/InvenTree/security/advisories/GHSA-84jh-x777-8pqq.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
InvenTree uses Jinja2 templating for part naming formats. The vulnerability stems from an incomplete remediation of CVE-2026-27629: while the validator was upgraded to jinja2.sandbox.SandboxedEnvironment to prevent template injection, the production renderer in part/helpers.py retained the unrestricted jinja2.Environment. Additionally, the validator creates a dummy Part object with pk=None to test templates, but this allows conditional expressions (such as {% if part.pk %}) to execute different code paths during validation versus real rendering where pk contains an actual value. Attackers with staff permissions and settings modification rights can craft templates that pass the sandboxed validator but execute arbitrary Python code when the unsandboxed renderer processes them. This is a classic Server-Side Template Injection (SSTI) attack enabled by inconsistent sandboxing.
Know when Inventree gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
Primary rating from NVD · only source for this CVE.
CVSS VectorNVD
Lifecycle Timeline
4DescriptionNVD
InvenTree is an Open Source Inventory Management System. From 1.2.3 to 1.2.6, the fix for CVE-2026-27629 upgraded the PART_NAME_FORMAT validator to use jinja2.sandbox.SandboxedEnvironment. However, the actual renderer in part/helpers.py was not updated and still uses the non-sandboxed jinja2.Environment. Additionally, the validator uses a dummy Part instance with pk=None, which allows conditional template expressions to behave differently during validation versus production rendering. A staff user with settings access can craft a template that passes validation but executes arbitrary code during rendering. This issue requires access by a user with granted staff permissions. This vulnerability is fixed in 1.2.7 and 1.3.0.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Improper Neutralization of Formula Elements in a CSV File in GitHub repository inventree/inventree prior to 0.7.2. Rated
Unrestricted Upload of File with Dangerous Type in GitHub repository inventree/inventree prior to 0.7.2. Rated high seve
Allocation of Resources Without Limits or Throttling in GitHub repository inventree/inventree prior to 0.8.0. Rated medi
Cross-site Scripting (XSS) - Stored in GitHub repository inventree/inventree prior to 0.8.3. Rated medium severity (CVSS
Cross-site Scripting (XSS) - Stored in GitHub repository inventree/inventree prior to 0.7.2. Rated medium severity (CVSS
Authentication bypass in InvenTree open source inventory management system allows any authenticated user to generate API
Broken object-level authorization in InvenTree prior to 1.4.0 allows any authenticated low-privilege user - or any holde
InvenTree versions prior to 1.4.0 render report and label templates with WeasyPrint's default URL fetcher, so an authent
Authenticated attackers with low-level privileges can exfiltrate sensitive database information from InvenTree open sour
InvenTree prior to version 1.2.3 allows authenticated staff users to inject malicious Jinja2 template code into batch co
InvenTree is an Open Source Inventory Management System. Rated medium severity (CVSS 5.4), this vulnerability is remotel
Unauthenticated information disclosure in InvenTree prior to 1.4.0 lets a remote caller retrieve plugin names, setting k
EUVD-2026-20588
NVD
CVE.org
EPSS
Vulnrichment
GitHub
Exploit-DB