GHSA-mxjr-xmcg-fg7w json
Arbitrary Code Injection in mobile-icon-resizer
published 7y ago modified 5y ago
- cvss
- 6.5
- version 3.1, GitHub
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- —
- no score, EPSS covers CVEs only
- public exploits
- 0
- none known
Summary
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.
Patch / fix
Is GHSA-mxjr-xmcg-fg7w in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.
Check with FencerCVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| GitHub | 3.1 | 6.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| npm | mobile-icon-resizer | >=0.2.0, <0.4.3 |
0.4.3 |
Classification
- Weakness
-
- CWE-94 Improper Control of Generation of Code
References
Sources
- GitHub Advisory GHSA-mxjr-xmcg-fg7w
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.