InventreeApplication · Inventree Project

CVE-2026-27629

HIGH · 8.8 CVSS v3.1 Published 2026-02-25
Fix available
A fix is available. Upgrade to 1.2.3 or later.
See remediation →
95/100
Remediation priority · Urgent
Remotely reachable No privileges

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
InvenTree is an Open Source Inventory Management System. Prior to version 1.2.3, 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 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. Some workarounds are available. 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 `STOCK_BATCH_CODE_TEMPLATE` and `PART_NAME_FORMAT` global settings are overridden at the system level to prevent editing.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

InvenTree versions prior to 1.2.3 contain a Server-Side Template Injection (SSTI) vulnerability in the batch code generation feature. Staff users can modify Jinja2 templates to execute arbitrary code or exfiltrate sensitive information, which then executes in the context of any user triggering the batch code API. The fix requires implementing a secure sandboxed template rendering context.

MitigationUpgrade to InvenTree version 1.2.3 or later. As a workaround, system administrators should override STOCK_BATCH_CODE_TEMPLATE and PART_NAME_FORMAT settings at the system level to prevent staff users from editing them.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
InventreeApplication
Affected:< 1.2.3

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Check InvenTree version
    Run 'pip show inventree' or check the installed package version via your package manager, or inspect the version file in your InvenTree installation directory
    Affected if The installed version is lower than 1.2.3 (e.g., 1.2.2, 1.2.1, 1.2.0, etc.)
  2. Verify if STOCK_BATCH_CODE_TEMPLATE setting exists
    Check the InvenTree database or settings configuration for the STOCK_BATCH_CODE_TEMPLATE setting - query the settings table or inspect the InvenTree admin interface under the 'Part' settings
    Affected if The setting exists and contains a custom Jinja2 template value (indicating template rendering is active)
  3. Verify if PART_NAME_FORMAT setting exists
    Check the InvenTree database or settings configuration for the PART_NAME_FORMAT setting - query the settings table or inspect the InvenTree admin interface under the 'Part' settings
    Affected if The setting exists and contains a custom Jinja2 template value (indicating template rendering is active)
  4. Confirm staff user access to template editing
    Check if any user accounts in your InvenTree instance have 'staff' status enabled - query the auth_user table where is_staff=True, or review user permissions in the admin interface
    Affected if There are staff users present who would have permission to modify template settings through the admin interface or API

You are affected if running InvenTree version below 1.2.3 AND staff users exist who can access and modify the batch code template settings, enabling SSTI execution when other users trigger the batch code API.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to 1.2.3 or later
Fixed in 1.2.3
Interim mitigation

Upgrade to InvenTree version 1.2.3 or later. As a workaround, system administrators should override STOCK_BATCH_CODE_TEMPLATE and PART_NAME_FORMAT settings at the system level to prevent staff users from editing them.

Recommended fix High confidence

InvenTree 1.2.3 (or 1.3.0+)

  1. Upgrade InvenTree to version 1.2.3 or any version 1.3.0 and above to obtain the patched code with secure sandboxed template generation
  2. If immediate upgrade is not feasible, override the `STOCK_BATCH_CODE_TEMPLATE` global setting at the system level to a default value to prevent staff users from editing it
  3. Additionally override the `PART_NAME_FORMAT` global setting at the system level as recommended in the official documentation
  4. Verify that the system-level overrides are in place and cannot be changed from the client side

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Inventree Scoped from the published advisory
  • Consultation4.0 h
  • Implementation8.0 h
  • Testing4.0 h
  • Review / QA2.0 h
18.0 hours of engineering $3,200
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $5,120.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2026-27629 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2026-27629 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data