Summary
A SQL injection vulnerability in Siam Ordering (siam-server) 1.0.0 affects multiple mapper components that construct database queries using ${} string concatenation. A remote authenticated attacker who can reach affected functionality may execute arbitrary SQL commands against the application's database.
Affected context
The vulnerability occurs in Siam Ordering server components, including AdminMapper.java, MerchantWithdrawRecordMapper.java, and MemberWithdrawRecordMapper.java, where request-controlled values may be incorporated into SQL statements through string concatenation. Risk depends on exposure of the affected endpoints, the privileges of the authenticated account, and the database permissions available to the application.
Exploit preconditions
- Attack surface: Network-accessible Siam Ordering server endpoints backed by affected mapper classes
- Required access: Valid authentication or another means of reaching the protected functionality
- Trigger point: An application operation that passes attacker-influenced values to a vulnerable mapper query
- Why exploitation is possible: Input is incorporated into SQL through
${}string concatenation rather than being consistently treated as a bound parameter
Why this happens
The underlying bug is an injection-prone query construction pattern in which external input is combined directly with SQL text. In mapper-based database code, ${} substitution can insert values into the query structure before execution, allowing data to alter SQL semantics instead of remaining data values. This behavior maps to CWE-89, Improper Neutralization of Special Elements used in an SQL Command.
Potential impact
- An attacker may read sensitive records from the application database
- An attacker could modify, delete, or corrupt stored data
- SQL commands may be executed with the permissions of the application database account
- Authentication, financial, merchant, or member-related data could be exposed
- The vulnerability may enable further compromise if the database account has excessive privileges
General mitigation guidance
Mitigation generally focuses on eliminating query construction patterns that
treat external input as SQL syntax.
- Use parameterized statements, prepared queries, or framework-supported
bound parameters by default.
- Prefer safe placeholder mechanisms that preserve the distinction between
SQL structure and data values.
- Avoid raw string substitution for values originating outside trusted code.
- Apply allowlists for inputs that must control identifiers or query structure,
such as sortable fields, column names, or operation modes.
- Reduce database-account privileges to only the permissions required by each
service function.
- Apply validation at trust boundaries while treating validation as
complementary to parameterization rather than a replacement.
- Keep sensitive database operations separated by narrowly scoped service
permissions where practical.
How teams detect issues like this
Detection approaches may include:
- Static analysis rules that flag
${}substitution, string concatenation, or
interpolation within SQL mapper statements.
- Code review checks for mapper queries whose parameters can originate from
HTTP requests, administrative forms, or other remote inputs.
- Repository searches for raw SQL construction and database APIs that do not
expose parameter binding.
- Runtime monitoring for unusual query errors, unexpected query shapes, or
abnormal read and write activity from the application database account.
- CI policy enforcement requiring parameterized queries for externally
influenced values.
- Neutral automated code-review or application-security tools can help identify
injection-prone query patterns before deployment.

