Common Weakness Enumeration

CWE-22

Allowed-with-Review

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Abstraction: Base · Status: Stable

The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.

13323 vulnerabilities reference this CWE, most recent first.

GHSA-J3XQ-FV5R-JFGV

Vulnerability from github – Published: 2022-05-14 01:45 – Updated: 2022-05-14 01:45
VLAI
Details

app/plug/attachment/controller/admincontroller.php in SDCMS 1.6 allows reading arbitrary files via a /?m=plug&c=admin&a=index&p=attachment&root= directory traversal. The value of the root parameter must be base64 encoded (note that base64 encoding, instead of URL encoding, is very rare in a directory traversal attack vector).

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2018-19748"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2018-11-29T21:29:00Z",
    "severity": "HIGH"
  },
  "details": "app/plug/attachment/controller/admincontroller.php in SDCMS 1.6 allows reading arbitrary files via a /?m=plug\u0026c=admin\u0026a=index\u0026p=attachment\u0026root= directory traversal. The value of the root parameter must be base64 encoded (note that base64 encoding, instead of URL encoding, is very rare in a directory traversal attack vector).",
  "id": "GHSA-j3xq-fv5r-jfgv",
  "modified": "2022-05-14T01:45:55Z",
  "published": "2022-05-14T01:45:55Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2018-19748"
    },
    {
      "type": "WEB",
      "url": "https://blog.whiterabbitxyj.com/cve/SDCMS_1.6_directory_traversal.doc"
    },
    {
      "type": "WEB",
      "url": "https://github.com/WhiteRabbitc/WhiteRabbitc.github.io/blob/master/cve/SDCMS_1.6_directory_traversal.doc"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-J422-QMXP-HV94

Vulnerability from github – Published: 2025-12-02 00:38 – Updated: 2025-12-02 00:38
VLAI
Summary
Grav vulnerable to Path Traversal allowing server files backup
Details

Summary

A path traversal vulnerability has been identified in Grav CMS, versions 1.7.49.5 , allowing authenticated attackers
 with administrative privileges to read arbitrary files on the underlying server filesystem. This vulnerability arises due
 to insufficient input sanitization in the backup tool, where user-supplied paths are not properly restricted, enabling
 access to files outside the intended webroot directory. The impact of this vulnerability depends on the privileges of 
the user account running the application.

PoC

To accurately demonstrate the maximum potential impact of this vulnerability, the testing environment was configured in a specific way:

- Elevated Privileges: The application was run locally with the highest possible system privileges, operating under the **`root`** user account.

- Objective: This configuration was chosen to unequivocally show that the path traversal vulnerability is not just a theoretical issue but can lead to a complete compromise of the underlying host when combined with poor operational practices. The ability to read any file on the system is the ultimate test of the flaw's severity.


Proof of Concept Goal: Under these conditions, the subsequent PoC will exploit the vulnerability to read the SSH private key
 of the `root` user (`/root/.ssh/id_rsa`). The successful exfiltration of this key represents a worst-case scenario, as it would provide 
an attacker with persistent, undetectable, and complete administrative access to the host server. This highlights the critical intersection
 of an application-layer vulnerability and a infrastructure-level misconfiguration.

1- LOGIN AS ADMIN AND  GO TO  : http://127.0.0.1/admin/tools/backups
2- Change 'Root Folder' to backup directory /../../../../../../../root/.ssh/ 

Screenshot 2025-09-11 161519

3- CLICK  : 'SAVE'
4- CLICK  : 'Backup Now'

Screenshot 2025-09-11 154151

5- Extract Backup :

Screenshot 2025-09-11 160114 Screenshot 2025-09-11 160135

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Packagist",
        "name": "getgrav/grav"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "1.8.0-beta.27"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2025-66302"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2025-12-02T00:38:41Z",
    "nvd_published_at": "2025-12-01T22:15:49Z",
    "severity": "MODERATE"
  },
  "details": "### Summary\n```\nA path traversal vulnerability has been identified in Grav CMS, versions 1.7.49.5 , allowing authenticated attackers\n with administrative privileges to read arbitrary files on the underlying server filesystem. This vulnerability arises due\n to insufficient input sanitization in the backup tool, where user-supplied paths are not properly restricted, enabling\n access to files outside the intended webroot directory. The impact of this vulnerability depends on the privileges of \nthe user account running the application.\n```\n\n### PoC\n```\nTo accurately demonstrate the maximum potential impact of this vulnerability, the testing environment was configured in a specific way:\n\n- Elevated Privileges: The application was run locally with the highest possible system privileges, operating under the **`root`** user account.\n    \n- Objective: This configuration was chosen to unequivocally show that the path traversal vulnerability is not just a theoretical issue but can lead to a complete compromise of the underlying host when combined with poor operational practices. The ability to read any file on the system is the ultimate test of the flaw\u0027s severity.\n    \n\nProof of Concept Goal: Under these conditions, the subsequent PoC will exploit the vulnerability to read the SSH private key\n of the `root` user (`/root/.ssh/id_rsa`). The successful exfiltration of this key represents a worst-case scenario, as it would provide \nan attacker with persistent, undetectable, and complete administrative access to the host server. This highlights the critical intersection\n of an application-layer vulnerability and a infrastructure-level misconfiguration.\n\n```\n\n\n\n\n```\n1- LOGIN AS ADMIN AND  GO TO  : http://127.0.0.1/admin/tools/backups\n2- Change \u0027Root Folder\u0027 to backup directory /../../../../../../../root/.ssh/ \n\n```\n\u003cimg width=\"1902\" height=\"492\" alt=\"Screenshot 2025-09-11 161519\" src=\"https://github.com/user-attachments/assets/23a60dc3-7758-4e24-b910-e66a1dd1f5e2\" /\u003e\n\n\n\n```\n3- CLICK  : \u0027SAVE\u0027\n4- CLICK  : \u0027Backup Now\u0027\n```\n\n\u003cimg width=\"1916\" height=\"512\" alt=\"Screenshot 2025-09-11 154151\" src=\"https://github.com/user-attachments/assets/88a63ff2-777e-467e-857b-0644ef698499\" /\u003e\n\n```\n5- Extract Backup :\n```\n\n\n\u003cimg width=\"704\" height=\"101\" alt=\"Screenshot 2025-09-11 160114\" src=\"https://github.com/user-attachments/assets/b91ce4db-9843-4280-b8f0-32c73aa12d4d\" /\u003e\n\u003cimg width=\"567\" height=\"101\" alt=\"Screenshot 2025-09-11 160135\" src=\"https://github.com/user-attachments/assets/155ce7d8-c2fc-4b54-b054-f7c7550bec82\" /\u003e",
  "id": "GHSA-j422-qmxp-hv94",
  "modified": "2025-12-02T00:38:41Z",
  "published": "2025-12-02T00:38:41Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/getgrav/grav/security/advisories/GHSA-j422-qmxp-hv94"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-66302"
    },
    {
      "type": "WEB",
      "url": "https://github.com/getgrav/grav/commit/ed640a13143c4177af013cf001969ed2c5e197ee"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/getgrav/grav"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Grav vulnerable to Path Traversal allowing server files backup"
}

GHSA-J42Q-G27M-825X

Vulnerability from github – Published: 2026-02-05 15:31 – Updated: 2026-02-05 15:31
VLAI
Details

Path Traversal vulnerability in Digitek ADT1100 and Digitek DT950 from PRIMION DIGITEK, S.L.U (Azkoyen Group). This vulnerability allows an attacker to access arbitrary files in the server's file system, thet is, 'http:///..%2F..% 2F..%2F..%2F..%2F..%2F..%2F..%2F..%2Fetc%2Fpasswd'. By manipulating the input to include URL encoded directory traversal sequences (e.g., %2F representing /), an attacker can bypass the input validation mechanisms ans retrieve sensitive files outside the intended directory, which could lead to information disclosure or further system compromise.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2026-1523"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-02-05T14:16:04Z",
    "severity": "HIGH"
  },
  "details": "Path Traversal vulnerability in Digitek ADT1100 and Digitek DT950 from PRIMION DIGITEK, S.L.U (Azkoyen Group). This vulnerability allows an attacker to access arbitrary files in the server\u0027s file system, thet is, \u0027http://\u003chost\u003e/..%2F..% 2F..%2F..%2F..%2F..%2F..%2F..%2F..%2Fetc%2Fpasswd\u0027. By manipulating the input to include URL encoded directory traversal sequences (e.g., %2F representing /), an attacker can bypass the input validation mechanisms ans retrieve sensitive files outside the intended directory, which could lead to information disclosure or further system compromise.",
  "id": "GHSA-j42q-g27m-825x",
  "modified": "2026-02-05T15:31:14Z",
  "published": "2026-02-05T15:31:14Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-1523"
    },
    {
      "type": "WEB",
      "url": "https://www.incibe.es/en/incibe-cert/notices/aviso/path-traversal-digitek-grupo-azkoyen"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
      "type": "CVSS_V4"
    }
  ]
}

GHSA-J44M-5V8F-GC9C

Vulnerability from github – Published: 2025-10-10 22:55 – Updated: 2025-11-07 16:46
VLAI
Summary
Flowise is vulnerable to arbitrary file exposure through its ReadFileTool
Details

Summary

The ReadFileTool in Flowise does not restrict file path access, allowing authenticated attackers to exploit this vulnerability to read arbitrary files from the file system, potentially leading to remote command execution.

Details

Flowise supports providing ReadFileTool for large models to read files in the server's file system. The implementation of this tool is located at packages/components/nodes/tools/ReadFile/ReadFile.ts.

/**
 * Class for reading files from the disk. Extends the StructuredTool
 * class.
 */
export class ReadFileTool extends StructuredTool {
    static lc_name() {
        return 'ReadFileTool'
    }

    schema = z.object({
        file_path: z.string().describe('name of file')
    }) as any

    name = 'read_file'

    description = 'Read file from disk'

    store: BaseFileStore

    constructor({ store }: ReadFileParams) {
        super(...arguments)

        this.store = store
    }

    async _call({ file_path }: z.infer<typeof this.schema>) {
        return await this.store.readFile(file_path)
    }
}

The tool directly uses the file_path parameter passed to it without verifying whether the path belongs to Flowise's working directory. Authenticated attackers can exploit this vulnerability to read any known file on the server. For example, if the victim deploys in a Docker environment, the attacker could attempt to read sensitive files such as /root/.flowise/encryption.key, /root/.flowise/database.sqlite, and obtain sensitive information. If the victim does not use a Docker environment for deployment, the attacker could try reading sensitive files like /etc/passwd, /etc/shadow, /root/.ssh/id_rsa, further achieving the effect of remote command execution.

PoC

This file reading vulnerability has been verified to exist in the latest Flowise Docker image (https://hub.docker.com/layers/flowiseai/flowise/latest/images/sha256-26300377397818a451e0710389eb77615256b0f3ecc895194850ab35dda3ae7b). The reproduction steps are as follows:

  1. Pull the Flowise Docker image
docker pull flowiseai/flowise
  1. Start the Flowise service
docker run -d --name flowise -p 3000:3000 flowise
  1. Access the Flowise service at server ip:3000 in the browser and register an account
  2. Save the following content as agent.json
{
  "nodes": [
    {
      "id": "startAgentflow_0",
      "type": "agentFlow",
      "position": {
        "x": -203,
        "y": 37
      },
      "data": {
        "id": "startAgentflow_0",
        "label": "Start",
        "version": 1.1,
        "name": "startAgentflow",
        "type": "Start",
        "color": "#7EE787",
        "hideInput": true,
        "baseClasses": [
          "Start"
        ],
        "category": "Agent Flows",
        "description": "Starting point of the agentflow",
        "inputParams": [
          {
            "label": "Input Type",
            "name": "startInputType",
            "type": "options",
            "options": [
              {
                "label": "Chat Input",
                "name": "chatInput",
                "description": "Start the conversation with chat input"
              },
              {
                "label": "Form Input",
                "name": "formInput",
                "description": "Start the workflow with form inputs"
              }
            ],
            "default": "chatInput",
            "id": "startAgentflow_0-input-startInputType-options",
            "display": true
          },
          {
            "label": "Form Title",
            "name": "formTitle",
            "type": "string",
            "placeholder": "Please Fill Out The Form",
            "show": {
              "startInputType": "formInput"
            },
            "id": "startAgentflow_0-input-formTitle-string",
            "display": false
          },
          {
            "label": "Form Description",
            "name": "formDescription",
            "type": "string",
            "placeholder": "Complete all fields below to continue",
            "show": {
              "startInputType": "formInput"
            },
            "id": "startAgentflow_0-input-formDescription-string",
            "display": false
          },
          {
            "label": "Form Input Types",
            "name": "formInputTypes",
            "description": "Specify the type of form input",
            "type": "array",
            "show": {
              "startInputType": "formInput"
            },
            "array": [
              {
                "label": "Type",
                "name": "type",
                "type": "options",
                "options": [
                  {
                    "label": "String",
                    "name": "string"
                  },
                  {
                    "label": "Number",
                    "name": "number"
                  },
                  {
                    "label": "Boolean",
                    "name": "boolean"
                  },
                  {
                    "label": "Options",
                    "name": "options"
                  }
                ],
                "default": "string"
              },
              {
                "label": "Label",
                "name": "label",
                "type": "string",
                "placeholder": "Label for the input"
              },
              {
                "label": "Variable Name",
                "name": "name",
                "type": "string",
                "placeholder": "Variable name for the input (must be camel case)",
                "description": "Variable name must be camel case. For example: firstName, lastName, etc."
              },
              {
                "label": "Add Options",
                "name": "addOptions",
                "type": "array",
                "show": {
                  "formInputTypes[$index].type": "options"
                },
                "array": [
                  {
                    "label": "Option",
                    "name": "option",
                    "type": "string"
                  }
                ]
              }
            ],
            "id": "startAgentflow_0-input-formInputTypes-array",
            "display": false
          },
          {
            "label": "Ephemeral Memory",
            "name": "startEphemeralMemory",
            "type": "boolean",
            "description": "Start fresh for every execution without past chat history",
            "optional": true,
            "id": "startAgentflow_0-input-startEphemeralMemory-boolean",
            "display": true
          },
          {
            "label": "Flow State",
            "name": "startState",
            "description": "Runtime state during the execution of the workflow",
            "type": "array",
            "optional": true,
            "array": [
              {
                "label": "Key",
                "name": "key",
                "type": "string",
                "placeholder": "Foo"
              },
              {
                "label": "Value",
                "name": "value",
                "type": "string",
                "placeholder": "Bar",
                "optional": true
              }
            ],
            "id": "startAgentflow_0-input-startState-array",
            "display": true
          },
          {
            "label": "Persist State",
            "name": "startPersistState",
            "type": "boolean",
            "description": "Persist the state in the same session",
            "optional": true,
            "id": "startAgentflow_0-input-startPersistState-boolean",
            "display": true
          }
        ],
        "inputAnchors": [],
        "inputs": {
          "startInputType": "chatInput",
          "formTitle": "",
          "formDescription": "",
          "formInputTypes": "",
          "startEphemeralMemory": "",
          "startState": "",
          "startPersistState": ""
        },
        "outputAnchors": [
          {
            "id": "startAgentflow_0-output-startAgentflow",
            "label": "Start",
            "name": "startAgentflow"
          }
        ],
        "outputs": {},
        "selected": false
      },
      "width": 103,
      "height": 66,
      "selected": false,
      "positionAbsolute": {
        "x": -203,
        "y": 37
      },
      "dragging": false
    },
    {
      "id": "directReplyAgentflow_0",
      "position": {
        "x": 209,
        "y": 30.25
      },
      "data": {
        "id": "directReplyAgentflow_0",
        "label": "Direct Reply 0",
        "version": 1,
        "name": "directReplyAgentflow",
        "type": "DirectReply",
        "color": "#4DDBBB",
        "hideOutput": true,
        "baseClasses": [
          "DirectReply"
        ],
        "category": "Agent Flows",
        "description": "Directly reply to the user with a message",
        "inputParams": [
          {
            "label": "Message",
            "name": "directReplyMessage",
            "type": "string",
            "rows": 4,
            "acceptVariable": true,
            "id": "directReplyAgentflow_0-input-directReplyMessage-string",
            "display": true
          }
        ],
        "inputAnchors": [],
        "inputs": {
          "directReplyMessage": "",
          "undefined": ""
        },
        "outputAnchors": [],
        "outputs": {},
        "selected": false
      },
      "type": "agentFlow",
      "width": 163,
      "height": 66,
      "selected": false,
      "positionAbsolute": {
        "x": 209,
        "y": 30.25
      },
      "dragging": false
    },
    {
      "id": "agentAgentflow_0",
      "position": {
        "x": -63.5,
        "y": 89.125
      },
      "data": {
        "id": "agentAgentflow_0",
        "label": "Agent 0",
        "version": 2,
        "name": "agentAgentflow",
        "type": "Agent",
        "color": "#4DD0E1",
        "baseClasses": [
          "Agent"
        ],
        "category": "Agent Flows",
        "description": "Dynamically choose and utilize tools during runtime, enabling multi-step reasoning",
        "inputParams": [
          {
            "label": "Model",
            "name": "agentModel",
            "type": "asyncOptions",
            "loadMethod": "listModels",
            "loadConfig": true,
            "id": "agentAgentflow_0-input-agentModel-asyncOptions",
            "display": true
          },
          {
            "label": "Messages",
            "name": "agentMessages",
            "type": "array",
            "optional": true,
            "acceptVariable": true,
            "array": [
              {
                "label": "Role",
                "name": "role",
                "type": "options",
                "options": [
                  {
                    "label": "System",
                    "name": "system"
                  },
                  {
                    "label": "Assistant",
                    "name": "assistant"
                  },
                  {
                    "label": "Developer",
                    "name": "developer"
                  },
                  {
                    "label": "User",
                    "name": "user"
                  }
                ]
              },
              {
                "label": "Content",
                "name": "content",
                "type": "string",
                "acceptVariable": true,
                "generateInstruction": true,
                "rows": 4
              }
            ],
            "id": "agentAgentflow_0-input-agentMessages-array",
            "display": true
          },
          {
            "label": "OpenAI Built-in Tools",
            "name": "agentToolsBuiltInOpenAI",
            "type": "multiOptions",
            "optional": true,
            "options": [
              {
                "label": "Web Search",
                "name": "web_search_preview",
                "description": "Search the web for the latest information"
              },
              {
                "label": "Code Interpreter",
                "name": "code_interpreter",
                "description": "Write and run Python code in a sandboxed environment"
              },
              {
                "label": "Image Generation",
                "name": "image_generation",
                "description": "Generate images based on a text prompt"
              }
            ],
            "show": {
              "agentModel": "chatOpenAI"
            },
            "id": "agentAgentflow_0-input-agentToolsBuiltInOpenAI-multiOptions",
            "display": false
          },
          {
            "label": "Tools",
            "name": "agentTools",
            "type": "array",
            "optional": true,
            "array": [
              {
                "label": "Tool",
                "name": "agentSelectedTool",
                "type": "asyncOptions",
                "loadMethod": "listTools",
                "loadConfig": true
              },
              {
                "label": "Require Human Input",
                "name": "agentSelectedToolRequiresHumanInput",
                "type": "boolean",
                "optional": true
              }
            ],
            "id": "agentAgentflow_0-input-agentTools-array",
            "display": true
          },
          {
            "label": "Knowledge (Document Stores)",
            "name": "agentKnowledgeDocumentStores",
            "type": "array",
            "description": "Give your agent context about different document sources. Document stores must be upserted in advance.",
            "array": [
              {
                "label": "Document Store",
                "name": "documentStore",
                "type": "asyncOptions",
                "loadMethod": "listStores"
              },
              {
                "label": "Describe Knowledge",
                "name": "docStoreDescription",
                "type": "string",
                "generateDocStoreDescription": true,
                "placeholder": "Describe what the knowledge base is about, this is useful for the AI to know when and how to search for correct information",
                "rows": 4
              },
              {
                "label": "Return Source Documents",
                "name": "returnSourceDocuments",
                "type": "boolean",
                "optional": true
              }
            ],
            "optional": true,
            "id": "agentAgentflow_0-input-agentKnowledgeDocumentStores-array",
            "display": true
          },
          {
            "label": "Knowledge (Vector Embeddings)",
            "name": "agentKnowledgeVSEmbeddings",
            "type": "array",
            "description": "Give your agent context about different document sources from existing vector stores and embeddings",
            "array": [
              {
                "label": "Vector Store",
                "name": "vectorStore",
                "type": "asyncOptions",
                "loadMethod": "listVectorStores",
                "loadConfig": true
              },
              {
                "label": "Embedding Model",
                "name": "embeddingModel",
                "type": "asyncOptions",
                "loadMethod": "listEmbeddings",
                "loadConfig": true
              },
              {
                "label": "Knowledge Name",
                "name": "knowledgeName",
                "type": "string",
                "placeholder": "A short name for the knowledge base, this is useful for the AI to know when and how to search for correct information"
              },
              {
                "label": "Describe Knowledge",
                "name": "knowledgeDescription",
                "type": "string",
                "placeholder": "Describe what the knowledge base is about, this is useful for the AI to know when and how to search for correct information",
                "rows": 4
              },
              {
                "label": "Return Source Documents",
                "name": "returnSourceDocuments",
                "type": "boolean",
                "optional": true
              }
            ],
            "optional": true,
            "id": "agentAgentflow_0-input-agentKnowledgeVSEmbeddings-array",
            "display": true
          },
          {
            "label": "Enable Memory",
            "name": "agentEnableMemory",
            "type": "boolean",
            "description": "Enable memory for the conversation thread",
            "default": true,
            "optional": true,
            "id": "agentAgentflow_0-input-agentEnableMemory-boolean",
            "display": true
          },
          {
            "label": "Memory Type",
            "name": "agentMemoryType",
            "type": "options",
            "options": [
              {
                "label": "All Messages",
                "name": "allMessages",
                "description": "Retrieve all messages from the conversation"
              },
              {
                "label": "Window Size",
                "name": "windowSize",
                "description": "Uses a fixed window size to surface the last N messages"
              },
              {
                "label": "Conversation Summary",
                "name": "conversationSummary",
                "description": "Summarizes the whole conversation"
              },
              {
                "label": "Conversation Summary Buffer",
                "name": "conversationSummaryBuffer",
                "description": "Summarize conversations once token limit is reached. Default to 2000"
              }
            ],
            "optional": true,
            "default": "allMessages",
            "show": {
              "agentEnableMemory": true
            },
            "id": "agentAgentflow_0-input-agentMemoryType-options",
            "display": false
          },
          {
            "label": "Window Size",
            "name": "agentMemoryWindowSize",
            "type": "number",
            "default": "20",
            "description": "Uses a fixed window size to surface the last N messages",
            "show": {
              "agentMemoryType": "windowSize"
            },
            "id": "agentAgentflow_0-input-agentMemoryWindowSize-number",
            "display": false
          },
          {
            "label": "Max Token Limit",
            "name": "agentMemoryMaxTokenLimit",
            "type": "number",
            "default": "2000",
            "description": "Summarize conversations once token limit is reached. Default to 2000",
            "show": {
              "agentMemoryType": "conversationSummaryBuffer"
            },
            "id": "agentAgentflow_0-input-agentMemoryMaxTokenLimit-number",
            "display": false
          },
          {
            "label": "Input Message",
            "name": "agentUserMessage",
            "type": "string",
            "description": "Add an input message as user message at the end of the conversation",
            "rows": 4,
            "optional": true,
            "acceptVariable": true,
            "show": {
              "agentEnableMemory": true
            },
            "id": "agentAgentflow_0-input-agentUserMessage-string",
            "display": false
          },
          {
            "label": "Return Response As",
            "name": "agentReturnResponseAs",
            "type": "options",
            "options": [
              {
                "label": "User Message",
                "name": "userMessage"
              },
              {
                "label": "Assistant Message",
                "name": "assistantMessage"
              }
            ],
            "default": "userMessage",
            "id": "agentAgentflow_0-input-agentReturnResponseAs-options",
            "display": true
          },
          {
            "label": "Update Flow State",
            "name": "agentUpdateState",
            "description": "Update runtime state during the execution of the workflow",
            "type": "array",
            "optional": true,
            "acceptVariable": true,
            "array": [
              {
                "label": "Key",
                "name": "key",
                "type": "asyncOptions",
                "loadMethod": "listRuntimeStateKeys",
                "freeSolo": true
              },
              {
                "label": "Value",
                "name": "value",
                "type": "string",
                "acceptVariable": true,
                "acceptNodeOutputAsVariable": true
              }
            ],
            "id": "agentAgentflow_0-input-agentUpdateState-array",
            "display": true
          }
        ],
        "inputAnchors": [],
        "inputs": {
          "agentModel": "chatOpenRouter",
          "agentMessages": [
            {
              "role": "",
              "content": "<p><span class=\"variable\" data-type=\"mention\" data-id=\"question\" data-label=\"question\">{{ question }}</span> </p>"
            }
          ],
          "agentTools": [
            {
              "agentSelectedTool": "readFile",
              "agentSelectedToolRequiresHumanInput": "",
              "agentSelectedToolConfig": {
                "basePath": "/",
                "agentSelectedTool": "readFile"
              }
            },
            {
              "agentSelectedTool": "writeFile",
              "agentSelectedToolRequiresHumanInput": "",
              "agentSelectedToolConfig": {
                "basePath": "/",
                "agentSelectedTool": "writeFile"
              }
            }
          ],
          "agentKnowledgeDocumentStores": "",
          "agentKnowledgeVSEmbeddings": "",
          "agentEnableMemory": false,
          "agentReturnResponseAs": "userMessage",
          "agentUpdateState": "",
          "undefined": "",
          "agentModelConfig": {
            "cache": "",
            "modelName": "qwen/qwen3-30b-a3b",
            "temperature": 0.9,
            "streaming": true,
            "maxTokens": "",
            "topP": "",
            "frequencyPenalty": "",
            "presencePenalty": "",
            "timeout": "",
            "basepath": "https://openrouter.ai/api/v1",
            "baseOptions": "",
            "agentModel": "chatOpenRouter"
          }
        },
        "outputAnchors": [
          {
            "id": "agentAgentflow_0-output-agentAgentflow",
            "label": "Agent",
            "name": "agentAgentflow"
          }
        ],
        "outputs": {},
        "selected": false
      },
      "type": "agentFlow",
      "width": 232,
      "height": 100,
      "selected": false,
      "positionAbsolute": {
        "x": -63.5,
        "y": 89.125
      },
      "dragging": false
    }
  ],
  "edges": [
    {
      "source": "startAgentflow_0",
      "sourceHandle": "startAgentflow_0-output-startAgentflow",
      "target": "agentAgentflow_0",
      "targetHandle": "agentAgentflow_0",
      "data": {
        "sourceColor": "#7EE787",
        "targetColor": "#4DD0E1",
        "isHumanInput": false
      },
      "type": "agentFlow",
      "id": "startAgentflow_0-startAgentflow_0-output-startAgentflow-agentAgentflow_0-agentAgentflow_0"
    },
    {
      "source": "agentAgentflow_0",
      "sourceHandle": "agentAgentflow_0-output-agentAgentflow",
      "target": "directReplyAgentflow_0",
      "targetHandle": "directReplyAgentflow_0",
      "data": {
        "sourceColor": "#4DD0E1",
        "targetColor": "#4DDBBB",
        "isHumanInput": false
      },
      "type": "agentFlow",
      "id": "agentAgentflow_0-agentAgentflow_0-output-agentAgentflow-directReplyAgentflow_0-directReplyAgentflow_0"
    }
  ]
}
  1. Click on "AgentFlows" on the left, then click "Add New" on the right to enter the Agent creation page. Click the gear button in the upper right corner, select "Load Agents," choose the agent.json file, and after successful import, view three connected nodes.
  2. Double-click the middle "Agent 0" node, click "ChatOpenRouter Parameters," then "Connect Credential," and select "Create New." Enter a valid OpenRouter API Key. Alternatively, click "Model" to choose another LLM provider. Once done, click the save button in the upper right corner.
  3. After saving, click the purple chat button in the upper right corner and enter: "Read file content of /root/.flowise/encryption.key." Once the call is complete, click the expand button next to "Agent 0" in the "Process Flow" dropdown menu. The file content will be displayed in the "Output" section below.

Impact

Authenticated attackers can exploit this vulnerability to steal sensitive information such as encryption keys, databases, and environment variables from the server, potentially leading to remote command execution.

Credit

This vulnerability was discovered by:

  • XlabAI Team of Tencent Xuanwu Lab
  • Atuin Automated Vulnerability Discovery Engine
Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "flowise"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "3.0.8"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "npm",
        "name": "flowise-components"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "3.0.8"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2025-10-10T22:55:09Z",
    "nvd_published_at": null,
    "severity": "HIGH"
  },
  "details": "### Summary\n\nThe ReadFileTool in Flowise does not restrict file path access, allowing authenticated attackers to exploit this vulnerability to read arbitrary files from the file system, potentially leading to remote command execution.\n\n### Details\n\nFlowise supports providing ReadFileTool for large models to read files in the server\u0027s file system. The implementation of this tool is located at packages/components/nodes/tools/ReadFile/ReadFile.ts.\n\n```\n/**\n * Class for reading files from the disk. Extends the StructuredTool\n * class.\n */\nexport class ReadFileTool extends StructuredTool {\n    static lc_name() {\n        return \u0027ReadFileTool\u0027\n    }\n\n    schema = z.object({\n        file_path: z.string().describe(\u0027name of file\u0027)\n    }) as any\n\n    name = \u0027read_file\u0027\n\n    description = \u0027Read file from disk\u0027\n\n    store: BaseFileStore\n\n    constructor({ store }: ReadFileParams) {\n        super(...arguments)\n\n        this.store = store\n    }\n\n    async _call({ file_path }: z.infer\u003ctypeof this.schema\u003e) {\n        return await this.store.readFile(file_path)\n    }\n}\n```\n\n\n\nThe tool directly uses the file_path parameter passed to it without verifying whether the path belongs to Flowise\u0027s working directory. Authenticated attackers can exploit this vulnerability to read any known file on the server. For example, if the victim deploys in a Docker environment, the attacker could attempt to read sensitive files such as /root/.flowise/encryption.key, /root/.flowise/database.sqlite, and obtain sensitive information. If the victim does not use a Docker environment for deployment, the attacker could try reading sensitive files like /etc/passwd, /etc/shadow, /root/.ssh/id_rsa, further achieving the effect of remote command execution.\n\n### PoC\n\nThis file reading vulnerability has been verified to exist in the latest Flowise Docker image (https://hub.docker.com/layers/flowiseai/flowise/latest/images/sha256-26300377397818a451e0710389eb77615256b0f3ecc895194850ab35dda3ae7b). The reproduction steps are as follows:\n\n1. Pull the Flowise Docker image\n\n```\ndocker pull flowiseai/flowise\n```\n\n2. Start the Flowise service\n\n```\ndocker run -d --name flowise -p 3000:3000 flowise\n```\n\n\n3. Access the Flowise service at server ip:3000 in the browser and register an account\n4. Save the following content as agent.json\n\n```\n{\n  \"nodes\": [\n    {\n      \"id\": \"startAgentflow_0\",\n      \"type\": \"agentFlow\",\n      \"position\": {\n        \"x\": -203,\n        \"y\": 37\n      },\n      \"data\": {\n        \"id\": \"startAgentflow_0\",\n        \"label\": \"Start\",\n        \"version\": 1.1,\n        \"name\": \"startAgentflow\",\n        \"type\": \"Start\",\n        \"color\": \"#7EE787\",\n        \"hideInput\": true,\n        \"baseClasses\": [\n          \"Start\"\n        ],\n        \"category\": \"Agent Flows\",\n        \"description\": \"Starting point of the agentflow\",\n        \"inputParams\": [\n          {\n            \"label\": \"Input Type\",\n            \"name\": \"startInputType\",\n            \"type\": \"options\",\n            \"options\": [\n              {\n                \"label\": \"Chat Input\",\n                \"name\": \"chatInput\",\n                \"description\": \"Start the conversation with chat input\"\n              },\n              {\n                \"label\": \"Form Input\",\n                \"name\": \"formInput\",\n                \"description\": \"Start the workflow with form inputs\"\n              }\n            ],\n            \"default\": \"chatInput\",\n            \"id\": \"startAgentflow_0-input-startInputType-options\",\n            \"display\": true\n          },\n          {\n            \"label\": \"Form Title\",\n            \"name\": \"formTitle\",\n            \"type\": \"string\",\n            \"placeholder\": \"Please Fill Out The Form\",\n            \"show\": {\n              \"startInputType\": \"formInput\"\n            },\n            \"id\": \"startAgentflow_0-input-formTitle-string\",\n            \"display\": false\n          },\n          {\n            \"label\": \"Form Description\",\n            \"name\": \"formDescription\",\n            \"type\": \"string\",\n            \"placeholder\": \"Complete all fields below to continue\",\n            \"show\": {\n              \"startInputType\": \"formInput\"\n            },\n            \"id\": \"startAgentflow_0-input-formDescription-string\",\n            \"display\": false\n          },\n          {\n            \"label\": \"Form Input Types\",\n            \"name\": \"formInputTypes\",\n            \"description\": \"Specify the type of form input\",\n            \"type\": \"array\",\n            \"show\": {\n              \"startInputType\": \"formInput\"\n            },\n            \"array\": [\n              {\n                \"label\": \"Type\",\n                \"name\": \"type\",\n                \"type\": \"options\",\n                \"options\": [\n                  {\n                    \"label\": \"String\",\n                    \"name\": \"string\"\n                  },\n                  {\n                    \"label\": \"Number\",\n                    \"name\": \"number\"\n                  },\n                  {\n                    \"label\": \"Boolean\",\n                    \"name\": \"boolean\"\n                  },\n                  {\n                    \"label\": \"Options\",\n                    \"name\": \"options\"\n                  }\n                ],\n                \"default\": \"string\"\n              },\n              {\n                \"label\": \"Label\",\n                \"name\": \"label\",\n                \"type\": \"string\",\n                \"placeholder\": \"Label for the input\"\n              },\n              {\n                \"label\": \"Variable Name\",\n                \"name\": \"name\",\n                \"type\": \"string\",\n                \"placeholder\": \"Variable name for the input (must be camel case)\",\n                \"description\": \"Variable name must be camel case. For example: firstName, lastName, etc.\"\n              },\n              {\n                \"label\": \"Add Options\",\n                \"name\": \"addOptions\",\n                \"type\": \"array\",\n                \"show\": {\n                  \"formInputTypes[$index].type\": \"options\"\n                },\n                \"array\": [\n                  {\n                    \"label\": \"Option\",\n                    \"name\": \"option\",\n                    \"type\": \"string\"\n                  }\n                ]\n              }\n            ],\n            \"id\": \"startAgentflow_0-input-formInputTypes-array\",\n            \"display\": false\n          },\n          {\n            \"label\": \"Ephemeral Memory\",\n            \"name\": \"startEphemeralMemory\",\n            \"type\": \"boolean\",\n            \"description\": \"Start fresh for every execution without past chat history\",\n            \"optional\": true,\n            \"id\": \"startAgentflow_0-input-startEphemeralMemory-boolean\",\n            \"display\": true\n          },\n          {\n            \"label\": \"Flow State\",\n            \"name\": \"startState\",\n            \"description\": \"Runtime state during the execution of the workflow\",\n            \"type\": \"array\",\n            \"optional\": true,\n            \"array\": [\n              {\n                \"label\": \"Key\",\n                \"name\": \"key\",\n                \"type\": \"string\",\n                \"placeholder\": \"Foo\"\n              },\n              {\n                \"label\": \"Value\",\n                \"name\": \"value\",\n                \"type\": \"string\",\n                \"placeholder\": \"Bar\",\n                \"optional\": true\n              }\n            ],\n            \"id\": \"startAgentflow_0-input-startState-array\",\n            \"display\": true\n          },\n          {\n            \"label\": \"Persist State\",\n            \"name\": \"startPersistState\",\n            \"type\": \"boolean\",\n            \"description\": \"Persist the state in the same session\",\n            \"optional\": true,\n            \"id\": \"startAgentflow_0-input-startPersistState-boolean\",\n            \"display\": true\n          }\n        ],\n        \"inputAnchors\": [],\n        \"inputs\": {\n          \"startInputType\": \"chatInput\",\n          \"formTitle\": \"\",\n          \"formDescription\": \"\",\n          \"formInputTypes\": \"\",\n          \"startEphemeralMemory\": \"\",\n          \"startState\": \"\",\n          \"startPersistState\": \"\"\n        },\n        \"outputAnchors\": [\n          {\n            \"id\": \"startAgentflow_0-output-startAgentflow\",\n            \"label\": \"Start\",\n            \"name\": \"startAgentflow\"\n          }\n        ],\n        \"outputs\": {},\n        \"selected\": false\n      },\n      \"width\": 103,\n      \"height\": 66,\n      \"selected\": false,\n      \"positionAbsolute\": {\n        \"x\": -203,\n        \"y\": 37\n      },\n      \"dragging\": false\n    },\n    {\n      \"id\": \"directReplyAgentflow_0\",\n      \"position\": {\n        \"x\": 209,\n        \"y\": 30.25\n      },\n      \"data\": {\n        \"id\": \"directReplyAgentflow_0\",\n        \"label\": \"Direct Reply 0\",\n        \"version\": 1,\n        \"name\": \"directReplyAgentflow\",\n        \"type\": \"DirectReply\",\n        \"color\": \"#4DDBBB\",\n        \"hideOutput\": true,\n        \"baseClasses\": [\n          \"DirectReply\"\n        ],\n        \"category\": \"Agent Flows\",\n        \"description\": \"Directly reply to the user with a message\",\n        \"inputParams\": [\n          {\n            \"label\": \"Message\",\n            \"name\": \"directReplyMessage\",\n            \"type\": \"string\",\n            \"rows\": 4,\n            \"acceptVariable\": true,\n            \"id\": \"directReplyAgentflow_0-input-directReplyMessage-string\",\n            \"display\": true\n          }\n        ],\n        \"inputAnchors\": [],\n        \"inputs\": {\n          \"directReplyMessage\": \"\",\n          \"undefined\": \"\"\n        },\n        \"outputAnchors\": [],\n        \"outputs\": {},\n        \"selected\": false\n      },\n      \"type\": \"agentFlow\",\n      \"width\": 163,\n      \"height\": 66,\n      \"selected\": false,\n      \"positionAbsolute\": {\n        \"x\": 209,\n        \"y\": 30.25\n      },\n      \"dragging\": false\n    },\n    {\n      \"id\": \"agentAgentflow_0\",\n      \"position\": {\n        \"x\": -63.5,\n        \"y\": 89.125\n      },\n      \"data\": {\n        \"id\": \"agentAgentflow_0\",\n        \"label\": \"Agent 0\",\n        \"version\": 2,\n        \"name\": \"agentAgentflow\",\n        \"type\": \"Agent\",\n        \"color\": \"#4DD0E1\",\n        \"baseClasses\": [\n          \"Agent\"\n        ],\n        \"category\": \"Agent Flows\",\n        \"description\": \"Dynamically choose and utilize tools during runtime, enabling multi-step reasoning\",\n        \"inputParams\": [\n          {\n            \"label\": \"Model\",\n            \"name\": \"agentModel\",\n            \"type\": \"asyncOptions\",\n            \"loadMethod\": \"listModels\",\n            \"loadConfig\": true,\n            \"id\": \"agentAgentflow_0-input-agentModel-asyncOptions\",\n            \"display\": true\n          },\n          {\n            \"label\": \"Messages\",\n            \"name\": \"agentMessages\",\n            \"type\": \"array\",\n            \"optional\": true,\n            \"acceptVariable\": true,\n            \"array\": [\n              {\n                \"label\": \"Role\",\n                \"name\": \"role\",\n                \"type\": \"options\",\n                \"options\": [\n                  {\n                    \"label\": \"System\",\n                    \"name\": \"system\"\n                  },\n                  {\n                    \"label\": \"Assistant\",\n                    \"name\": \"assistant\"\n                  },\n                  {\n                    \"label\": \"Developer\",\n                    \"name\": \"developer\"\n                  },\n                  {\n                    \"label\": \"User\",\n                    \"name\": \"user\"\n                  }\n                ]\n              },\n              {\n                \"label\": \"Content\",\n                \"name\": \"content\",\n                \"type\": \"string\",\n                \"acceptVariable\": true,\n                \"generateInstruction\": true,\n                \"rows\": 4\n              }\n            ],\n            \"id\": \"agentAgentflow_0-input-agentMessages-array\",\n            \"display\": true\n          },\n          {\n            \"label\": \"OpenAI Built-in Tools\",\n            \"name\": \"agentToolsBuiltInOpenAI\",\n            \"type\": \"multiOptions\",\n            \"optional\": true,\n            \"options\": [\n              {\n                \"label\": \"Web Search\",\n                \"name\": \"web_search_preview\",\n                \"description\": \"Search the web for the latest information\"\n              },\n              {\n                \"label\": \"Code Interpreter\",\n                \"name\": \"code_interpreter\",\n                \"description\": \"Write and run Python code in a sandboxed environment\"\n              },\n              {\n                \"label\": \"Image Generation\",\n                \"name\": \"image_generation\",\n                \"description\": \"Generate images based on a text prompt\"\n              }\n            ],\n            \"show\": {\n              \"agentModel\": \"chatOpenAI\"\n            },\n            \"id\": \"agentAgentflow_0-input-agentToolsBuiltInOpenAI-multiOptions\",\n            \"display\": false\n          },\n          {\n            \"label\": \"Tools\",\n            \"name\": \"agentTools\",\n            \"type\": \"array\",\n            \"optional\": true,\n            \"array\": [\n              {\n                \"label\": \"Tool\",\n                \"name\": \"agentSelectedTool\",\n                \"type\": \"asyncOptions\",\n                \"loadMethod\": \"listTools\",\n                \"loadConfig\": true\n              },\n              {\n                \"label\": \"Require Human Input\",\n                \"name\": \"agentSelectedToolRequiresHumanInput\",\n                \"type\": \"boolean\",\n                \"optional\": true\n              }\n            ],\n            \"id\": \"agentAgentflow_0-input-agentTools-array\",\n            \"display\": true\n          },\n          {\n            \"label\": \"Knowledge (Document Stores)\",\n            \"name\": \"agentKnowledgeDocumentStores\",\n            \"type\": \"array\",\n            \"description\": \"Give your agent context about different document sources. Document stores must be upserted in advance.\",\n            \"array\": [\n              {\n                \"label\": \"Document Store\",\n                \"name\": \"documentStore\",\n                \"type\": \"asyncOptions\",\n                \"loadMethod\": \"listStores\"\n              },\n              {\n                \"label\": \"Describe Knowledge\",\n                \"name\": \"docStoreDescription\",\n                \"type\": \"string\",\n                \"generateDocStoreDescription\": true,\n                \"placeholder\": \"Describe what the knowledge base is about, this is useful for the AI to know when and how to search for correct information\",\n                \"rows\": 4\n              },\n              {\n                \"label\": \"Return Source Documents\",\n                \"name\": \"returnSourceDocuments\",\n                \"type\": \"boolean\",\n                \"optional\": true\n              }\n            ],\n            \"optional\": true,\n            \"id\": \"agentAgentflow_0-input-agentKnowledgeDocumentStores-array\",\n            \"display\": true\n          },\n          {\n            \"label\": \"Knowledge (Vector Embeddings)\",\n            \"name\": \"agentKnowledgeVSEmbeddings\",\n            \"type\": \"array\",\n            \"description\": \"Give your agent context about different document sources from existing vector stores and embeddings\",\n            \"array\": [\n              {\n                \"label\": \"Vector Store\",\n                \"name\": \"vectorStore\",\n                \"type\": \"asyncOptions\",\n                \"loadMethod\": \"listVectorStores\",\n                \"loadConfig\": true\n              },\n              {\n                \"label\": \"Embedding Model\",\n                \"name\": \"embeddingModel\",\n                \"type\": \"asyncOptions\",\n                \"loadMethod\": \"listEmbeddings\",\n                \"loadConfig\": true\n              },\n              {\n                \"label\": \"Knowledge Name\",\n                \"name\": \"knowledgeName\",\n                \"type\": \"string\",\n                \"placeholder\": \"A short name for the knowledge base, this is useful for the AI to know when and how to search for correct information\"\n              },\n              {\n                \"label\": \"Describe Knowledge\",\n                \"name\": \"knowledgeDescription\",\n                \"type\": \"string\",\n                \"placeholder\": \"Describe what the knowledge base is about, this is useful for the AI to know when and how to search for correct information\",\n                \"rows\": 4\n              },\n              {\n                \"label\": \"Return Source Documents\",\n                \"name\": \"returnSourceDocuments\",\n                \"type\": \"boolean\",\n                \"optional\": true\n              }\n            ],\n            \"optional\": true,\n            \"id\": \"agentAgentflow_0-input-agentKnowledgeVSEmbeddings-array\",\n            \"display\": true\n          },\n          {\n            \"label\": \"Enable Memory\",\n            \"name\": \"agentEnableMemory\",\n            \"type\": \"boolean\",\n            \"description\": \"Enable memory for the conversation thread\",\n            \"default\": true,\n            \"optional\": true,\n            \"id\": \"agentAgentflow_0-input-agentEnableMemory-boolean\",\n            \"display\": true\n          },\n          {\n            \"label\": \"Memory Type\",\n            \"name\": \"agentMemoryType\",\n            \"type\": \"options\",\n            \"options\": [\n              {\n                \"label\": \"All Messages\",\n                \"name\": \"allMessages\",\n                \"description\": \"Retrieve all messages from the conversation\"\n              },\n              {\n                \"label\": \"Window Size\",\n                \"name\": \"windowSize\",\n                \"description\": \"Uses a fixed window size to surface the last N messages\"\n              },\n              {\n                \"label\": \"Conversation Summary\",\n                \"name\": \"conversationSummary\",\n                \"description\": \"Summarizes the whole conversation\"\n              },\n              {\n                \"label\": \"Conversation Summary Buffer\",\n                \"name\": \"conversationSummaryBuffer\",\n                \"description\": \"Summarize conversations once token limit is reached. Default to 2000\"\n              }\n            ],\n            \"optional\": true,\n            \"default\": \"allMessages\",\n            \"show\": {\n              \"agentEnableMemory\": true\n            },\n            \"id\": \"agentAgentflow_0-input-agentMemoryType-options\",\n            \"display\": false\n          },\n          {\n            \"label\": \"Window Size\",\n            \"name\": \"agentMemoryWindowSize\",\n            \"type\": \"number\",\n            \"default\": \"20\",\n            \"description\": \"Uses a fixed window size to surface the last N messages\",\n            \"show\": {\n              \"agentMemoryType\": \"windowSize\"\n            },\n            \"id\": \"agentAgentflow_0-input-agentMemoryWindowSize-number\",\n            \"display\": false\n          },\n          {\n            \"label\": \"Max Token Limit\",\n            \"name\": \"agentMemoryMaxTokenLimit\",\n            \"type\": \"number\",\n            \"default\": \"2000\",\n            \"description\": \"Summarize conversations once token limit is reached. Default to 2000\",\n            \"show\": {\n              \"agentMemoryType\": \"conversationSummaryBuffer\"\n            },\n            \"id\": \"agentAgentflow_0-input-agentMemoryMaxTokenLimit-number\",\n            \"display\": false\n          },\n          {\n            \"label\": \"Input Message\",\n            \"name\": \"agentUserMessage\",\n            \"type\": \"string\",\n            \"description\": \"Add an input message as user message at the end of the conversation\",\n            \"rows\": 4,\n            \"optional\": true,\n            \"acceptVariable\": true,\n            \"show\": {\n              \"agentEnableMemory\": true\n            },\n            \"id\": \"agentAgentflow_0-input-agentUserMessage-string\",\n            \"display\": false\n          },\n          {\n            \"label\": \"Return Response As\",\n            \"name\": \"agentReturnResponseAs\",\n            \"type\": \"options\",\n            \"options\": [\n              {\n                \"label\": \"User Message\",\n                \"name\": \"userMessage\"\n              },\n              {\n                \"label\": \"Assistant Message\",\n                \"name\": \"assistantMessage\"\n              }\n            ],\n            \"default\": \"userMessage\",\n            \"id\": \"agentAgentflow_0-input-agentReturnResponseAs-options\",\n            \"display\": true\n          },\n          {\n            \"label\": \"Update Flow State\",\n            \"name\": \"agentUpdateState\",\n            \"description\": \"Update runtime state during the execution of the workflow\",\n            \"type\": \"array\",\n            \"optional\": true,\n            \"acceptVariable\": true,\n            \"array\": [\n              {\n                \"label\": \"Key\",\n                \"name\": \"key\",\n                \"type\": \"asyncOptions\",\n                \"loadMethod\": \"listRuntimeStateKeys\",\n                \"freeSolo\": true\n              },\n              {\n                \"label\": \"Value\",\n                \"name\": \"value\",\n                \"type\": \"string\",\n                \"acceptVariable\": true,\n                \"acceptNodeOutputAsVariable\": true\n              }\n            ],\n            \"id\": \"agentAgentflow_0-input-agentUpdateState-array\",\n            \"display\": true\n          }\n        ],\n        \"inputAnchors\": [],\n        \"inputs\": {\n          \"agentModel\": \"chatOpenRouter\",\n          \"agentMessages\": [\n            {\n              \"role\": \"\",\n              \"content\": \"\u003cp\u003e\u003cspan class=\\\"variable\\\" data-type=\\\"mention\\\" data-id=\\\"question\\\" data-label=\\\"question\\\"\u003e{{ question }}\u003c/span\u003e \u003c/p\u003e\"\n            }\n          ],\n          \"agentTools\": [\n            {\n              \"agentSelectedTool\": \"readFile\",\n              \"agentSelectedToolRequiresHumanInput\": \"\",\n              \"agentSelectedToolConfig\": {\n                \"basePath\": \"/\",\n                \"agentSelectedTool\": \"readFile\"\n              }\n            },\n            {\n              \"agentSelectedTool\": \"writeFile\",\n              \"agentSelectedToolRequiresHumanInput\": \"\",\n              \"agentSelectedToolConfig\": {\n                \"basePath\": \"/\",\n                \"agentSelectedTool\": \"writeFile\"\n              }\n            }\n          ],\n          \"agentKnowledgeDocumentStores\": \"\",\n          \"agentKnowledgeVSEmbeddings\": \"\",\n          \"agentEnableMemory\": false,\n          \"agentReturnResponseAs\": \"userMessage\",\n          \"agentUpdateState\": \"\",\n          \"undefined\": \"\",\n          \"agentModelConfig\": {\n            \"cache\": \"\",\n            \"modelName\": \"qwen/qwen3-30b-a3b\",\n            \"temperature\": 0.9,\n            \"streaming\": true,\n            \"maxTokens\": \"\",\n            \"topP\": \"\",\n            \"frequencyPenalty\": \"\",\n            \"presencePenalty\": \"\",\n            \"timeout\": \"\",\n            \"basepath\": \"https://openrouter.ai/api/v1\",\n            \"baseOptions\": \"\",\n            \"agentModel\": \"chatOpenRouter\"\n          }\n        },\n        \"outputAnchors\": [\n          {\n            \"id\": \"agentAgentflow_0-output-agentAgentflow\",\n            \"label\": \"Agent\",\n            \"name\": \"agentAgentflow\"\n          }\n        ],\n        \"outputs\": {},\n        \"selected\": false\n      },\n      \"type\": \"agentFlow\",\n      \"width\": 232,\n      \"height\": 100,\n      \"selected\": false,\n      \"positionAbsolute\": {\n        \"x\": -63.5,\n        \"y\": 89.125\n      },\n      \"dragging\": false\n    }\n  ],\n  \"edges\": [\n    {\n      \"source\": \"startAgentflow_0\",\n      \"sourceHandle\": \"startAgentflow_0-output-startAgentflow\",\n      \"target\": \"agentAgentflow_0\",\n      \"targetHandle\": \"agentAgentflow_0\",\n      \"data\": {\n        \"sourceColor\": \"#7EE787\",\n        \"targetColor\": \"#4DD0E1\",\n        \"isHumanInput\": false\n      },\n      \"type\": \"agentFlow\",\n      \"id\": \"startAgentflow_0-startAgentflow_0-output-startAgentflow-agentAgentflow_0-agentAgentflow_0\"\n    },\n    {\n      \"source\": \"agentAgentflow_0\",\n      \"sourceHandle\": \"agentAgentflow_0-output-agentAgentflow\",\n      \"target\": \"directReplyAgentflow_0\",\n      \"targetHandle\": \"directReplyAgentflow_0\",\n      \"data\": {\n        \"sourceColor\": \"#4DD0E1\",\n        \"targetColor\": \"#4DDBBB\",\n        \"isHumanInput\": false\n      },\n      \"type\": \"agentFlow\",\n      \"id\": \"agentAgentflow_0-agentAgentflow_0-output-agentAgentflow-directReplyAgentflow_0-directReplyAgentflow_0\"\n    }\n  ]\n}\n```\n\n\n\n5. Click on \"AgentFlows\" on the left, then click \"Add New\" on the right to enter the Agent creation page. Click the gear button in the upper right corner, select \"Load Agents,\" choose the agent.json file, and after successful import, view three connected nodes.\n6. Double-click the middle \"Agent 0\" node, click \"ChatOpenRouter Parameters,\" then \"Connect Credential,\" and select \"Create New.\" Enter a valid OpenRouter API Key. Alternatively, click \"Model\" to choose another LLM provider. Once done, click the save button in the upper right corner.\n7. After saving, click the purple chat button in the upper right corner and enter: \"Read file content of /root/.flowise/encryption.key.\" Once the call is complete, click the expand button next to \"Agent 0\" in the \"Process Flow\" dropdown menu. The file content will be displayed in the \"Output\" section below.\n\n### Impact\n\nAuthenticated attackers can exploit this vulnerability to steal sensitive information such as encryption keys, databases, and environment variables from the server, potentially leading to remote command execution.\n\n### Credit\n\nThis vulnerability was discovered by:\n\n- XlabAI Team of Tencent Xuanwu Lab\n- Atuin Automated Vulnerability Discovery Engine",
  "id": "GHSA-j44m-5v8f-gc9c",
  "modified": "2025-11-07T16:46:14Z",
  "published": "2025-10-10T22:55:09Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/FlowiseAI/Flowise/security/advisories/GHSA-j44m-5v8f-gc9c"
    },
    {
      "type": "WEB",
      "url": "https://github.com/FlowiseAI/Flowise/security/advisories/GHSA-jv9m-vf54-chjj"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-61913"
    },
    {
      "type": "WEB",
      "url": "https://github.com/FlowiseAI/Flowise/commit/1fb12cd93143592a18995f63b781d25b354d48a3"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/FlowiseAI/Flowise"
    },
    {
      "type": "WEB",
      "url": "https://github.com/FlowiseAI/Flowise/releases/tag/flowise%403.0.8"
    }
  ],
  "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:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Flowise is vulnerable to arbitrary file exposure through its ReadFileTool"
}

