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.
8322 vulnerabilities reference this CWE, most recent first.
GHSA-RWWX-GX55-3MQ6
Vulnerability from github – Published: 2025-09-08 15:37 – Updated: 2025-09-08 15:37rsbi-os 4.7 is vulnerable to Remote Code Execution (RCE) in sqlite-jdbc.
{
"affected": [],
"aliases": [
"CVE-2025-57141"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-09-08T15:15:36Z",
"severity": "CRITICAL"
},
"details": "rsbi-os 4.7 is vulnerable to Remote Code Execution (RCE) in sqlite-jdbc.",
"id": "GHSA-rwwx-gx55-3mq6",
"modified": "2025-09-08T15:37:45Z",
"published": "2025-09-08T15:37:45Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-57141"
},
{
"type": "WEB",
"url": "https://github.com/line2222/vuln/issues/2"
},
{
"type": "WEB",
"url": "https://github.com/ruisibi/rsbi-os"
}
],
"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-RWXP-HWWF-653V
Vulnerability from github – Published: 2021-05-17 20:58 – Updated: 2023-04-04 17:30express-hbs is an Express handlebars template engine. express-hbs mixes pure template data with engine configuration options through the Express render API. More specifically, the layout parameter may trigger file disclosure vulnerabilities in downstream applications. This potential vulnerability is somewhat restricted in that only files with existing extentions (i.e. file.extension) can be included, files that lack an extension will have .hbs appended to them. For complete details refer to the referenced GHSL-2021-019 report. Notes in documentation have been added to help users of express-hbs avoid this potential information exposure vulnerability.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "express-hbs"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "2.4.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2021-32817"
],
"database_specific": {
"cwe_ids": [
"CWE-200",
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2021-05-17T19:09:07Z",
"nvd_published_at": "2021-05-14T19:15:00Z",
"severity": "MODERATE"
},
"details": "express-hbs is an Express handlebars template engine. express-hbs mixes pure template data with engine configuration options through the Express render API. More specifically, the layout parameter may trigger file disclosure vulnerabilities in downstream applications. This potential vulnerability is somewhat restricted in that only files with existing extentions (i.e. file.extension) can be included, files that lack an extension will have .hbs appended to them. For complete details refer to the referenced GHSL-2021-019 report. Notes in documentation have been added to help users of express-hbs avoid this potential information exposure vulnerability.",
"id": "GHSA-rwxp-hwwf-653v",
"modified": "2023-04-04T17:30:41Z",
"published": "2021-05-17T20:58:51Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-32817"
},
{
"type": "WEB",
"url": "https://github.com/TryGhost/express-hbs/commit/ff6fad6e357699412d4e916273314e5e7af1500e"
},
{
"type": "PACKAGE",
"url": "https://github.com/TryGhost/express-hbs"
},
{
"type": "WEB",
"url": "https://github.com/TryGhost/express-hbs#%EF%B8%8F-this-creates-a-potential-security-vulnerability"
},
{
"type": "ADVISORY",
"url": "https://securitylab.github.com/advisories/GHSL-2021-019-express-hbs"
},
{
"type": "WEB",
"url": "https://www.npmjs.com/package/express-hbs"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N",
"type": "CVSS_V3"
}
],
"summary": "Insecure template handling in express-hbs"
}
GHSA-RX39-82VR-XG3P
Vulnerability from github – Published: 2022-05-17 02:15 – Updated: 2022-05-17 02:15job/uploadfile_save.php in MetInfo through 5.3.17 blocks the .php extension but not related extensions, which might allow remote authenticated admins to execute arbitrary PHP code by uploading a .phtml file after certain actions involving admin/system/safe.php and job/cv.php.
{
"affected": [],
"aliases": [
"CVE-2017-11715"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2017-07-28T05:29:00Z",
"severity": "CRITICAL"
},
"details": "job/uploadfile_save.php in MetInfo through 5.3.17 blocks the .php extension but not related extensions, which might allow remote authenticated admins to execute arbitrary PHP code by uploading a .phtml file after certain actions involving admin/system/safe.php and job/cv.php.",
"id": "GHSA-rx39-82vr-xg3p",
"modified": "2022-05-17T02:15:35Z",
"published": "2022-05-17T02:15:35Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2017-11715"
},
{
"type": "WEB",
"url": "https://lncken.cn/?p=316"
}
],
"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-RX4H-526Q-4458
Vulnerability from github – Published: 2026-03-31 23:28 – Updated: 2026-04-06 16:40Summary
An attacker who can place a malicious URL in an Attribute View mAsse field can trigger stored XSS when a victim opens the Gallery or Kanban view with “Cover From -> Asset Field” enabled. The vulnerable code accepts arbitrary http(s) URLs without extensions as images, stores the attacker-controlled string in coverURL, and injects it directly into an <img src="..."> attribute without escaping. In the Electron desktop client, the injected JavaScript executes with nodeIntegration enabled and contextIsolation disabled, so the XSS reaches arbitrary OS command execution under the victim’s account.
Details
The vulnerable flow is:
IsPossiblyImage(assetPath)accepts arbitraryhttp(s)URLs without validating that they are safe image URLs.- When an Attribute View card uses
Cover From -> Asset Field, the application copiesasset.Contentdirectly intogalleryCard.CoverURL / kanbanCard.CoverURL. - The front-end renderer inserts
coverURLdirectly into<img src="${getCompressURL(item.coverURL)}">without escaping quotes or other attribute-breaking characters. - A payload such as
https://example.com/" onerror="require('child_process').exec('calc')breaks out of thesrcattribute and adds an attacker-controlledonerrorhandler. When the image fails to load, the injected JavaScript runs in the Electron renderer. Because the desktop app enablesnodeIntegration: trueand disablescontextIsolationandwebSecurity, that JavaScript can access Node.js APIs and execute system commands.
PoC
- Install Electron Desktop app.
- Create a database / Attribute View with an mAsset column and add at least one row.
- Add any legitimate image to that mAsset field so the entry is stored as type image.
- Switch the view to Gallery or Kanban. 5.Set Cover From to Asset Field and choose the mAsset column.
- Edit the existing image asset entry and replace its link with the following payload:
https://example.com/" onerror="require('child_process').exec('calc')
- Save the change and reopen or refresh the Gallery / Kanban view.
- Observe that the rendered HTML contains an injected onerror handler and the Calculator application starts on Windows.
Example rendered output:
<img loading="lazy" class="av__gallery-img" src="https://example.com/" onerror="require('child_process').exec('calc')">
Impact
An attacker can store malicious content in a database asset field and execute arbitrary JavaScript when another user opens the affected Gallery or Kanban view. In the desktop client, that JavaScript has access to Node.js APIs, so the impact is not limited to browser-context XSS. The payload executes OS commands with the victim’s local user privileges, which turns this into remote code execution on the desktop application once the malicious content is delivered and rendered.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 3.6.1"
},
"package": {
"ecosystem": "Go",
"name": "github.com/siyuan-note/siyuan/kernel"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "3.6.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-34448"
],
"database_specific": {
"cwe_ids": [
"CWE-79",
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2026-03-31T23:28:23Z",
"nvd_published_at": "2026-03-31T22:16:19Z",
"severity": "CRITICAL"
},
"details": "### Summary\nAn attacker who can place a malicious URL in an Attribute View `mAsse` field can trigger stored XSS when a victim opens the Gallery or Kanban view with \u201cCover From -\u003e Asset Field\u201d enabled. The vulnerable code accepts arbitrary `http(s)` URLs without extensions as images, stores the attacker-controlled string in `coverURL`, and injects it directly into an `\u003cimg src=\"...\"\u003e` attribute without escaping. In the Electron desktop client, the injected JavaScript executes with `nodeIntegration` enabled and `contextIsolation` disabled, so the XSS reaches arbitrary OS command execution under the victim\u2019s account.\n\n### Details\nThe vulnerable flow is:\n\n1. `IsPossiblyImage(assetPath)` accepts arbitrary `http(s)` URLs without validating that they are safe image URLs.\n2. When an Attribute View card uses `Cover From -\u003e Asset Field`, the application copies `asset.Content` directly into `galleryCard.CoverURL / kanbanCard.CoverURL`.\n3. The front-end renderer inserts `coverURL` directly into `\u003cimg src=\"${getCompressURL(item.coverURL)}\"\u003e` without escaping quotes or other attribute-breaking characters.\n4. A payload such as `https://example.com/\" onerror=\"require(\u0027child_process\u0027).exec(\u0027calc\u0027)` breaks out of the `src` attribute and adds an attacker-controlled `onerror` handler.\nWhen the image fails to load, the injected JavaScript runs in the Electron renderer. Because the desktop app enables `nodeIntegration: true` and disables `contextIsolation` and `webSecurity`, that JavaScript can access Node.js APIs and execute system commands.\n\n### PoC\n1. Install Electron Desktop app.\n2. Create a database / Attribute View with an mAsset column and add at least one row.\n3. Add any legitimate image to that mAsset field so the entry is stored as type image.\n4. Switch the view to Gallery or Kanban.\n5.Set Cover From to Asset Field and choose the mAsset column.\n6. Edit the existing image asset entry and replace its link with the following payload:\n```\nhttps://example.com/\" onerror=\"require(\u0027child_process\u0027).exec(\u0027calc\u0027)\n```\n7. Save the change and reopen or refresh the Gallery / Kanban view.\n8. Observe that the rendered HTML contains an injected onerror handler and the Calculator application starts on Windows.\n\nExample rendered output:\n```html\n\u003cimg loading=\"lazy\" class=\"av__gallery-img\" src=\"https://example.com/\" onerror=\"require(\u0027child_process\u0027).exec(\u0027calc\u0027)\"\u003e\n```\n### Impact\nAn attacker can store malicious content in a database asset field and execute arbitrary JavaScript when another user opens the affected Gallery or Kanban view. In the desktop client, that JavaScript has access to Node.js APIs, so the impact is not limited to browser-context XSS. The payload executes OS commands with the victim\u2019s local user privileges, which turns this into remote code execution on the desktop application once the malicious content is delivered and rendered.",
"id": "GHSA-rx4h-526q-4458",
"modified": "2026-04-06T16:40:00Z",
"published": "2026-03-31T23:28:23Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/siyuan-note/siyuan/security/advisories/GHSA-rx4h-526q-4458"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-34448"
},
{
"type": "WEB",
"url": "https://github.com/siyuan-note/siyuan/issues/17246"
},
{
"type": "PACKAGE",
"url": "https://github.com/siyuan-note/siyuan"
},
{
"type": "WEB",
"url": "https://github.com/siyuan-note/siyuan/releases/tag/v3.6.2"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "SiYuan: Stored XSS in Attribute View Gallery/Kanban Cover Rendering Allows Arbitrary Command Execution in Desktop Client"
}
GHSA-RX4W-347Q-2M87
Vulnerability from github – Published: 2022-07-13 00:00 – Updated: 2022-07-13 00:00Windows Network File System Remote Code Execution Vulnerability. This CVE ID is unique from CVE-2022-22029.
{
"affected": [],
"aliases": [
"CVE-2022-22039"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-07-12T23:15:00Z",
"severity": "HIGH"
},
"details": "Windows Network File System Remote Code Execution Vulnerability. This CVE ID is unique from CVE-2022-22029.",
"id": "GHSA-rx4w-347q-2m87",
"modified": "2022-07-13T00:00:39Z",
"published": "2022-07-13T00:00:39Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-22039"
},
{
"type": "WEB",
"url": "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2022-22039"
},
{
"type": "WEB",
"url": "https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2022-22039"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-RXG9-73C5-FC9F
Vulnerability from github – Published: 2022-05-13 01:32 – Updated: 2022-05-13 01:32SAP MaxDB ODBC driver (all versions before 7.9.09.07) allows an attacker to inject code that can be executed by the application. An attacker could thereby control the behavior of the application.
{
"affected": [],
"aliases": [
"CVE-2018-2418"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2018-05-09T20:29:00Z",
"severity": "CRITICAL"
},
"details": "SAP MaxDB ODBC driver (all versions before 7.9.09.07) allows an attacker to inject code that can be executed by the application. An attacker could thereby control the behavior of the application.",
"id": "GHSA-rxg9-73c5-fc9f",
"modified": "2022-05-13T01:32:22Z",
"published": "2022-05-13T01:32:22Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-2418"
},
{
"type": "WEB",
"url": "https://blogs.sap.com/2018/05/08/sap-security-patch-day-may-2018"
},
{
"type": "WEB",
"url": "https://launchpad.support.sap.com/#/notes/2610231"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/104115"
}
],
"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-RXGF-4WQV-5R9G
Vulnerability from github – Published: 2026-03-11 18:30 – Updated: 2026-03-12 15:30An issue was discovered in Lantronix EDS5000 2.1.0.0R3. The SSH Client and SSH Server pages are affected by multiple OS injection vulnerabilities due to missing sanitization of input parameters. An attacker can inject arbitrary commands in delete actions of various objects, such as server keys, users, and known hosts. Commands are executed with root privileges.
{
"affected": [],
"aliases": [
"CVE-2025-67035"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-03-11T17:16:51Z",
"severity": "CRITICAL"
},
"details": "An issue was discovered in Lantronix EDS5000 2.1.0.0R3. The SSH Client and SSH Server pages are affected by multiple OS injection vulnerabilities due to missing sanitization of input parameters. An attacker can inject arbitrary commands in delete actions of various objects, such as server keys, users, and known hosts. Commands are executed with root privileges.",
"id": "GHSA-rxgf-4wqv-5r9g",
"modified": "2026-03-12T15:30:23Z",
"published": "2026-03-11T18:30:32Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-67035"
},
{
"type": "WEB",
"url": "https://www.cisa.gov/news-events/ics-advisories/icsa-26-069-02"
},
{
"type": "WEB",
"url": "http://eds5000.com"
},
{
"type": "WEB",
"url": "http://lantronix.com"
}
],
"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-RXGG-273W-RFW7
Vulnerability from github – Published: 2024-01-15 12:30 – Updated: 2025-06-20 22:17Remote Code Execution vulnerability in Apache IoTDB. This issue affects Apache IoTDB from 1.0.0 through 1.2.2.
Users are recommended to upgrade to version 1.3.0, which fixes the issue.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 1.2.2"
},
"package": {
"ecosystem": "Maven",
"name": "org.apache.iotdb:iotdb-core"
},
"ranges": [
{
"events": [
{
"introduced": "1.0.0"
},
{
"fixed": "1.3.0"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "PyPI",
"name": "apache-iotdb"
},
"ranges": [
{
"events": [
{
"introduced": "1.0.0"
},
{
"fixed": "1.3.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2023-46226"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2024-01-16T20:45:55Z",
"nvd_published_at": "2024-01-15T11:15:07Z",
"severity": "HIGH"
},
"details": "Remote Code Execution vulnerability in Apache IoTDB. This issue affects Apache IoTDB from 1.0.0 through 1.2.2.\n\nUsers are recommended to upgrade to version 1.3.0, which fixes the issue.",
"id": "GHSA-rxgg-273w-rfw7",
"modified": "2025-06-20T22:17:11Z",
"published": "2024-01-15T12:30:19Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-46226"
},
{
"type": "PACKAGE",
"url": "https://github.com/apache/iotdb"
},
{
"type": "WEB",
"url": "https://github.com/pypa/advisory-database/tree/main/vulns/apache-iotdb/PYSEC-2024-11.yaml"
},
{
"type": "WEB",
"url": "https://lists.apache.org/thread/293b4ob65ftnfwyf62fb9zh8gwdy38hg"
},
{
"type": "WEB",
"url": "http://www.openwall.com/lists/oss-security/2024/01/15/1"
}
],
"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"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:U",
"type": "CVSS_V4"
}
],
"summary": "Remote Code Execution vulnerability in Apache IoTDB via UDF"
}
GHSA-RXMX-CGF3-GFPH
Vulnerability from github – Published: 2024-09-23 18:30 – Updated: 2024-09-25 03:30An issue in Doccano Open source annotation tools for machine learning practitioners v.1.8.4 and Doccano Auto Labeling Pipeline module to annotate a document automatically v.0.1.23 allows a remote attacker to escalate privileges via a crafted REST Request.
{
"affected": [],
"aliases": [
"CVE-2024-40442"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-09-23T17:15:13Z",
"severity": "HIGH"
},
"details": "An issue in Doccano Open source annotation tools for machine learning practitioners v.1.8.4 and Doccano Auto Labeling Pipeline module to annotate a document automatically v.0.1.23 allows a remote attacker to escalate privileges via a crafted REST Request.",
"id": "GHSA-rxmx-cgf3-gfph",
"modified": "2024-09-25T03:30:35Z",
"published": "2024-09-23T18:30:34Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-40442"
},
{
"type": "WEB",
"url": "https://github.com/doccano/auto-labeling-pipeline/releases/tag/v0.1.23"
},
{
"type": "WEB",
"url": "https://github.com/doccano/doccano/releases/tag/v1.8.4"
},
{
"type": "WEB",
"url": "https://github.com/gian2dchris/CVEs/tree/main/CVE-2024-40442"
}
],
"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"
}
]
}
GHSA-RXPF-V99C-5PJ8
Vulnerability from github – Published: 2022-05-24 16:58 – Updated: 2024-04-04 02:13Code Injection vulnerability in EPSetup.exe in McAfee Endpoint Security (ENS) Prior to 10.6.1 October 2019 Update allows local user to get their malicious code installed by the ENS installer via code injection into EPSetup.exe by an attacker with access to the installer.
{
"affected": [],
"aliases": [
"CVE-2019-3652"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2019-10-09T16:15:00Z",
"severity": "MODERATE"
},
"details": "Code Injection vulnerability in EPSetup.exe in McAfee Endpoint Security (ENS) Prior to 10.6.1 October 2019 Update allows local user to get their malicious code installed by the ENS installer via code injection into EPSetup.exe by an attacker with access to the installer.",
"id": "GHSA-rxpf-v99c-5pj8",
"modified": "2024-04-04T02:13:45Z",
"published": "2022-05-24T16:58:20Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2019-3652"
},
{
"type": "WEB",
"url": "https://kc.mcafee.com/corporate/index?page=content\u0026id=SB10299"
}
],
"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"
}
]
}
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.