GHSA-mxjr-xmcg-fg7w: Mobile icon resizer Arbitrary Code Injection Vulnerability

MODERATE
CVSS 6.5
CWE-94
Published
Advisory Summary

GHSA-mxjr-xmcg-fg7w is a MODERATE (CVSS 6.5) arbitrary code injection vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Mobile icon resizer libraries in the npm ecosystem. The issue involves arbitrary code injection in mobile-icon-resizer. Remediation is available by upgrading affected packages to version 0.4.3.

GHSA-mxjr-xmcg-fg7w at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-mxjr-xmcg-fg7w
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Mobile icon resizer
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix GHSA-mxjr-xmcg-fg7w

To remediate this vulnerability, upgrade all affected Mobile icon resizer dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

mobile-icon-resizer fixed: 0.4.3
npm install mobile-icon-resizer@0.4.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls mobile-icon-resizer

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-mxjr-xmcg-fg7w, inspect your project dependencies using npm:

npm ls mobile-icon-resizer

Analyze the terminal output to locate any version of Mobile icon resizer in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.4.3), your application is affected.

Note: The npm ls mobile-icon-resizer command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Mobile icon resizer, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

mobile-icon-resizer resizes large images for use as icons for iOS and Android. mobile-icon-resizer has a code execution vulnerability in versions before 0.4.3. mobile-icon-resizer takes an options object as an argument to define the resulting icons as such: ``` var options = { config: './config.js' } resize(options, function(err){}); ``` config.js would need to be a file on the filesystem and look something like: ``` var config = { iOS: { "images": [ /* iOS image definitions are not vulnerable */ ] }, android: { "images" : [ { "baseRatio" : "console.log('Executing script as baseRatio property')", "folder" : "drawable-ldpi" }, { "ratio" : "console.log('Executing script as ratio property')", "folder" : "drawable-mdpi" }, /* other android image defintiions ... */ ] } }; exports = module.exports = config; ``` The parameters `ratio` and `baseRatio` are passed directly to `eval()`, thus allowing dynamic javascript payloads to be executed. ## Recommendation Update to version 0.4.3 or later.

GHSA-mxjr-xmcg-fg7w Affected Mobile icon resizer Versions

1 component(s)
Fixed Versions:
0.4.3
Product / Package Ecosystem Affected Versions Fixed Version
mobile-icon-resizer
npm
≥ 0.2.0
< 0.4.3
0.4.3

References

Frequently Asked Questions

What is GHSA-mxjr-xmcg-fg7w?
GHSA-mxjr-xmcg-fg7w is a security vulnerability in Mobile icon resizer involving Arbitrary Code Injection in mobile-icon-resizer under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Mobile icon resizer versions are affected?
Affected versions include releases prior to 0.4.3 across affected packages: mobile-icon-resizer.
What version fixes GHSA-mxjr-xmcg-fg7w?
Upgrading to 0.4.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mobile-icon-resizer affected?
Yes, mobile-icon-resizer is affected in releases prior to 0.4.3. Upgrade your dependency to 0.4.3 or later.
What is the CVSS score of GHSA-mxjr-xmcg-fg7w?
GHSA-mxjr-xmcg-fg7w has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N.
What CWE is associated with GHSA-mxjr-xmcg-fg7w?
GHSA-mxjr-xmcg-fg7w is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check npm dependencies for GHSA-mxjr-xmcg-fg7w?
Run the dependency tree command: 'npm ls mobile-icon-resizer'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-mxjr-xmcg-fg7w",
  "modified" : "2021-08-17T15:41:58Z",
  "published" : "2019-06-27T17:25:21Z",
  "aliases" : [ ],
  "summary" : "Arbitrary Code Injection in mobile-icon-resizer",
  "details" : "mobile-icon-resizer resizes large images for use as icons for iOS and Android.\n\nmobile-icon-resizer has a code execution vulnerability in versions before 0.4.3.\n\nmobile-icon-resizer takes an options object as an argument to define the resulting icons as such:\n```\nvar options = {\n  config: './config.js'\n}\nresize(options, function(err){});\n```\nconfig.js would need to be a file on the filesystem and look something like:\n```\nvar config = {\n  iOS: {\n    \"images\": [\n     /* iOS image definitions are not vulnerable */\n    ]\n  },\n  android: {\n    \"images\" : [\n      {\n        \"baseRatio\" : \"console.log('Executing script as baseRatio property')\",\n        \"folder\" : \"drawable-ldpi\"\n      },\n      {\n        \"ratio\" : \"console.log('Executing script as ratio property')\",\n        \"folder\" : \"drawable-mdpi\"\n      },\n    /* other android image defintiions ... */\n    ]\n  }\n};\n\nexports = module.exports = config;\n```\nThe parameters `ratio` and `baseRatio` are passed directly to `eval()`, thus allowing dynamic javascript payloads to be executed.\n\n\n## Recommendation\n\nUpdate to version 0.4.3 or later.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "mobile-icon-resizer"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.2.0"
      }, {
        "fixed" : "0.4.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/muzzley/mobile-icon-resizer/issues/8"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/muzzley/mobile-icon-resizer/commit/a6c50f884bd282d74ab77e1fce6317d5d0dd2f0f"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/npm:mobile-icon-resizer:20160408"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/317"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2019-06-27T15:58:50Z",
    "nvd_published_at" : null
  }
}