{
  "name": "Find vulnerable workflows",
  "nodes": [
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        -176,
        448
      ],
      "id": "3ec76dce-52b6-413e-a5e6-d4ffea48c95e",
      "name": "When clicking ‘Execute workflow’"
    },
    {
      "parameters": {
        "jsCode": "const items = $input.all();\n\nlet published = [];\nlet unpublished = [];\n\nitems.forEach((item) => {\n  let formTriggerFound = false;\n  let formFound = false;\n  \n  item.json.nodes.forEach((node) => {\n    const nodeType = node.type;\n    const parameters = node.parameters;\n\n    if (nodeType === \"n8n-nodes-base.formTrigger\") {\n      formTriggerFound = true;\n    }\n    \n    if (nodeType === \"n8n-nodes-base.form\") {\n      if (parameters &&\n        parameters[\"operation\"] === \"completion\" &&\n        parameters[\"respondWith\"] === \"returnBinary\"\n      ) {\n        formFound = true;\n      }\n    }\n  });\n\n  if (formFound && formTriggerFound) {\n    const result = {\n      workflowId: item.json.id,\n      name: item.json.name,\n      vulnerable: true\n    };\n    \n    if (item.json.active) {\n      published.push(result);\n    } else {\n      unpublished.push(result);\n    }\n  }\n});\n\nif (published.length === 0 && unpublished.length === 0) {\n  return [\n    { json: { message: \"No issues have been found\", html: \"<p>No issues have been found</p>\"  } }\n  ];\n}\n\n// Generate HTML table\nlet htmlRows = '';\n\nif (published.length > 0) {\n  published.forEach(item => {\n    htmlRows += `<tr><td>${item.workflowId}</td><td>${item.name}</td><td>Published</td><td>${item.vulnerable}</td></tr>`;\n  });\n}\n\nif (unpublished.length > 0) {\n  unpublished.forEach(item => {\n    htmlRows += `<tr><td>${item.workflowId}</td><td>${item.name}</td><td>Unpublished</td><td>${item.vulnerable}</td></tr>`;\n  });\n}\n\nconst htmlTable = `\n<table border=\"1\" cellpadding=\"10\" cellspacing=\"0\">\n  <thead>\n    <tr>\n      <th>Workflow ID</th>\n      <th>Workflow Name</th>\n      <th>Status</th>\n      <th>Vulnerable</th>\n    </tr>\n  </thead>\n  <tbody>\n    ${htmlRows}\n  </tbody>\n</table>\n`;\n\nreturn [\n  { json: { published, unpublished, html: htmlTable } },\n];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        352,
        448
      ],
      "id": "9fb9dbff-8e49-4c9f-b647-e3b85fd64edf",
      "name": "Code in JavaScript"
    },
    {
      "parameters": {
        "filters": {
          "excludePinnedData": true
        },
        "requestOptions": {}
      },
      "type": "n8n-nodes-base.n8n",
      "typeVersion": 1,
      "position": [
        64,
        448
      ],
      "id": "11705bfc-9edc-47f2-af0b-4f4e323589c1",
      "name": "Get many workflows"
    },
    {
      "parameters": {
        "html": "<!DOCTYPE html>\n\n<html>\n<head>\n  <meta charset=\"UTF-8\" />\n  <title>Report</title>\n</head>\n<body>\n  <div class=\"container\">\n    <h1>CVE-2026-21858 Report</h1>\n    <p>If any of your workflows are possibly impacted by this they will be shown below, A published workflow will be a higher priority than unpublished.</p>\n    <p>If you are using n8n 2.x or 1.121.0+ you will not be impacted, You can check your version by going to Help > About n8n.</p>\n    {{ $json.html }}\n  </div>\n</body>\n</html>\n\n<style>\n.container {\n  background-color: #ffffff;\n  text-align: center;\n  padding: 16px;\n  border-radius: 8px;\n}\n\nh1 {\n  color: #ff6d5a;\n  font-size: 24px;\n  font-weight: bold;\n  padding: 8px;\n}\n\nh2 {\n  color: #909399;\n  font-size: 18px;\n  font-weight: bold;\n  padding: 8px;\n}\n</style>\n\n<script>\nconsole.log(\"Hello World!\");\n</script>"
      },
      "type": "n8n-nodes-base.html",
      "typeVersion": 1.2,
      "position": [
        624,
        448
      ],
      "id": "e37edb70-e07c-4938-8594-c4c29f5d5a44",
      "name": "HTML"
    },
    {
      "parameters": {
        "content": "## CVE-2026-21858 Report Generator\n\nThis workflow will generate an HTML page you can view to see which workflows may be impacted by CVE-2026-21858,\n\nIf you are using version 2.0+ or 1.121+ you will not be impacted.\n\nTo run create an API key for your n8n instance under Settings > n8n API, When adding your credential make sure your url ends with `/api/v1`.\n\nSet this credenital for the n8n node below and click Execute Workflow, Once finished open the HTML node at the end of the workflow and select HTML.",
        "height": 272,
        "width": 800,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "typeVersion": 1,
      "id": "55081c77-b1ca-413d-8c65-6cb0d56d8336",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "content": "## Report\n\nOnce executed open this node and select HTML to view the report",
        "height": 304,
        "width": 224,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        576,
        288
      ],
      "typeVersion": 1,
      "id": "df7c26c1-a13b-4515-8963-8a12fae9743e",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "content": "## Setup\n\nAdd credentials for you n8n instances API here.",
        "height": 304,
        "width": 224,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        288
      ],
      "typeVersion": 1,
      "id": "78bae45c-3b33-41be-b960-b5abb0fa7f91",
      "name": "Sticky Note2"
    }
  ],
  "pinData": {},
  "connections": {
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Get many workflows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get many workflows": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "HTML",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "availableInMCP": false
  },
  "versionId": "17f185fb-8775-411a-8bec-3d3952898372",
  "meta": {
    "instanceId": "cb484ba7b742928a2048bf8829668bed5b5ad9787579adea888f05980292a4a7"
  },
  "id": "vupqDyGu7OIdn3o5pODdW",
  "tags": []
}