GHSA-J453-HM5X-C46W

Vulnerability from github – Published: 2022-12-07 18:30 – Updated: 2022-12-12 20:48
VLAI
Summary
Echo vulnerable to directory traversal
Details

Due to improper sanitization of user input on Windows, the static file handler allows for directory traversal, allowing an attacker to read files outside of the target directory that the server has permission to read.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Go",
        "name": "github.com/labstack/echo/v4"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "4.2.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2020-36565"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2022-12-07T20:46:25Z",
    "nvd_published_at": "2022-12-07T17:15:00Z",
    "severity": "MODERATE"
  },
  "details": "Due to improper sanitization of user input on Windows, the static file handler allows for directory traversal, allowing an attacker to read files outside of the target directory that the server has permission to read.",
  "id": "GHSA-j453-hm5x-c46w",
  "modified": "2022-12-12T20:48:00Z",
  "published": "2022-12-07T18:30:26Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2020-36565"
    },
    {
      "type": "WEB",
      "url": "https://github.com/labstack/echo/pull/1718"
    },
    {
      "type": "WEB",
      "url": "https://github.com/labstack/echo/commit/4422e3b66b9fd498ed1ae1d0242d660d0ed3faaa"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/labstack/echo"
    },
    {
      "type": "WEB",
      "url": "https://pkg.go.dev/vuln/GO-2021-0051"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Echo vulnerable to directory traversal"
}

