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

Vulnerability in inflight dependency in the dependency chain of @angular-devkit/build-angular #27842

Closed
brayanlelo8 opened this issue Jun 13, 2024 · 4 comments · Fixed by #27857

Comments

@brayanlelo8
Copy link

brayanlelo8 commented Jun 13, 2024

Command

build

Description

I have identified a vulnerability in the dependency chain of @angular-devkit/build-angular, specifically in the inflight dependency. The inflight library has not received updates or support and presents a critical resource release vulnerability.

Describe the solution you'd like

Dependency name: inflight
Version: 1.0.6
Vulnerability description: Missing Release of Resource after Effective Lifetime
Technical details:

  • Affected package: inflight

  • Detailed vulnerability path:

@angular-devkit/[email protected][email protected][email protected][email protected][email protected]

  • Description: The affected versions of this package are vulnerable to missing release of resource after effective lifetime via the makeres function. Improperly deleting keys from the reqs object after executing callbacks causes the keys to remain in the reqs object, leading to resource exhaustion, which can result in node process or application crash.

Describe alternatives you've considered

  • The [email protected] library has not been updated in over 3 years, suggesting it is no longer maintained.

  • However, the test-exclude and glob libraries have received updates and are currently maintained, indicating that the problem mainly lies with the outdated babel-plugin-istanbul.

  • PoC (Proof of Concept)

const inflight = require('inflight');

function testInflight() {
  let i = 0;
  function scheduleNext() {
    let key = `key-${i++}`;
    const callback = () => {
    };
    for (let j = 0; j < 1000000; j++) {
      inflight(key, callback);
    }

    setImmediate(scheduleNext);
  }

  if (i % 100 === 0) {
    console.log(process.memoryUsage());
  }

  scheduleNext();
}

testInflight();
@JeanMeche
Copy link
Member

JeanMeche commented Jun 13, 2024

Right now, upstream hasn't fixed the issue:

@brayanlelo8
Copy link
Author

Understood, but keep in mind that this library has not received support for over 3 years. Over time, new vulnerabilities could emerge in this library. We need to find a solution soon, as OWASP Dependency-Check could detect these vulnerabilities at any moment.

@andrew-corliss
Copy link

Hello Question;

We are using Checkmarx for Dependency Vulnerability checks and inflight has started to trigger as a Vulnerability in the application. The application is running on Angular v 16.2.12. Given that v16 is in LTS and should receive vulnerability updates will this change be merged as well to support version 16 or will the application need to be updated to another version.

Thank you.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jul 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants