VAITP Dataset

← Back to the dataset

CVE-2026-96672

Arbitrary method execution via unvalidated calculation_formula in ERPNext <16.34.1.

  • CVSS 5.3
  • CWE-470
  • Authentication, Authorization, and Session Management
  • Remote

Frappe ERPNext versions before 16.34.1 fail to validate that Financial Report Template calculation_formula values reference whitelisted methods before passing them to frappe.call(). Accounts Managers can supply arbitrary dotted Python paths to invoke non-whitelisted internal server-side methods and read their return values.

CVSS base score
5.3
Published
2026-09-23
OWASP
A01 Broken Access Control
Orthogonal defect classification
Checking
Code defect classification
Missing Check
Category
Authentication, Authorization, and Session Management
Subcategory
Privilege Escalation
Accessibility scope
Remote
Impact
Unauthorized Access
Affected component
Frappe
Fixed by upgrading
Yes

Solution

Upgrade Frappe ERPNext to version 16.34.1 or newer.

Vulnerable code sample

import frappe

WHITELISTED_METHODS = {
    "erpnext.accounts.doctype.financial_report_template.financial_report_template.get_default",
    "erpnext.accounts.doctype.financial_report_template.financial_report_template.calculate_tax",
}

def get_report_value(report, calculation_formula):
    # VULNERABLE: unsanitized method path passed to frappe.call()
    return frappe.call(calculation_formula, report=report)

def render_report(report):
    formula = report.get("calculation_formula")
    value = get_report_value(report, formula)
    return {"value": value}

Patched code sample

import frappe

WHITELISTED_METHODS = {
    "erpnext.accounts.doctype.financial_report_template.financial_report_template.get_default",
    "erpnext.accounts.doctype.financial_report_template.financial_report_template.calculate_tax",
}

def get_report_value(report, calculation_formula):
    # FIX: validate method against whitelist before calling
    if calculation_formula not in WHITELISTED_METHODS:
        raise frappe.PermissionError("Method not allowed")
    return frappe.call(calculation_formula, report=report)

def render_report(report):
    formula = report.get("calculation_formula")
    value = get_report_value(report, formula)
    return {"value": value}

Published fix

Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.

  • fix!: improve validation in financial report template (frappe/erpnext)
    erpnext/accounts/doctype/financial_report_template/financial_report_engine.py, erpnext/accounts/doctype/financial_report_template/financial_report_engine.py · RowProcessor._process_api_row, erpnext/accounts/doctype/financial_report_template/financial_report_validation.py, erpnext/accounts/doctype/financial_report_template/financial_report_validation.py · FormulaValidator._validate_custom_api

Cite this entry

@misc{vaitp:cve202696672,
  title        = {{Arbitrary method execution via unvalidated calculation_formula in ERPNext <16.34.1.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-96672},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-96672/}}
}

Download this entry as JSON Download the whole dataset

Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.