CVE-2024-47062: Github.com/navidrome/navidrome SQL Injection Vulnerability
CRITICALCVE-2024-47062 is a CRITICAL (CVSS 8.8) sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Github.com/navidrome/navidrome libraries in the Go ecosystem. The issue involves navidrome has multiple sql injections and orm leak. Remediation is available by upgrading affected packages to version 0.53.0.
CVE-2024-47062 at a Glance
Security Impact
CVSS: 8.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2024-47062
To remediate this vulnerability, upgrade all affected Github.com/navidrome/navidrome dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/navidrome/navidrome to 0.53.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/navidrome/navidrome
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-47062, inspect your project dependencies for Github.com/navidrome/navidrome:
inspect dependencies for github.com/navidrome/navidrome
Analyze the terminal output to locate any version of Github.com/navidrome/navidrome in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.53.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In Github.com/navidrome/navidrome, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-47062 Affected Github.com/navidrome/navidrome Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/navidrome/navidrome
|
Go |
< 0.53.0
|
0.53.0
|
References
Frequently Asked Questions
What is CVE-2024-47062?
Which Github.com/navidrome/navidrome versions are affected?
What version fixes CVE-2024-47062?
Is github.com/navidrome/navidrome affected?
What is the CVSS score of CVE-2024-47062?
What CWE is associated with CVE-2024-47062?
How can I check Go dependencies for CVE-2024-47062?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-58vj-cv5w-v4v6",
"modified" : "2024-09-20T22:07:50Z",
"published" : "2024-09-20T14:51:56Z",
"aliases" : [ "CVE-2024-47062" ],
"summary" : "Navidrome has Multiple SQL Injections and ORM Leak",
"details" : "# Security Advisory: Multiple Vulnerabilities in Navidrome\n\n## Summary\n\nNavidrome 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).\n\nFurthermore, the names of the parameters are not properly escaped, leading to SQL Injections.\n\nFinally, the username is used in a `LIKE` statement, allowing people to log in with `%` instead of their username.\n\n## Details\n\n### ORM Leak\n\nWhen 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.\n\nFor example, attackers can use the following request to test whether some encrypted passwords start with `AAA`:\n\n```\nGET /api/user?_end=36&_order=DESC&password=AAA%\n```\n\nThis 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?)\n\n### SQL Injections\n\nWhen adding parameters to the URL, they are automatically added to an SQL query. The names of the parameters are not properly escaped.\n\nThis behavior can be used to inject arbitrary SQL code (SQL Injection), for example:\n\n```\nGET /api/album?_end=36&_order=DESC&_sort=recently_added&_start=0&SELECT+*+FROM+USER--=123 HTTP/1.1\n```\n\nThis is only an example, but you should see an error message in the logs.\n\n### Authentication Weakness\n\nWhen retrieving the user for authentication, the following code is used:\n\n```go\nfunc (r *userRepository) FindByUsername(username string) (model.User, error) {\n sel := r.newSelect().Columns(\"\").Where(Like{\"user_name\": username})\n var usr model.User\n err := r.queryOne(sel, &usr)\n return &usr, err\n}\n```\n\nThis relies on a `LIKE` statement and allows users to log in with `%` instead of the legitimate username.\n\n## Proof of Concept (PoC)\n\nSee above.\n\n## Impact\n\nThese vulnerabilities can be used to leak information and dump the contents of the database.\n\n## Credit\n\nLouis Nyffenegger from PentesterLab",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/navidrome/navidrome"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.53.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/navidrome/navidrome/security/advisories/GHSA-58vj-cv5w-v4v6"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-47062"
}, {
"type" : "WEB",
"url" : "https://github.com/navidrome/navidrome/commit/3107170afd9f557a10f7031f23cb3c9e975a71f9"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/navidrome/navidrome"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-89" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2024-09-20T14:51:56Z",
"nvd_published_at" : "2024-09-20T19:15:16Z"
}
}