Skip to content

Conversation

@avocadianmage
Copy link

The primary reason I'm making this pull request is that this package pulls in lodash as a dependency, and the particular version it pulls in has security vulnerability CVE-2018-3721. While from a practical standpoint, this is unlikely to be exploited in the context of the icon-extractor package, it also produces annoying NPM warnings and github alerts when attempting to commit code with icon-extractor as a dependency.

My original intent was to simply commit a fix updating the dependency to the latest version of lodash. However, after a quick look at the code, I found that lodash was only being used a couple of times for some fairly straightforward looping and string checking, so I just removed the package as a dependency and replaced these two calls with standard Javascript.

In the process of testing my changes locally, I ran into a couple bumps compiling and running the C# project which would have required manual file manipulation to fix. So to save time if someone else is cloning this repo, I've also fixed these issues:

  • The copy command in the post-build actions doesn't create new directories in the path (ex: bin, which doesn't exist in the repo) and thus fails.
  • This post-build action only copies the .exe into the target folder, but none of it's dependencies. Since the Newtonsoft.Json.dll isn't also copied, the executable won't run from that location.

I just eliminated the post-build action, and set the output path of the project to the appropriate directory, which fixes both of these issues.

Finally, I updated .gitignore to the standard recommended for C# projects, and removed everything else (such as node_modules since there's no dependencies anymore). Also committing package-lock.json as standardly advised.

Would love to get this merged in and published, so I can keep using it. It's been a helpful package and I'd rather not completely fork it off if we can keep things consolidated here. Cheers.

@zac1st1k
Copy link

Hi,

could we merge this PR? Lodash 3 is vulnerable and triggering alarms in scanning tools.

@avocadianmage
Copy link
Author

For what it's worth, I ended up creating my own package. It might be of use to you. Here it is: https://www.npmjs.com/package/file-icon-info

@zac1st1k
Copy link

Thanks for your reply @avocadianmage , could you please confirm if they are fully compatible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants