{"answers":{"affected":"2 open source packages ship an affected version, including uptime-kuma.","exploited":"There is no known exploitation of GHSA-hfxh-rjv7-2369 in the wild and no public exploit code.","fix":"Upgrade uptime-kuma to 1.23.7 or later.","what":"GHSA-hfxh-rjv7-2369 is a command injection vulnerability in uptime-kuma, published on 27 Nov 2023. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for GHSA-hfxh-rjv7-2369 and fix it if it is affected.\n\nWhat it is: GHSA-hfxh-rjv7-2369 is a command injection vulnerability in uptime-kuma, published on 27 Nov 2023. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of GHSA-hfxh-rjv7-2369 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- uptime-kuma (npm): affected from 1.23.0; fixed in 1.23.7\n- uptime-kuma (npm): affected from 1.23.0; fixed in 1.23.7\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-hfxh-rjv7-2369/ (Markdown: https://insights.sbomify.com/GHSA-hfxh-rjv7-2369/index.md)","id":"GHSA-hfxh-rjv7-2369","markdown":"https://insights.sbomify.com/GHSA-hfxh-rjv7-2369/index.md","name":"GHSA-hfxh-rjv7-2369","record":{"aliases":[],"analysis":{"component_type":"web_application","fix_type":"patch","impacts":["code_execution"],"network_reachable":"yes","non_default_config":false,"product_category":"Uptime Kuma monitoring","requires_auth":"low_privilege","summary":"Authenticated users can execute arbitrary commands on the server via command injection in the Tailscale Ping monitor feature.","user_interaction":"required","vuln_class":"command_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"### Summary\n\nThe `runTailscalePing` method of the `TailscalePing` class injects the `hostname` parameter inside a shell command, leading to a command injection and the possibility to run arbitrary commands on the server.\n\n### Details\n\nWhen adding a new monitor on Uptime Kuma, we can select the \"Tailscale Ping\" type. Then we can add a hostname and insert a command injection payload into it. The front-end application requires that the field follow a specific pattern, this validation only happens on the front-end and can be removed by removing the attribute `pattern` on the `input` element.\n\nhttps://github.com/louislam/uptime-kuma/blob/dc4242019331e65a79ac16deef97510144e01b12/server/monitor-types/tailscale-ping.js#L40-L46\n\nWe can finally add the new monitor and observe that our command is being executed.\n\n**NOTE:** When using Uptime Kuma inside a container, the \"TailScale Ping\" type is not visible. We can fake this information by intercepting WebSocket messages and set the `isContainer` option to `false`.\n\n### PoC\n\n* Authenticate.\n* Create a new monitor.\n* Select the TailScale Ping type (if not visible, see the note in the details section).\n* Insert the command injection payload inside the `hostname` field. (for example `$(id \u003e\u00262)`)\n* Remove the `pattern` requirement on the field.\n* Save and start the monitor.\n\n### Impact\n\nAn authenticated user can execute arbitrary command on the server running Uptime Kuma.\n\n### Remediation\n\nThere are other command execution in the codebase, they use a method `spawn` from the `child_process` module which does not interpret the command as a shell command, the same thing should be done here.\n\n**NOTE:** The Tailscale CLI seems to support the `--` sequence. It should be used between the `ping` subcommand and the `hostname` argument to avoid argument injection.","ecosystems":["npm"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"Uptime Kuma Authenticated remote code execution via TailscalePing","id":"GHSA-hfxh-rjv7-2369","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"npm","product":null,"products":[],"type":"command_injection","year":"2023"},"n_packages":2,"n_references":null,"packages":[{"ecosystem":"npm","fixed":["1.23.7"],"introduced":["1.23.0"],"last_affected":[],"package":"uptime-kuma","purl":null,"source":"GHSA-hfxh-rjv7-2369"},{"ecosystem":"npm","fixed":["1.23.7"],"introduced":["1.23.0"],"last_affected":[],"package":"uptime-kuma","purl":"pkg:npm/uptime-kuma","source":"GHSA-hfxh-rjv7-2369"}],"products":null,"published":"2023-11-27","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Authenticated users can execute arbitrary commands on the server via command injection in the Tailscale Ping monitor feature.","url":"https://insights.sbomify.com/GHSA-hfxh-rjv7-2369/"}