Summary
Focalboard 8.0 contains a second-order time-based blind SQL injection vulnerability in the category reordering logic, where category IDs are incorporated into dynamic SQL statements without proper sanitization.
An authenticated attacker who can control category ID values may inject SQL that is first stored in the database and later executed when the reorder API processes those stored values, potentially exposing sensitive data such as other users' password hashes.
Affected context
This vulnerability occurs in Focalboard 8.0 when handling category IDs involved in reordering operations.
The application persists attacker-controlled category IDs and later uses them directly in dynamically constructed SQL statements during the reorder process.
The risk materializes in deployments where authenticated users can create or manipulate categories and where the database account used by the application has broad read access to sensitive tables (for example, user accounts, password hashes, or configuration data).
Exploit preconditions
- Attack surface: Application API endpoint(s) responsible for category management and reordering.
- Required access: Authenticated user account with permissions to create or modify categories such that the category ID field can be influenced or indirectly controlled.
- Trigger point: Subsequent invocation of the category reorder API that reads the stored category ID value and embeds it into a dynamic SQL query without proper parameterization or validation.
- Why exploitation is possible: The category ID value is trusted after being stored, and later concatenated into SQL, leading to second-order injection where malicious input is executed in a different code path than where it was initially supplied.
Why this happens
The underlying issue is the construction of SQL queries using untrusted data that is not validated or safely parameterized, aligning with CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
In this case, the bug manifests as a second-order SQL injection: the application accepts input containing SQL meta-characters into the category ID field, stores it in the database, and later retrieves that value and directly interpolates it into a dynamic SQL statement during the reorder operation.
Because the application assumes previously stored data is trustworthy, it skips sanitization or binding, allowing attacker-controlled fragments to alter the logic of the SQL query, including leveraging time-based conditions to exfiltrate information via response delays.
Potential impact
- An attacker may extract sensitive data from database tables, including password hashes and other user-related information.
- An attacker could enumerate or infer other confidential records (e.g., boards, tasks, comments, or configuration entries) through time-based blind techniques.
- An attacker may be able to escalate privileges by reading authorization or role information and targeting higher-privileged accounts.
- Depending on database permissions, an attacker could modify stored data, leading to data corruption, integrity loss, or unauthorized changes to application state.
- Under certain database configurations, an attacker might pivot to execute database-level operations such as creating new users, altering schemas, or accessing additional databases managed by the same server.
General mitigation guidance
Even though no vendor fix is planned, the vulnerability class can be mitigated through secure coding patterns and deployment hardening:
- Replace dynamic SQL string concatenation with parameterized queries or prepared statements for all category-related operations, including reordering.
- Treat all data read from the database as untrusted, and re-validate or safely bind it before reuse in queries, especially for fields that originated from user input.
- Introduce strict server-side validation and typing for identifiers such as category IDs (e.g., enforce integer or UUID formats), rejecting values that do not conform.
- Apply least-privilege to the database account used by the application so that it only has access to the minimal set of tables and operations required.
- Centralize database access logic through a vetted data access layer or ORM that enforces parameterization by default, reducing the risk of ad-hoc dynamic SQL.
- Where possible, add application-level controls such as rate limiting and anomaly detection around sensitive endpoints to make exploitation via time-based probing more difficult.
How teams detect issues like this
To detect and manage this vulnerability class, teams can adopt a combination of review, testing, and monitoring:
- Use static application security testing (SAST) to flag dynamic SQL construction that concatenates variables, especially for query fragments derived from IDs or other user-controlled fields.
- During code review, look for patterns where stored values (e.g., category IDs) are retrieved and directly embedded into SQL strings without parameter binding or re-validation.
- Employ dynamic application security testing (DAST) or interactive testing focused on API endpoints that modify or reorder entities, checking for time-based blind SQL injection indicators.
- Configure application and database logging to capture slow queries, unusual delays correlated with specific API calls, or unexpected query patterns that may indicate time-based probing.
- Integrate pre-commit or CI checks that enforce secure database access patterns (for example, disallowing raw string-built queries in favor of a safe abstraction layer).

