diff --git a/advisories/github-reviewed/2024/09/GHSA-58vj-cv5w-v4v6/GHSA-58vj-cv5w-v4v6.json b/advisories/github-reviewed/2024/09/GHSA-58vj-cv5w-v4v6/GHSA-58vj-cv5w-v4v6.json index 04de6c46bf9..35d36038f16 100644 --- a/advisories/github-reviewed/2024/09/GHSA-58vj-cv5w-v4v6/GHSA-58vj-cv5w-v4v6.json +++ b/advisories/github-reviewed/2024/09/GHSA-58vj-cv5w-v4v6/GHSA-58vj-cv5w-v4v6.json @@ -1,10 +1,10 @@ { "schema_version": "1.4.0", "id": "GHSA-58vj-cv5w-v4v6", - "modified": "2024-09-20T14:51:56Z", + "modified": "2024-09-20T16:41:08Z", "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",