Summary
AzuraCast versions through 0.23.7 contain a SQL injection vulnerability in the backup restoration workflow. The restore process executes SQL extracted from a backup archive without sufficient content validation, which may allow a remote attacker with access to the restoration function to alter database data and escalate privileges.
Affected context
The vulnerability occurs in AzuraCast deployments that use the backup restoration functionality and process database files from uploaded or otherwise attacker-influenced backup archives. Risk depends on whether an untrusted party can submit, replace, or cause the system to restore a crafted archive and whether the restore process runs with access to privileged application data.
Exploit preconditions
- Attack surface: AzuraCast backup restoration functionality
- Required access: Ability to reach the restore workflow and influence the backup archive or extracted database file
- Trigger point: Execution of the
azuracast:restorecommand during database restoration - Why exploitation is possible: Database content is executed without adequate validation or sanitization, allowing attacker-controlled SQL statements to affect application data and privilege-related records
Why this happens
The underlying flaw is an unsafe trust boundary between backup contents and database execution. The restoration process treats extracted SQL as trusted executable input instead of validating its origin, structure, and permitted operations before execution. This behavior maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command, because attacker-influenced input can alter the intended meaning or effect of database commands.
Potential impact
- An attacker may modify user, role, or permission records
- The application could experience unauthorized privilege escalation
- Sensitive database contents may be disclosed or altered
- Application integrity could be compromised
- The service could become unavailable through destructive database changes
General mitigation guidance
Mitigation generally focuses on reducing trust in backup content and preventing arbitrary database commands from being accepted during restoration.
Common defensive patterns include:
- Applying strict archive and database schema validation before restoration
- Allowing only approved backup formats and expected SQL structures
- Separating data restoration from privileged account and authorization tables
- Requiring authenticated, authorized, and auditable restore operations
- Running restoration tasks with the minimum database privileges needed
- Isolating restore jobs from production credentials and sensitive services
- Treating uploaded backups as untrusted files throughout processing
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis of restore code that executes SQL assembled from files or external inputs
- Code review signals such as direct execution of archive contents without schema or allowlist checks
- Runtime monitoring for unexpected changes to administrator, role, or permission records
- Audit policies requiring approval and logging for database restoration operations
- Automated security review rules that flag untrusted file content reaching database execution APIs

