Summary
REBUILD contains an SQL injection vulnerability in the project task-listing endpoint, where authenticated users can supply AjQL conditions through the plan parameter. A low-privileged user may use returned task counts as a boolean oracle to recover a task creator's password hash and potentially log in as that user, including an administrator.
Affected context
The issue affects REBUILD versions 2.7.0 through 4.5.4 in the /project/tasks/list endpoint. The plan parameter accepts AjQL conditions, and the task count returned by the endpoint can expose information about matching records when those conditions are incorporated into database queries unsafely.
Exploit preconditions
- Attack surface: The
/project/tasks/listendpoint - Required access: A low-privileged authenticated account
- Trigger point: Supplying a
planvalue that is processed as AjQL conditions - Why exploitation is possible: The reported behavior allows injected conditions to influence query results, and task counts can act as a boolean oracle for recovering hash information.
Why this happens
The vulnerability is consistent with CWE-89: SQL Injection. It occurs when user-controlled query conditions are incorporated into SQL without adequate separation between data and query logic. In this case, the plan parameter's AjQL conditions can affect database query behavior rather than being handled strictly as validated data.
Potential impact
- An attacker may infer sensitive information from task counts.
- A task creator's SHA-256 password hash could be recovered.
- Recovered credentials may allow account access, potentially including administrator access.
- Unauthorized access could enable further exposure or modification of application data.
General mitigation guidance
Mitigation generally focuses on keeping user input separate from executable query logic.
- Use parameterized queries or other safe query-building APIs.
- Parse AjQL input against a strict, allowlisted grammar and reject unsupported conditions.
- Avoid exposing detailed counts or other response differences that reveal sensitive query results.
- Apply least-privilege database permissions and restrict access to sensitive authentication data.
- Treat all client-supplied query parameters as untrusted, including those submitted by authenticated users.
How teams detect issues like this
- Use static analysis to identify SQL construction that incorporates request parameters or parsed query conditions.
- Review code paths from the
planparameter through AjQL parsing and database query execution. - Test that malformed or unexpected conditions are rejected and that query values remain parameterized.
- Apply policy checks that prohibit unsafe query concatenation and monitor unusual task-list queries or repeated count-based probing.

