Vulnerabilities

2 via 3 paths

Dependencies

381

Source

GitHub

Commit

9c3ac50b

Find, fix and prevent vulnerabilities in your code.

Severity
  • 2
Status
  • 2
  • 0
  • 0

medium severity

Missing Release of Resource after Effective Lifetime

  • Vulnerable module: inflight
  • Introduced through: @fastify/static@6.12.0 and postgrator@5.0.1

Detailed paths

  • Introduced through: yh-community-contacts-api@Fdawgs/ydh-community-contacts-api#9c3ac50b2db71e12eca972a2a05f9a990dffa215 @fastify/static@6.12.0 glob@8.1.0 inflight@1.0.6
  • Introduced through: yh-community-contacts-api@Fdawgs/ydh-community-contacts-api#9c3ac50b2db71e12eca972a2a05f9a990dffa215 postgrator@5.0.1 glob@7.2.3 inflight@1.0.6

Overview

Affected versions of this package are vulnerable to Missing Release of Resource after Effective Lifetime via the makeres function due to improperly deleting keys from the reqs object after execution of callbacks. This behavior causes the keys to remain in the reqs object, which leads to resource exhaustion.

Exploiting this vulnerability results in crashing the node process or in the application crash.

Note: This library is not maintained, and currently, there is no fix for this issue. To overcome this vulnerability, several dependent packages have eliminated the use of this library.

To trigger the memory leak, an attacker would need to have the ability to execute or influence the asynchronous operations that use the inflight module within the application. This typically requires access to the internal workings of the server or application, which is not commonly exposed to remote users. Therefore, “Attack vector” is marked as “Local”.

PoC

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();

Remediation

There is no fixed version for inflight.

References

medium severity

Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')

  • Vulnerable module: @azure/identity
  • Introduced through: mssql@10.0.4

Detailed paths

  • Introduced through: yh-community-contacts-api@Fdawgs/ydh-community-contacts-api#9c3ac50b2db71e12eca972a2a05f9a990dffa215 mssql@10.0.4 tedious@16.7.1 @azure/identity@3.4.2
    Remediation: Upgrade to mssql@11.0.0.

Overview

@azure/identity is a Provides credential implementations for Azure SDK libraries that can authenticate with Microsoft Entra ID

Affected versions of this package are vulnerable to Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') in the authentication process. An attacker can elevate privileges by exploiting race conditions during the token validation steps. This is only exploitable if the application is configured to use multiple threads or processes for handling authentication requests.

Notes:

  1. An attacker who successfully exploited the vulnerability could elevate privileges and read any file on the file system with SYSTEM access permissions;

  2. An attacker who successfully exploits this vulnerability can only obtain read access to the system files by exploiting this vulnerability. The attacker cannot perform write or delete operations on the files;

  3. The vulnerability exists in the following credential types: DefaultAzureCredential and ManagedIdentityCredential;

  4. The vulnerability exists in the following credential types:

ManagedIdentityApplication (.NET)

ManagedIdentityApplication (Java)

ManagedIdentityApplication (Node.js)

Remediation

Upgrade @azure/identity to version 4.2.1 or higher.

References