ghsa-55jh-84jv-8mx8
Vulnerability from github
Published
2025-12-12 20:20
Modified
2025-12-12 21:37
Summary
Lightning Flow Scanner Vulnerable to Code Injection via Unsafe Use of `new Function()` in APIVersion Rule
Details

Impact

The 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.

Patches

The 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. version: core-v6.10.6, version vsx:: v2.4.4

Work around

``` // --- Handle APIVersion rule separately to avoid unsafe-eval in the core library --- const apiVersionConfig = ruleConfig.rules.APIVersion; if (apiVersionConfig) { delete ruleConfig.rules.APIVersion; }

// Manually evaluate the APIVersion rule, if it was configured. if (apiVersionConfig) { const flowApiVer = this.currentFlow.apiVersion || this.currentFlow.xmlData?.apiVersion; const apiVersionRuleDef = allRules.find(r => r.name === "APIVersion");

    // Determine the required expression (e.g. ">=58").
    let requiredExpr;
    if (apiVersionConfig.expression) {
      requiredExpr = apiVersionConfig.expression;
    } else if (apiVersionConfig.threshold != null) {
      requiredExpr = `>=${apiVersionConfig.threshold}`;
    }

    if (requiredExpr) {
      const minVer = parseInt(requiredExpr.replace(/[^0-9]/g, ""), 10);
      const operator = requiredExpr.replace(/[0-9]/g, "").trim();
      const operators = {
        ">=": (a, b) => a < b,
        "<": (a, b) => a >= b,
        ">": (a, b) => a <= b,
        "<=": (a, b) => a > b,
        "==": (a, b) => a !== b,
        "=": (a, b) => a !== b
      };
      const violation = operators[operator] ? operators[operator](flowApiVer, minVer) : flowApiVer < minVer;

      if (violation) {
        // Craft a result object that mimics the core scanner output so downstream logic remains unchanged.
        const manualScanResult = [{
          flow: parsedFlow,
          ruleResults: [{
            ruleName: "APIVersion",
            ruleDefinition: {
              description: apiVersionRuleDef?.description || "API Version check",
              label: apiVersionRuleDef?.label || "APIVersion"
            },
            occurs: true,
            severity: apiVersionConfig.severity,
            details: [{
              name: String(flowApiVer),
              type: "apiVersion",
              expression: requiredExpr
            }]
          }]
        }];
        results.push(...this.processScanResults(manualScanResult));
      }
    }
  }

```

Show details on source website


{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "lightning-flow-scanner"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "6.10.6"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2025-67750"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2025-12-12T20:20:34Z",
    "nvd_published_at": "2025-12-12T21:15:59Z",
    "severity": "HIGH"
  },
  "details": "### 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 (`\u003e`, \u003e=`, `\u003c`, `\u003c=`, `==`) and performs numeric comparisons without evaluating untrusted JavaScript.\n**version:** core-v6.10.6,\n**version vsx:**: v2.4.4\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 =\u003e r.name === \"APIVersion\");\n\n        // Determine the required expression (e.g. \"\u003e=58\").\n        let requiredExpr;\n        if (apiVersionConfig.expression) {\n          requiredExpr = apiVersionConfig.expression;\n        } else if (apiVersionConfig.threshold != null) {\n          requiredExpr = `\u003e=${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            \"\u003e=\": (a, b) =\u003e a \u003c b,\n            \"\u003c\": (a, b) =\u003e a \u003e= b,\n            \"\u003e\": (a, b) =\u003e a \u003c= b,\n            \"\u003c=\": (a, b) =\u003e a \u003e b,\n            \"==\": (a, b) =\u003e a !== b,\n            \"=\": (a, b) =\u003e a !== b\n          };\n          const violation = operators[operator] ? operators[operator](flowApiVer, minVer) : flowApiVer \u003c 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```",
  "id": "GHSA-55jh-84jv-8mx8",
  "modified": "2025-12-12T21:37:29Z",
  "published": "2025-12-12T20:20:34Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/Flow-Scanner/lightning-flow-scanner/security/advisories/GHSA-55jh-84jv-8mx8"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-67750"
    },
    {
      "type": "WEB",
      "url": "https://github.com/Flow-Scanner/lightning-flow-scanner/commit/10f64a5eb193d8a777e453b25e910144e4540795"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/Flow-Scanner/lightning-flow-scanner"
    },
    {
      "type": "WEB",
      "url": "https://github.com/Flow-Scanner/lightning-flow-scanner/releases/tag/core-v6.10.6"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Lightning Flow Scanner Vulnerable to Code Injection via Unsafe Use of `new Function()` in APIVersion Rule"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.


Loading…

Loading…