GHSA-J46Q-5PXX-8VMW

Vulnerability from github – Published: 2024-06-06 21:30 – Updated: 2025-04-08 22:01
VLAI
Summary
Local File Inclusion in mlflow
Details

A Local File Inclusion (LFI) vulnerability was identified in mlflow/mlflow, specifically in version 2.9.2, which was fixed in version 2.11.3. This vulnerability arises from the application's failure to properly validate URI fragments for directory traversal sequences such as '../'. An attacker can exploit this flaw by manipulating the fragment part of the URI to read arbitrary files on the local file system, including sensitive files like '/etc/passwd'. The vulnerability is a bypass to a previous patch that only addressed similar manipulation within the URI's query string, highlighting the need for comprehensive validation of all parts of a URI to prevent LFI attacks.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "PyPI",
        "name": "mlflow"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "2.11.3"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2024-2928"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22",
      "CWE-29"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2024-06-06T22:37:38Z",
    "nvd_published_at": "2024-06-06T19:15:55Z",
    "severity": "HIGH"
  },
  "details": "A Local File Inclusion (LFI) vulnerability was identified in mlflow/mlflow, specifically in version 2.9.2, which was fixed in version 2.11.3. This vulnerability arises from the application\u0027s failure to properly validate URI fragments for directory traversal sequences such as \u0027../\u0027. An attacker can exploit this flaw by manipulating the fragment part of the URI to read arbitrary files on the local file system, including sensitive files like \u0027/etc/passwd\u0027. The vulnerability is a bypass to a previous patch that only addressed similar manipulation within the URI\u0027s query string, highlighting the need for comprehensive validation of all parts of a URI to prevent LFI attacks.",
  "id": "GHSA-j46q-5pxx-8vmw",
  "modified": "2025-04-08T22:01:09Z",
  "published": "2024-06-06T21:30:36Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-2928"
    },
    {
      "type": "WEB",
      "url": "https://github.com/mlflow/mlflow/commit/96f0b573a73d8eedd6735a2ce26e08859527be07"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/mlflow/mlflow"
    },
    {
      "type": "WEB",
      "url": "https://github.com/pypa/advisory-database/tree/main/vulns/mlflow/PYSEC-2024-242.yaml"
    },
    {
      "type": "WEB",
      "url": "https://huntr.com/bounties/19bf02d7-6393-4a95-b9d0-d6d4d2d8c298"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Local File Inclusion in mlflow"
}

