Skip to content

Server Side Template Injection (SSTI)

Moderate
SchrodingersGat published GHSA-cx85-vr3q-9x4m Feb 22, 2026

Package

No package listed

Affected versions

< 1.2.3

Patched versions

1.2.3

Description

Impact

Insecure server-side templates can be hijacked to expose secure information to the client.

When generating custom batch codes, the InvenTree server makes use of a customizable jinja2 template, which can be modified by a staff user to exfiltrate sensitive information or perform code execution on the server.

This issue requires access by a user with granted staff permissions, followed by a request to generate a custom batch code via the API. Once the template has been modified in a malicious manner, the API call to generate a new batch code could be made by other users, and the template code will be executed with their user context.

The following global settings are considered vulnerable to this style of attack:

  • STOCK_BATCH_CODE_TEMPLATE
  • PART_NAME_FORMAT

Patches

The code has been patched to ensure that all template generation is performed within a secure sandboxed context.

This issue has been addressed in version 1.2.3, and any versions from 1.3.0 onwards.

Workarounds

The batch code template is a configurable global setting which can be adjusted via any user with staff access.

To prevent this setting from being edited, it can be overridden at a system level to a default value, preventing it from being edited.

This requires system administrator access, and cannot be changed from the client side once the server is running.

It is recommended that for InvenTree installations prior to 1.2.3 the following global settings are overridden at the system level to prevent editing.

  • STOCK_BATCH_CODE_TEMPLATE
  • PART_NAME_FORMAT

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Adjacent
Attack complexity
Low
Privileges required
Low
User interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
Low

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:A/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:L

CVE ID

CVE-2026-27629

Weaknesses

No CWEs

Credits