Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vue-json-csv >=1.2.11 depends on vulnerable version of lodash.pick #544

Open
wcheek opened this issue Jun 17, 2024 · 0 comments
Open

vue-json-csv >=1.2.11 depends on vulnerable version of lodash.pick #544

wcheek opened this issue Jun 17, 2024 · 0 comments

Comments

@wcheek
Copy link

wcheek commented Jun 17, 2024

lodash has had an issue with prototype pollution. vue-json-csv should update its dependencies to not use the affected versions, otherwise users will potentially be exposed to severe vulnerabilities when using the package.

While vue-json-csv is slightly more convenient, I was able to replace vulnerable vue-json-csv completely by using json-2-csv and techniques in this post:

<v-btn prepend-icon="mdi-download" @click="downloadFile"></v-btn>

import * as converter from "json-2-csv";

function downloadFile() {
// downloadableJSON: Record<string, string | number>[]
  const csv = converter.json2csv(downloadableJSON);
  const anchor = document.createElement("a");
  anchor.href = "data:text/csv;charset=utf-8," + encodeURIComponent(csv);
  anchor.target = "_blank";
  anchor.download = "resultsData.csv";
  anchor.click();
}
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

No branches or pull requests

1 participant