Frappe ERPNext SQL Injection Vulnerability in Loyalty Program Details Function

Vulnerability

A SQL injection vulnerability has been identified in Frappe ERPNext version 15.57.5. The issue arises in the 'get_loyalty_program_details_with_points()' function within 'erpnext/accounts/doctype/loyalty_program/loyalty_program.py'. The vulnerability allows attackers to inject SQL queries through the 'expiry_date' parameter, potentially leading to unauthorized data extraction from the database.

Impact

Exploitation of this vulnerability allows for error-based SQL injection, where an attacker can manipulate SQL queries to extract information from the database. During testing, the vulnerability was successfully exploited to retrieve database information such as the version.

Reproduction

The vulnerability can be reproduced by sending a request to the 'get_loyalty_program_details_with_points()' function with a crafted 'expiry_date' parameter that includes an injected SQL query. This can be done through the ERPNext API.

Remediation

Users are advised to update to the latest version of Frappe ERPNext, where this vulnerability has been patched.

Added: Sep 30, 2025, 2:21 PM
Updated: Sep 30, 2025, 8:29 PM

Vulnerability Rating

Custom Algorithm
spread
5.2
impact
2.5
exploitability
9.7
remediation
7.7
relevance
0.6
threat
6.4
urgency
2.9
incentive
10.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.