GHSA-mxjr-xmcg-fg7w: Mobile icon resizer Arbitrary Code Injection Vulnerability
MODERATEGHSA-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
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).
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.
npm install mobile-icon-resizer@0.4.3
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
GHSA-mxjr-xmcg-fg7w Affected Mobile icon resizer Versions
1 component(s)| 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?
Which Mobile icon resizer versions are affected?
What version fixes GHSA-mxjr-xmcg-fg7w?
Is mobile-icon-resizer affected?
What is the CVSS score of GHSA-mxjr-xmcg-fg7w?
What CWE is associated with GHSA-mxjr-xmcg-fg7w?
How can I check npm dependencies for GHSA-mxjr-xmcg-fg7w?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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
}
}