Summary
Frappe ERPNext contains SQL injection weaknesses in several endpoints that do not adequately validate input. An authenticated user, including one without assigned roles, may be able to read sensitive information belonging to other users or escalate access to a privileged account.
Frappe ERPNext contains SQL injection weaknesses in several endpoints that do not adequately validate input. An authenticated user, including one without assigned roles, may be able to read sensitive information belonging to other users or escalate access to a privileged account.
Affected context
The vulnerability affects ERPNext deployments where exposed endpoints process user-controlled input without sufficient validation or safe query construction. Exploitation may be possible for authenticated accounts with limited or no assigned roles when those endpoints are reachable and the supplied input influences database queries.
The vulnerability affects ERPNext deployments where exposed endpoints process user-controlled input without sufficient validation or safe query construction. Exploitation may be possible for authenticated accounts with limited or no assigned roles when those endpoints are reachable and the supplied input influences database queries.
Exploit preconditions
- Attack surface: ERPNext application endpoints that accept user-controlled parameters
- Required access: An authenticated account; extensive role assignments may not be necessary
- Trigger point: Processing a crafted request by an endpoint lacking effective input validation
- Why exploitation is possible: User-controlled values may influence database queries, allowing query behavior to deviate from the intended operation
- Attack surface: ERPNext application endpoints that accept user-controlled parameters
- Required access: An authenticated account; extensive role assignments may not be necessary
- Trigger point: Processing a crafted request by an endpoint lacking effective input validation
- Why exploitation is possible: User-controlled values may influence database queries, allowing query behavior to deviate from the intended operation
Why this happens
The underlying flaw is the construction or execution of database queries using insufficiently constrained external input. When application data is incorporated into SQL logic without reliable parameterization and validation, an attacker may alter query meaning rather than supplying only a data value. This behavior maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
The underlying flaw is the construction or execution of database queries using insufficiently constrained external input. When application data is incorporated into SQL logic without reliable parameterization and validation, an attacker may alter query meaning rather than supplying only a data value. This behavior maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Potential impact
- An attacker may read sensitive information belonging to other users
- Confidential business or account data could be disclosed
- Application authorization boundaries may be bypassed
- An attacker could potentially escalate access to a privileged account
- Database integrity or availability could be affected
- An attacker may read sensitive information belonging to other users
- Confidential business or account data could be disclosed
- Application authorization boundaries may be bypassed
- An attacker could potentially escalate access to a privileged account
- Database integrity or availability could be affected
General mitigation guidance
Mitigation generally focuses on ensuring that all database access uses safe query construction and that request data is treated as untrusted.
Common defensive patterns include:
- Using parameterized queries, prepared statements, or trusted ORM query APIs
- Applying allowlisted validation appropriate to each parameter's expected type and purpose
- Avoiding dynamic SQL construction from request values
- Enforcing authorization checks independently of query filtering
- Limiting database-account privileges to only the operations required by the application
- Reducing endpoint exposure and reviewing access for low-privilege accounts
- Monitoring and reviewing database access involving sensitive user records
Mitigation generally focuses on ensuring that all database access uses safe query construction and that request data is treated as untrusted.
Common defensive patterns include:
- Using parameterized queries, prepared statements, or trusted ORM query APIs
- Applying allowlisted validation appropriate to each parameter's expected type and purpose
- Avoiding dynamic SQL construction from request values
- Enforcing authorization checks independently of query filtering
- Limiting database-account privileges to only the operations required by the application
- Reducing endpoint exposure and reviewing access for low-privilege accounts
- Monitoring and reviewing database access involving sensitive user records
How teams detect issues like this
Organizations can look for SQL injection risk through:
- Static analysis rules identifying string concatenation or interpolation in SQL statements
- Code review checks for raw query APIs, dynamic identifiers, and missing parameter binding
- Tests that verify malformed and unexpected input cannot alter query structure
- Endpoint inventories that identify authenticated interfaces accepting database-related parameters
- Web application firewall or gateway policies for suspicious query-manipulation patterns, used as a supplementary control
- Database audit logging for unusual cross-user reads, authorization failures, and abnormal query behavior
Organizations can look for SQL injection risk through:
- Static analysis rules identifying string concatenation or interpolation in SQL statements
- Code review checks for raw query APIs, dynamic identifiers, and missing parameter binding
- Tests that verify malformed and unexpected input cannot alter query structure
- Endpoint inventories that identify authenticated interfaces accepting database-related parameters
- Web application firewall or gateway policies for suspicious query-manipulation patterns, used as a supplementary control
- Database audit logging for unusual cross-user reads, authorization failures, and abnormal query behavior