GHSA-J472-8CF4-5P72

Vulnerability from github – Published: 2022-05-17 05:48 – Updated: 2025-04-11 03:39
VLAI
Details

Directory traversal vulnerability in fileManager.cfc in Mura CMS 5.1 before 5.1.498 and 5.2 before 5.2.2809, and Sava CMS 5 through 5.2, allows remote attackers to read arbitrary files via a .. (dot dot) in the FILEID parameter to the default URI under tasks/render/file/.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2010-3468"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2010-09-29T17:00:00Z",
    "severity": "MODERATE"
  },
  "details": "Directory traversal vulnerability in fileManager.cfc in Mura CMS 5.1 before 5.1.498 and 5.2 before 5.2.2809, and Sava CMS 5 through 5.2, allows remote attackers to read arbitrary files via a .. (dot dot) in the FILEID parameter to the default URI under tasks/render/file/.",
  "id": "GHSA-j472-8cf4-5p72",
  "modified": "2025-04-11T03:39:23Z",
  "published": "2022-05-17T05:48:00Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2010-3468"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/41591"
    },
    {
      "type": "WEB",
      "url": "http://www.exploit-db.com/exploits/15120"
    },
    {
      "type": "WEB",
      "url": "http://www.getmura.com/index.cfm/blog/critical-security-patch"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/43499"
    },
    {
      "type": "WEB",
      "url": "http://www.stratsec.net/Research/Advisories/Blue-River-Mura-CMS-Directory-Traversal-%28SS-2010-0"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-J478-73X8-84H7

Vulnerability from github – Published: 2025-11-07 00:30 – Updated: 2025-11-07 00:30
VLAI
Details

Due to insufficient sanitization, an attacker can upload a specially crafted configuration file to traverse directories and achieve remote code execution with system-level permissions.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2025-62630"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2025-11-06T23:15:37Z",
    "severity": "HIGH"
  },
  "details": "Due to insufficient sanitization, an attacker can upload a specially \ncrafted configuration file to traverse directories and achieve remote \ncode execution with system-level permissions.",
  "id": "GHSA-j478-73x8-84h7",
  "modified": "2025-11-07T00:30:32Z",
  "published": "2025-11-07T00:30:32Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-62630"
    },
    {
      "type": "WEB",
      "url": "https://github.com/cisagov/CSAF/blob/develop/csaf_files/OT/white/2025/icsa-25-310-01.json"
    },
    {
      "type": "WEB",
      "url": "https://www.advantech.com/emt/contact"
    },
    {
      "type": "WEB",
      "url": "https://www.cisa.gov/news-events/ics-advisories/icsa-25-310-01"
    }
  ],
  "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"
    },
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
      "type": "CVSS_V4"
    }
  ]
}

