Summary
A SQL injection vulnerability in Traccar's permissions API allows certain authenticated users to influence part of a database query through an unexpected JSON object key. Under the affected authorization and object-access conditions, an attacker may infer sensitive database values or conditionally remove permission records.
Affected context
The vulnerability occurs in Traccar versions before 6.14.0 when the permissions API processes a deletion request from an authenticated, non-readonly user. Exploitation depends on the user having access to an object that can participate in a permission pair and on the request reaching the permission-removal database logic.
Exploit preconditions
- Attack surface: The authenticated permissions deletion API.
- Required access: An authenticated, non-readonly account with access to an eligible object.
- Trigger point: Processing a permission deletion request containing an additional attacker-controlled JSON key.
- Why exploitation is possible: Input validation checks only the first two map entries, while the storage layer incorporates every key into a SQL WHERE clause as a column identifier.
Why this happens
The underlying flaw is a mismatch between input validation and database query construction. The permission model validates only an expected subset of map keys, but the storage layer trusts all remaining keys and concatenates them into SQL rather than treating them as constrained identifiers. This maps to CWE-89: SQL Injection, because attacker-influenced input can alter database query behavior and produce inference or modification effects.
Potential impact
- Sensitive database values, including administrator contact data and credential material, may be disclosed through inference.
- Permission records could be conditionally deleted or altered.
- Administrative accounts or access relationships could be weakened.
- The application and its data may be exposed to broader compromise if recovered credentials are usable elsewhere.
General mitigation guidance
Mitigation generally focuses on ensuring that user-controlled data cannot become SQL syntax.
Common defensive patterns include:
- Constructing queries with parameterized values and allowlisted, fixed database identifiers.
- Rejecting unexpected object keys before data reaches storage operations.
- Representing permission relationships with typed fields rather than generic maps.
- Applying consistent validation at both the API and persistence layers.
- Restricting permission-management capabilities according to least privilege.
- Limiting database accounts to the minimum operations required by the application.
How teams detect issues like this
Organizations can look for:
- Static analysis findings where request-derived map keys or strings are concatenated into SQL statements.
- Code review signals involving generic maps used to construct WHERE clauses or dynamic column identifiers.
- Tests that submit unexpected fields and verify strict rejection without database-side behavioral differences.
- Database monitoring for unusual permission-deletion patterns, query errors, or repeated boolean and error-based inference signals.
- Policy enforcement requiring parameterized queries and allowlisted dynamic identifiers.
Neutral automated code-review and application-security tools may help identify these patterns during development.

