Summary
ILIAS contains a SQL injection vulnerability in RegistrationCodeRepository::getCodesData() because unvalidated sort fields are added to an ORDER BY clause. An authenticated user with read access to the Authentication and Registration administration node may use this behavior to infer database contents through boolean-based queries.
Affected context
The issue affects ILIAS 11.0 versions before 11.6 in the registration-code data retrieval path. It becomes relevant when a request supplies a sort parameter that is incorporated into the SQL ORDER BY clause without adequate validation or safe handling.
Exploit preconditions
- Attack surface: The registration-code data retrieval functionality in ILIAS
- Required access: An authenticated account with read access to the Authentication and Registration administration node
- Trigger point: A request that supplies a sort parameter to
RegistrationCodeRepository::getCodesData() - Why exploitation is possible: Unvalidated sort input is concatenated into an SQL
ORDER BYclause, allowing SQL expressions to influence query behavior and support boolean-based inference
Why this happens
The underlying bug is SQL injection, mapped to CWE-89. The application treats a user-controlled sort field as SQL syntax by concatenating it into a query rather than restricting it to trusted, predefined identifiers. As a result, input can alter query behavior instead of being handled only as data.
Potential impact
- An attacker may infer database contents through boolean-based responses.
- Sensitive information stored in the database could be exposed.
- Database queries may behave differently than intended, potentially affecting application data access.
General mitigation guidance
Defensive patterns focus on preventing user input from becoming executable SQL syntax:
- Map requested sort options to a strict allowlist of known column identifiers.
- Use parameterized queries for values, while handling SQL identifiers through safe, predefined mappings.
- Reject unexpected, malformed, or unsupported sort parameters.
- Apply least-privilege permissions to database accounts and limit access to administrative functionality.
- Reduce reliance on user-controlled query structure and review other dynamic SQL construction paths.
How teams detect issues like this
High-level detection approaches include:
- Use static analysis rules to flag string concatenation of request parameters into SQL statements, especially
ORDER BYclauses. - Review code paths that accept sort or filter parameters and confirm identifiers are mapped to an allowlist.
- Monitor for unusual requests to registration-code functionality and repeated responses consistent with boolean-based inference.
- Enforce code review and security testing policies for dynamic query construction; automated review tools may help identify suspicious patterns.