GHSA-J482-HM6J-V5JJ

Vulnerability from github – Published: 2026-07-15 21:31 – Updated: 2026-07-15 21:31
VLAI
Details

The PackagerResolver of Apache Ivy is able to download online artifacts and to (re)package them in a format defined by a packager.xml file. This repackaging is done by an Ant script, which is stored in a subdirectory of the configured "buildRoot" directory. This subdirectory is calculated based on modules coordinates, like the organisation, name or version.

If one of the coordinates contains "../" sequences - which are valid characters for Ivy coordinates in general- it is possible to break out of the configured "buildRoot" directory where other files can be overwritten.

In order to exploit this vulnerability an attacker needs to have access to a packager repository and add or modify the coordinates in ivy.xml files to have such "../" sequences.

Users of Apache Ivy 2.0.0 to 2.5.3 (inclusive) should upgrade to Ivy 2.6.0.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2026-26032"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-07-15T19:17:10Z",
    "severity": "MODERATE"
  },
  "details": "The PackagerResolver of Apache Ivy is able to download online\nartifacts and to (re)package them in a format defined by a\npackager.xml file. This repackaging is done by an Ant script, which is\nstored in a subdirectory of the configured \"buildRoot\" directory. This\nsubdirectory is calculated based on modules coordinates, like the\norganisation, name or version.\n\nIf one of the coordinates contains \"../\" sequences - which are valid\ncharacters for Ivy coordinates in general- it is possible to break out\nof the configured \"buildRoot\" directory where other files can be\noverwritten.\n\nIn order to exploit this vulnerability an attacker needs to have\naccess to a packager repository and add or modify the coordinates in\nivy.xml files to have such \"../\" sequences.\n\nUsers of Apache Ivy 2.0.0 to 2.5.3 (inclusive) should upgrade to Ivy 2.6.0.",
  "id": "GHSA-j482-hm6j-v5jj",
  "modified": "2026-07-15T21:31:22Z",
  "published": "2026-07-15T21:31:22Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-26032"
    },
    {
      "type": "WEB",
      "url": "https://lists.apache.org/thread/4d9dzrlnoplvywnyj9x6w84kxg7n3jyq"
    },
    {
      "type": "WEB",
      "url": "http://www.openwall.com/lists/oss-security/2026/07/15/5"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-J4J9-VV9C-XPP3

Vulnerability from github – Published: 2023-03-01 09:30 – Updated: 2023-03-04 03:30
VLAI
Details

An authenticated path traversal vulnerability exists in the ArubaOS command line interface. Successful exploitation of this vulnerability results in the ability to read arbitrary files on the underlying operating system, including sensitive system files.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2023-22776"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2023-03-01T08:15:00Z",
    "severity": "MODERATE"
  },
  "details": "An authenticated path traversal vulnerability exists in the ArubaOS command line interface. Successful exploitation of this vulnerability results in the ability to read arbitrary files on the underlying operating system, including sensitive system files.",
  "id": "GHSA-j4j9-vv9c-xpp3",
  "modified": "2023-03-04T03:30:18Z",
  "published": "2023-03-01T09:30:27Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2023-22776"
    },
    {
      "type": "WEB",
      "url": "https://www.arubanetworks.com/assets/alert/ARUBA-PSA-2023-002.txt"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N",
      "type": "CVSS_V3"
    }
  ]
}

