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

ini 1.3.5 - dependency vulnerability in npm audit #698

Closed
zhuweid opened this issue Jun 17, 2021 · 26 comments
Closed

ini 1.3.5 - dependency vulnerability in npm audit #698

zhuweid opened this issue Jun 17, 2021 · 26 comments

Comments

@zhuweid
Copy link

zhuweid commented Jun 17, 2021

after running npm audit, there is one vulnerability found in @datorama/akita": "6.2.0"

"1589": {
"findings": [
{
"version": "1.3.5",
"paths": [
"@datorama/akita>schematics-utilities>@schematics/update>ini"
]
}
],
"id": 1589,
"created": "2020-12-09T22:25:48.568Z",
"updated": "2020-12-10T16:49:29.595Z",
"deleted": null,
"title": "Prototype Pollution",
"found_by": {
"link": "",
"name": "Anonymous",
"email": ""
},
"reported_by": {
"link": "",
"name": "Gur Shafriri",
"email": ""
},
"module_name": "ini",
"cves": [],
"vulnerable_versions": "<1.3.6",
"patched_versions": ">1.3.6",
"overview": "ini before version 1.3.6 has a Prototype Pollution vulnerability.\n\n### Impact\n\nIf an attacker submits a malicious INI file to an application that parses it with ini.parse, they will pollute the prototype on the application. This can be exploited further depending on the context.\n\n### Patches\n\nThis has been patched in 1.3.6\n\n### Steps to reproduce\n\npayload.ini\n\n[__proto__]\npolluted = \"polluted\"\n\n\npoc.js:\n\nvar fs = require('fs')\nvar ini = require('ini')\n\nvar parsed = ini.parse(fs.readFileSync('./payload.ini', 'utf-8'))\nconsole.log(parsed)\nconsole.log(parsed.__proto__)\nconsole.log(polluted)\n\n\n\n> node poc.js\n{}\n{ polluted: 'polluted' }\n{ polluted: 'polluted' }\npolluted\n\n",
"recommendation": "Upgrade to version 1.3.6 or later.",
"references": "- Fix Commit\n- GitHub Advisory",
"access": "public",
"severity": "low",
"cwe": "CWE-471",
"metadata": {
"module_type": "",
"exploitability": 3,
"affected_components": ""
},
"url": "https://npmjs.com/advisories/1589"
},

can we upgrade the ini to a newer version > 1.3.6 to fix this issue?

@cnestor1
Copy link

Any update on that issue found in the latest Akita lib version 7.1.1:
image

@nunoarruda
Copy link

I have the same issue:

Screenshot 2022-02-07 at 14 50 18

@NetanelBasal is there something you can do about this? I would prefer to use the latest version of Akita instead of downgrading.

@NetanelBasal
Copy link
Collaborator

You're welcome to submit a PR

@cnestor1
Copy link

cnestor1 commented Feb 7, 2022

The problem is that schematics.utilities depends on schematics.update and schematics.update has been deprecated:
This package is deprecated and will not be updated beyond Angular v11 (0.1102.x). It should no longer be used..

Looks like the schematics.utilities team is aware of that but doesn't have a solution either:
nitayneeman/schematics-utilities#49

Doesn't seem to be an easy one to solve but would definitely cause a security issue for whoever downloads the schematics.update module and uses Angular 13. (weekly download 1,007,298!)

@NetanelBasal
Copy link
Collaborator

For these reasons, I decided not to use schematics anymore in Elf.

@cnestor1
Copy link

@NetanelBasal Is Elf the latest version of Akita? Any targeted date?
Thank you.

@NetanelBasal
Copy link
Collaborator

@cnestor1
Copy link

So if I understand correctly, you are replacing Schematics-utilities with Elf although I don't see any relevance between the two.
To get a sense for it, in which 2022 quarter do you project to have that completed?
Thx fort a great Library!

@zhuweid
Copy link
Author

zhuweid commented Feb 12, 2022

@NetanelBasal my understanding is Elf does not have this issue, and it is recommended to switch to elf from akita?

And I guess the syntax of elf is similar with akita and the migration effort is low?

@NetanelBasal
Copy link
Collaborator

Correct

@cnestor1
Copy link

cnestor1 commented Feb 14, 2022

@NetanelBasal
Ok, I see now. It looks like all my questions have been answered here

What About Akita?[​](https://ngneat.github.io/elf/docs/faq#what-about-akita)
Akita is still actively maintained. Elf is merely another option. Furthermore, Akita is Datorama driven, and therefore performing significant changes was difficult. Elf was created to be more community-driven. See the [comment](https://github.com/ngneat/elf/discussions/5#discussioncomment-1437641) for more information.

So Akita will be deprecated since there is no resolution for this security issue. I have no issue migrating to Elf besides the fact this is an unplanned effort...

Any migration documentation from Akita to Elf or store conversion example available?

@NetanelBasal
Copy link
Collaborator

This is not related to the security issue. Elf is similar to Akita. The migration should be easy.

@ZanMarolt
Copy link

Would it be possible to remove schematics from akita all together for ng v13? 🤔 We have this security issue as well, and for the size of our application migrating to elf is not that straightforward 😐

@NetanelBasal
Copy link
Collaborator

That means we remove the schematics feature from Akita. You'll need to create all the code manually instead of using the generators.

@NetanelBasal
Copy link
Collaborator

To be honest I don't see how this affects your application. https://overreacted.io/npm-audit-broken-by-design/

@zhuweid
Copy link
Author

zhuweid commented Mar 9, 2022

currently @schematics/[email protected] has 3 vulnerabilities, they are Y18n, Ini and Tar 4.4.13.
We have been talking with our Security Officers and they seem to be fine with Y18n and Ini. However they have concern about Tar.

@datorama/[email protected]
└─┬ [email protected]
└─┬ @schematics/[email protected]
└─┬ [email protected]
└── [email protected]

@NetanelBasal , can I ask if schematics/update is only used as the code generator during dev time? If that is the case, we can safely ignore those issues.

@ZanMarolt
Copy link

Yes, @zhuweid it is only used during development and not shipped to production. But I still think upgrading the packages and staying up to date is the ideal scenario regardless

@NetanelBasal
Copy link
Collaborator

@ZanMarolt of course, when you control it :)

@ZanMarolt
Copy link

ZanMarolt commented Mar 9, 2022

Yeah, I am in no way trying to put the blame on the akita team or you @NetanelBasal. I am actually forever grateful for the awesome project and ongoing support, just trying to find a solution and possibly fix it myself.

@NetanelBasal do you see some alternatives for the schematics package?

@NetanelBasal
Copy link
Collaborator

Yes, we can use a native CLI as I did with Elf, but it will take time to develop it.

@NetanelBasal
Copy link
Collaborator

You can also create a post-script that deletes schematics and use https://datorama.github.io/akita/docs/enhancers/cli/

@SchVladyslav
Copy link

Hi @NetanelBasal !
Could you explain what you mean by creating a post-script that deletes schematics, please? I mean some examples, how to do it.
It sounds useful for big projects which don't plan migration.

@vipina1019
Copy link

Any update on this issue? I am facing vulnerability with ini 1.3.5 .

@butcher51
Copy link

I'm also waiting for the fix. Btw, does anyone tried to fix this with the npm overrides option? I couldn't solve with it but theoretically it should work somehow.

@ftadra
Copy link

ftadra commented Dec 7, 2022

One solution is to just override the ini version being used by one that doesn't present the vulnerability in your package.json

"overrides": { "ini": "^1.3.7" },

@NetanelBasal
Copy link
Collaborator

The repo is updated now. I'll release new versions soon.

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

9 participants