CVE-2024-47062
JSON

9.4critical

Multiple SQL Injections and ORM Leak in navidrome

Severity
9.4critical CVSS:4.0 by GitHub_M
Exploit likelihood
4.46% (higher than 91% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-58vj-cv5w-v4v6GO-2024-3153

Description

Navidrome is an open source web-based music collection server and streamer. Navidrome automatically adds parameters in the URL to SQL queries. This can be exploited to access information by adding parameters like `password=...` in the URL (ORM Leak). Furthermore, the names of the parameters are not properly escaped, leading to SQL Injections. Finally, the username is used in a `LIKE` statement, allowing people to log in with `%` instead of their username. When adding parameters to the URL, they are automatically included in an SQL `LIKE` statement (depending on the parameter's name). This allows attackers to potentially retrieve arbitrary information. For example, attackers can use the following request to test whether some encrypted passwords start with `AAA`. This results in an SQL query like `password LIKE 'AAA%'`, allowing attackers to slowly brute-force passwords. When adding parameters to the URL, they are automatically added to an SQL query. The names of the parameters are not properly escaped. This behavior can be used to inject arbitrary SQL code (SQL Injection). These vulnerabilities can be used to leak information and dump the contents of the database and have been addressed in release version 0.53.0. Users are advised to upgrade. There are no known workarounds for this vulnerability.

Affected

Product or packageVersionsReported by
navidrome navidrome< 0.53.0, 0.53.0, before 0.53.0CVE List, NVD
github.com/navidrome/navidrome (Go)before 0.53.0GitHub Advisory Database, Go Vulnerability Database

All scores

GitHub_M9.4critical CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:L
GitHub8.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
GitHubcritical CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:L
NVD8.8high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

Classification

CWE-89

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total.

What each source says

CVE List

Navidrome is an open source web-based music collection server and streamer. Navidrome automatically adds parameters in the URL to SQL queries. This can be exploited to access information by adding parameters like `password=...` in the URL (ORM Leak). Furthermore, the names of the parameters are not properly escaped, leading to SQL Injections. Finally, the username is used in a `LIKE` statement, allowing people to log in with `%` instead of their username. When adding parameters to the URL, they are automatically included in an SQL `LIKE` statement (depending on the parameter's name). This allows attackers to potentially retrieve arbitrary information. For example, attackers can use the following request to test whether some encrypted passwords start with `AAA`. This results in an SQL query like `password LIKE 'AAA%'`, allowing attackers to slowly brute-force passwords. When adding parameters to the URL, they are automatically added to an SQL query. The names of the parameters are not properly escaped. This behavior can be used to inject arbitrary SQL code (SQL Injection). These vulnerabilities can be used to leak information and dump the contents of the database and have been addressed in release version 0.53.0. Users are advised to upgrade. There are no known workarounds for this vulnerability.

GitHub Advisory Database

Security Advisory: Multiple Vulnerabilities in Navidrome

Summary

Navidrome automatically adds parameters in the URL to SQL queries. This can be exploited to access information by adding parameters like password=... in the URL (ORM Leak).

Furthermore, the names of the parameters are not properly escaped, leading to SQL Injections.

Finally, the username is used in a LIKE statement, allowing people to log in with % instead of their username.

Details

ORM Leak

When adding parameters to the URL, they are automatically included in an SQL LIKE statement (depending on the parameter's name). This allows attackers to potentially retrieve arbitrary information.

For example, attackers can use the following request to test whether some encrypted passwords start with AAA:

GET /api/user?_end=36&_order=DESC&password=AAA%

This results in an SQL query like password LIKE 'AAA%', allowing attackers to slowly brute-force passwords. (Also, any reason for using encryption instead of hashing?)

SQL Injections

When adding parameters to the URL, they are automatically added to an SQL query. The names of the parameters are not properly escaped.

This behavior can be used to inject arbitrary SQL code (SQL Injection), for example:

GET /api/album?_end=36&_order=DESC&_sort=recently_added&_start=0&SELECT+*+FROM+USER--=123 HTTP/1.1

This is only an example, but you should see an error message in the logs.

Authentication Weakness

When retrieving the user for authentication, the following code is used:

func (r *userRepository) FindByUsername(username string) (model.User, error) {
    sel := r.newSelect().Columns("").Where(Like{"user_name": username})
    var usr model.User
    err := r.queryOne(sel, &usr)
    return &usr, err
}

This relies on a LIKE statement and allows users to log in with % instead of the legitimate username.

Proof of Concept (PoC)

See above.

Impact

These vulnerabilities can be used to leak information and dump the contents of the database.

Credit

Louis Nyffenegger from PentesterLab

Go Vulnerability Database

Navidrome has Multiple SQL Injections and ORM Leak in github.com/navidrome/navidrome

NVD (es)

Navidrome es un servidor y transmisor de música de código abierto basado en la web. Navidrome agrega automáticamente parámetros en la URL a las consultas SQL. Esto se puede explotar para acceder a la información agregando parámetros como `password=...` en la URL (filtración de ORM). Además, los nombres de los parámetros no se escapan correctamente, lo que lleva a inyecciones SQL. Finalmente, el nombre de usuario se usa en una declaración `LIKE`, lo que permite a las personas iniciar sesión con `%` en lugar de su nombre de usuario. Al agregar parámetros a la URL, se incluyen automáticamente en una declaración SQL `LIKE` (según el nombre del parámetro). Esto permite a los atacantes recuperar potencialmente información arbitraria. Por ejemplo, los atacantes pueden usar la siguiente solicitud para probar si algunas contraseñas cifradas comienzan con `AAA`. Esto da como resultado una consulta SQL como `password LIKE 'AAA%'`, lo que permite a los atacantes forzar lentamente las contraseñas. Al agregar parámetros a la URL, se agregan automáticamente a una consulta SQL. Los nombres de los parámetros no se escapan correctamente. Este comportamiento se puede utilizar para inyectar código SQL arbitrario (inyección SQL). Estas vulnerabilidades se pueden utilizar para filtrar información y volcar el contenido de la base de datos y se han solucionado en la versión 0.53.0. Se recomienda a los usuarios que actualicen la versión. No se conocen workarounds para esta vulnerabilidad.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-47062 changed 2024-09-20CVE Terms of Use
GitHub Advisory DatabaseGHSA-58vj-cv5w-v4v6 changed 2024-09-26CC-BY-4.0
Go Vulnerability DatabaseGO-2024-3153 changed 2026-03-03CC-BY-4.0
NVDCVE-2024-47062 changed 2026-06-17Public domain