Mitigation MIT-5.1
Implementation

Strategy: Input Validation

  • Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
  • When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."
  • Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
  • When validating filenames, use stringent allowlists that limit the character set to be used. If feasible, only allow a single "." character in the filename to avoid weaknesses such as CWE-23, and exclude directory separators such as "/" to avoid CWE-36. Use a list of allowable file extensions, which will help to avoid CWE-434.
  • Do not rely exclusively on a filtering mechanism that removes potentially dangerous characters. This is equivalent to a denylist, which may be incomplete (CWE-184). For example, filtering "/" is insufficient protection if the filesystem also supports the use of "\" as a directory separator. Another possible error could occur when the filtering is applied in a way that still produces dangerous data (CWE-182). For example, if "../" sequences are removed from the ".../...//" string in a sequential fashion, two instances of "../" would be removed from the original string, but the remaining characters would still form the "../" string.
Mitigation MIT-15
Architecture and Design

For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.

Mitigation MIT-20.1
Implementation

Strategy: Input Validation

  • Inputs should be decoded and canonicalized to the application's current internal representation before being validated (CWE-180). Make sure that the application does not decode the same input twice (CWE-174). Such errors could be used to bypass allowlist validation schemes by introducing dangerous inputs after they have been checked.
  • Use a built-in path canonicalization function (such as realpath() in C) that produces the canonical version of the pathname, which effectively removes ".." sequences and symbolic links (CWE-23, CWE-59). This includes:
  • realpath() in C
  • getCanonicalPath() in Java
  • GetFullPath() in ASP.NET
  • realpath() or abs_path() in Perl
  • realpath() in PHP
Mitigation MIT-4
Architecture and Design

Strategy: Libraries or Frameworks

Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid [REF-1482].

Mitigation MIT-29
Operation

Strategy: Firewall

Use an application firewall that can detect attacks against this weakness. It can be beneficial in cases in which the code cannot be fixed (because it is controlled by a third party), as an emergency prevention measure while more comprehensive software assurance measures are applied, or to provide defense in depth [REF-1481].

Mitigation MIT-17
Architecture and Design Operation

Strategy: Environment Hardening

Run your code using the lowest privileges that are required to accomplish the necessary tasks [REF-76]. If possible, create isolated accounts with limited privileges that are only used for a single task. That way, a successful attack will not immediately give the attacker access to the rest of the software or its environment. For example, database applications rarely need to run as the database administrator, especially in day-to-day operations.

Mitigation MIT-21.1
Architecture and Design

Strategy: Enforcement by Conversion

  • When the set of acceptable objects, such as filenames or URLs, is limited or known, create a mapping from a set of fixed input values (such as numeric IDs) to the actual filenames or URLs, and reject all other inputs.
  • For example, ID 1 could map to "inbox.txt" and ID 2 could map to "profile.txt". Features such as the ESAPI AccessReferenceMap [REF-185] provide this capability.
Mitigation MIT-22
Architecture and Design Operation

Strategy: Sandbox or Jail

  • Run the code in a "jail" or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which files can be accessed in a particular directory or which commands can be executed by the software.
  • OS-level examples include the Unix chroot jail, AppArmor, and SELinux. In general, managed code may provide some protection. For example, java.io.FilePermission in the Java SecurityManager allows the software to specify restrictions on file operations.
  • This may not be a feasible solution, and it only limits the impact to the operating system; the rest of the application may still be subject to compromise.
  • Be careful to avoid CWE-243 and other weaknesses related to jails.
Mitigation MIT-34
Architecture and Design Operation

Strategy: Attack Surface Reduction

  • Store library, include, and utility files outside of the web document root, if possible. Otherwise, store them in a separate directory and use the web server's access control capabilities to prevent attackers from directly requesting them. One common practice is to define a fixed constant in each calling program, then check for the existence of the constant in the library/include file; if the constant does not exist, then the file was directly requested, and it can exit immediately.
  • This significantly reduces the chance of an attacker being able to bypass any protection mechanisms that are in the base program but not in the include files. It will also reduce the attack surface.
Mitigation MIT-39
Implementation
  • Ensure that error messages only contain minimal details that are useful to the intended audience and no one else. The messages need to strike the balance between being too cryptic (which can confuse users) or being too detailed (which may reveal more than intended). The messages should not reveal the methods that were used to determine the error. Attackers can use detailed information to refine or optimize their original attack, thereby increasing their chances of success.
  • If errors must be captured in some detail, record them in log messages, but consider what could occur if the log messages can be viewed by attackers. Highly sensitive information such as passwords should never be saved to log files.
  • Avoid inconsistent messaging that might accidentally tip off an attacker about internal state, such as whether a user account exists or not.
  • In the context of path traversal, error messages which disclose path information can help attackers craft the appropriate attack strings to move through the file system hierarchy.
Mitigation MIT-16
Operation Implementation

Strategy: Environment Hardening

When using PHP, configure the application so that it does not use register_globals. During implementation, develop the application so that it does not rely on this feature, but be wary of implementing a register_globals emulation that is subject to weaknesses such as CWE-95, CWE-621, and similar issues.

CAPEC-126: Path Traversal

An adversary uses path manipulation methods to exploit insufficient input validation of a target to obtain access to data that should be not be retrievable by ordinary well-formed requests. A typical variety of this attack involves specifying a path to a desired file together with dot-dot-slash characters, resulting in the file access API or function traversing out of the intended directory structure and into the root file system. By replacing or modifying the expected path information the access function or API retrieves the file desired by the attacker. These attacks either involve the attacker providing a complete path to a targeted file or using control characters (e.g. path separators (/ or \) and/or dots (.)) to reach desired directories or files.

CAPEC-64: Using Slashes and URL Encoding Combined to Bypass Validation Logic

This attack targets the encoding of the URL combined with the encoding of the slash characters. An attacker can take advantage of the multiple ways of encoding a URL and abuse the interpretation of the URL. A URL may contain special character that need special syntax handling in order to be interpreted. Special characters are represented using a percentage character followed by two digits representing the octet code of the original character (%HEX-CODE). For instance US-ASCII space character would be represented with %20. This is often referred as escaped ending or percent-encoding. Since the server decodes the URL from the requests, it may restrict the access to some URL paths by validating and filtering out the URL requests it received. An attacker will try to craft an URL with a sequence of special characters which once interpreted by the server will be equivalent to a forbidden URL. It can be difficult to protect against this attack since the URL can contain other format of encoding such as UTF-8 encoding, Unicode-encoding, etc.

CAPEC-76: Manipulating Web Input to File System Calls

An attacker manipulates inputs to the target software which the target software passes to file system calls in the OS. The goal is to gain access to, and perhaps modify, areas of the file system that the target software did not intend to be accessible.

CAPEC-78: Using Escaped Slashes in Alternate Encoding

This attack targets the use of the backslash in alternate encoding. An adversary can provide a backslash as a leading character and causes a parser to believe that the next character is special. This is called an escape. By using that trick, the adversary tries to exploit alternate ways to encode the same character which leads to filter problems and opens avenues to attack.

CAPEC-79: Using Slashes in Alternate Encoding

This attack targets the encoding of the Slash characters. An adversary would try to exploit common filtering problems related to the use of the slashes characters to gain access to resources on the target host. Directory-driven systems, such as file systems and databases, typically use the slash character to indicate traversal between directories or other container components. For murky historical reasons, PCs (and, as a result, Microsoft OSs) choose to use a backslash, whereas the UNIX world typically makes use of the forward slash. The schizophrenic result is that many MS-based systems are required to understand both forms of the slash. This gives the adversary many opportunities to discover and abuse a number of common filtering problems. The goal of this pattern is to discover server software that only applies filters to one version, but not the other.