Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-109377 Overview
CVE-2026-109377 is a missing authorization vulnerability [CWE-862] in ERPNext versions 9.0.0 through 16.50.0. The flaw exposes whitelisted batch lookup methods to any authenticated user, including low-privilege customer portal accounts. Attackers can invoke get_batch_qty, get_batches_by_oldest, or get_pos_reserved_batch_qty to enumerate every item batch and per-warehouse stock quantity. The methods do not verify that the caller holds Batch read permissions. This leaks confidential inventory data such as supplier batch identifiers, expiry dates, and warehouse-level stock levels to unauthorized users.
Critical Impact
Any authenticated ERPNext user, including customer portal accounts, can enumerate stock quantities and batch metadata across all warehouses without holding Batch document permissions.
Affected Products
- ERPNext 9.0.0 through 16.50.0
- ERPNext deployments exposing the customer portal to external users
- Self-hosted and cloud ERPNext instances using the frappe framework whitelisted methods
Discovery Timeline
- 2026-10-12 - CVE-2026-109377 published to NVD
- 2026-10-15 - Last updated in NVD database
Technical Details for CVE-2026-109377
Vulnerability Analysis
ERPNext exposes several whitelisted Python methods under erpnext.stock.doctype.batch.batch that return batch-level inventory data. Whitelisted methods in the Frappe framework are callable by any authenticated session through the HTTP API. The affected endpoints get_batch_qty, get_batches_by_oldest, and get_pos_reserved_batch_qty perform stock queries without validating that the caller holds the Batch document permission. As a result, customer portal users, who are intended to see only their own transactional data, can enumerate every batch across every warehouse. The leaked data includes batch identifiers, warehouse associations, and current quantities, which can reveal supplier relationships, production volumes, and sales velocity.
Root Cause
The root cause is missing authorization enforcement in the batch stock query functions. The whitelist decorator exposed these functions to the API without a corresponding frappe.has_permission("Batch", "select") check. The absence of this gate violates the principle of least privilege for authenticated low-trust roles.
Attack Vector
An attacker authenticates to the ERPNext instance using any valid account, including a customer portal registration. The attacker then issues an HTTP POST request to /api/method/erpnext.stock.doctype.batch.batch.get_batch_qty with no additional parameters, receiving a full enumeration of batch quantities per warehouse. The attack requires network access and low privileges, and no user interaction.
# Security patch applied in erpnext/stock/doctype/batch/batch.py
# Source: https://github.com/frappe/erpnext/commit/10a2400312afd17df740c6ed64e0803dfbabb623
:param item_code: Optional - give qty for this item
:param for_stock_levels: True consider expired batches"""
frappe.has_permission("Batch", "select", throw=True)
from erpnext.stock.doctype.serial_and_batch_bundle.serial_and_batch_bundle import (
combine_datetime,
get_auto_batch_nos,
)
The patch adds frappe.has_permission("Batch", "select", throw=True) at the start of the affected methods, forcing the framework to raise a permission error when the caller lacks Batch read access.
Detection Methods for CVE-2026-109377
Indicators of Compromise
- Unexpected HTTP POST requests to /api/method/erpnext.stock.doctype.batch.batch.get_batch_qty, get_batches_by_oldest, or get_pos_reserved_batch_qty from portal or low-privilege sessions.
- High-volume batch endpoint calls from a single authenticated session within a short time window.
- Session activity from customer portal users accessing stock-related API methods they do not normally use.
Detection Strategies
- Parse Frappe/ERPNext access.log and web server logs for calls to the three affected method names, correlated with the authenticated user role.
- Baseline API method usage per role and alert on portal or customer-role sessions invoking stock inventory methods.
- Review Frappe audit logs for enumeration patterns such as sequential or repeated batch queries from the same IP.
Monitoring Recommendations
- Forward ERPNext application logs and nginx access logs to a central analytics platform for role-based query monitoring.
- Alert on any 200 OK response from the affected /api/method/ paths originating from non-stock roles.
- Monitor for anomalous data egress volumes associated with authenticated portal sessions.
How to Mitigate CVE-2026-109377
Immediate Actions Required
- Upgrade ERPNext to the fixed version containing commit 10a2400312afd17df740c6ed64e0803dfbabb623.
- Audit customer portal and low-privilege roles to confirm they do not hold Batch select permission.
- Review API access logs for prior invocation of the three affected methods and investigate any unexpected calls.
Patch Information
The fix is published in ERPNext commit 10a2400 and merged via Pull Request #60147. It adds a frappe.has_permission("Batch", "select", throw=True) check to the affected batch endpoints. See the VulnCheck advisory and the vulnerable code reference for additional context.
Workarounds
- Restrict network access to the ERPNext /api/method/ path to trusted internal users where feasible.
- Disable or restrict customer portal self-registration until the patch is applied.
- Apply a reverse-proxy rule to block external calls to erpnext.stock.doctype.batch.batch.get_batch_qty, get_batches_by_oldest, and get_pos_reserved_batch_qty.
# Example nginx location block to deny the vulnerable endpoints pre-patch
location ~ ^/api/method/erpnext\.stock\.doctype\.batch\.batch\.(get_batch_qty|get_batches_by_oldest|get_pos_reserved_batch_qty)$ {
deny all;
return 403;
}
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

