{"id":"GHSA-55jh-84jv-8mx8","revision":"709804cacdfe46e780c8190e4690feb4","records":[{"revision":"709804cacdfe46e780c8190e4690feb4","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-55jh-84jv-8mx8","aliases":["CVE-2025-67750"],"title":"Lightning Flow Scanner Vulnerable to Code Injection via Unsafe Use of `new Function()` in APIVersion Rule","description":"### Impact\nThe APIVersion rule uses `new Function()` to evaluate expression strings. A malicious crafted flow metadata file can cause arbitrary JavaScript execution during scanning. An attacker could execute arbitrary JavaScript during a scan by supplying a malicious expression within rule configuration or crafted flow metadata. This could compromise developer machines, CI runners, or editor environments.\n\n### Patches\nThe patch removes all uses of `new Function()` and replaces them with a safer parser. It now validates operators (`>`, >=`, `<`, `<=`, `==`) and performs numeric comparisons without evaluating untrusted JavaScript.\n\n**version:** core-v6.10.6,\n**version vsx:**: v2.4.4\n**version app:**: v3.1.0\n\n### Work around\n\n```\n// --- Handle APIVersion rule separately to avoid unsafe-eval in the core library ---\n      const apiVersionConfig = ruleConfig.rules.APIVersion;\n      if (apiVersionConfig) {\n        delete ruleConfig.rules.APIVersion;\n      }\n\n// Manually evaluate the APIVersion rule, if it was configured.\n      if (apiVersionConfig) {\n        const flowApiVer = this.currentFlow.apiVersion || this.currentFlow.xmlData?.apiVersion;\n        const apiVersionRuleDef = allRules.find(r => r.name === \"APIVersion\");\n\n        // Determine the required expression (e.g. \">=58\").\n        let requiredExpr;\n        if (apiVersionConfig.expression) {\n          requiredExpr = apiVersionConfig.expression;\n        } else if (apiVersionConfig.threshold != null) {\n          requiredExpr = `>=${apiVersionConfig.threshold}`;\n        }\n\n        if (requiredExpr) {\n          const minVer = parseInt(requiredExpr.replace(/[^0-9]/g, \"\"), 10);\n          const operator = requiredExpr.replace(/[0-9]/g, \"\").trim();\n          const operators = {\n            \">=\": (a, b) => a < b,\n            \"<\": (a, b) => a >= b,\n            \">\": (a, b) => a <= b,\n            \"<=\": (a, b) => a > b,\n            \"==\": (a, b) => a !== b,\n            \"=\": (a, b) => a !== b\n          };\n          const violation = operators[operator] ? operators[operator](flowApiVer, minVer) : flowApiVer < minVer;\n\n          if (violation) {\n            // Craft a result object that mimics the core scanner output so downstream logic remains unchanged.\n            const manualScanResult = [{\n              flow: parsedFlow,\n              ruleResults: [{\n                ruleName: \"APIVersion\",\n                ruleDefinition: {\n                  description: apiVersionRuleDef?.description || \"API Version check\",\n                  label: apiVersionRuleDef?.label || \"APIVersion\"\n                },\n                occurs: true,\n                severity: apiVersionConfig.severity,\n                details: [{\n                  name: String(flowApiVer),\n                  type: \"apiVersion\",\n                  expression: requiredExpr\n                }]\n              }]\n            }];\n            results.push(...this.processScanResults(manualScanResult));\n          }\n        }\n      }\n\n```","state":0,"publishedAt":"2025-12-12T20:20:34+00:00","modifiedAt":"2025-12-20T05:07:45.36603+00:00","affected":[{"ecosystem":"npm","name":"lightning-flow-scanner","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"6.10.6"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"HIGH"}],"references":["https://github.com/Flow-Scanner/lightning-flow-scanner/security/advisories/GHSA-55jh-84jv-8mx8","https://nvd.nist.gov/vuln/detail/CVE-2025-67750","https://github.com/Flow-Scanner/lightning-flow-scanner/commit/10f64a5eb193d8a777e453b25e910144e4540795","https://github.com/Flow-Scanner/lightning-flow-scanner","https://github.com/Flow-Scanner/lightning-flow-scanner/releases/tag/core-v6.10.6"],"sourceUrl":"https://github.com/advisories/GHSA-55jh-84jv-8mx8","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-55jh-84jv-8mx8","identifiers":["GHSA-55jh-84jv-8mx8","CVE-2025-67750"]},"retained":false,"historicalAffected":[]}],"coverage":[]}