Summary
Yonyou KSOA 9.0 contains a SQL injection vulnerability in the HTTP GET parameter handler of /kmf/edit_folder.jsp, where the folderid parameter is not safely handled before being used in database operations.
A remote attacker can manipulate this parameter to inject arbitrary SQL, potentially accessing or modifying backend data when the vulnerable endpoint is reachable over the network.
Affected context
The vulnerability occurs in Yonyou KSOA 9.0 within the /kmf/edit_folder.jsp endpoint, specifically in logic that processes the folderid HTTP GET parameter.
It typically manifests when application code builds SQL queries from request parameters without sufficient validation, escaping, or use of parameterized queries.
Systems are affected when this JSP is deployed, exposed over HTTP/HTTPS, and connected to a relational database that executes the constructed SQL statements.
Exploit preconditions
- Attack surface: Remote over HTTP/HTTPS, targeting the /kmf/edit_folder.jsp endpoint.
- Required access: Network access to the application; authentication requirements depend on deployment configuration (the issue description does not guarantee it is authenticated).
- Trigger point: Sending crafted folderid values via GET requests so that user-controlled data is concatenated into SQL statements.
- Why exploitation is possible: The server-side code appears to construct SQL queries using untrusted input from folderid without robust input validation or parameterization, allowing attacker-controlled fragments to alter the intended query structure.
Why this happens
This issue stems from dynamically constructing SQL queries by directly embedding the folderid HTTP parameter into the query string.
Instead of treating folderid strictly as data, the implementation appears to allow it to influence the SQL syntax, leading to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
At a broader level, this is also related to CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component, because untrusted input is passed to the database (a downstream interpreter) without neutralizing characters and tokens significant to SQL.
The insecure pattern can be summarized as string concatenation (or similar interpolation) of user-supplied values into SQL statements without using prepared statements, bound parameters, or strict whitelisting.
Potential impact
- Attackers may read sensitive data from database tables that the application account can access.
- Attackers could modify, insert, or delete records, leading to data corruption or loss.
- In some configurations, attackers might escalate privileges within the application or database (e.g., by altering authorization-related data).
- Under permissive database configurations, attackers could execute database-specific commands that impact availability or enable further lateral movement.
General mitigation guidance
Mitigation focuses on treating all HTTP parameters as untrusted and ensuring they cannot alter SQL syntax:
- Use parameterized queries or prepared statements for all database access, binding folderid as a typed parameter rather than concatenating it into SQL strings.
- Apply strict server-side validation and normalization to folderid, enforcing expected formats and rejecting values that do not match a narrow, documented pattern (e.g., numeric IDs).
- Centralize database access in a data access layer that enforces safe query construction patterns and disallows ad hoc string-built SQL.
- Limit database privileges for the application account so that, even if a query is manipulated, the scope of accessible data and operations is minimized.
- Adopt secure coding standards and development guidelines that explicitly forbid building SQL with raw user input.
How teams detect issues like this
Detection typically combines code-centric and behavior-centric approaches:
- Static analysis: Configure SAST tools or linters to flag direct concatenation of request parameters (such as folderid) into SQL query strings, especially within JSP controllers or DAO classes.
- Code review: During manual reviews, look for patterns where HttpServletRequest parameters are used to build SQL, and verify that all database calls use prepared statements or ORM parameter binding.
- Dynamic testing: Use automated or guided DAST to send SQL meta-characters and time-based probes through the folderid parameter and monitor for anomalies, verbose SQL errors, or timing deviations.
- Runtime monitoring: Enable database and application logging to observe unexpected SQL patterns, unusual WHERE clauses, or error messages indicating malformed queries originating from web requests.

