Improper Control of Resources Affecting detect-character-encoding package, versions <0.3.1


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    Exploit Maturity
    Proof of concept
    EPSS
    0.31% (71st percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-JS-DETECTCHARACTERENCODING-1579267
  • published 1 Sep 2021
  • disclosed 1 Sep 2021
  • credit Unknown

How to fix?

Upgrade detect-character-encoding to version 0.3.1 or higher.

Overview

detect-character-encoding is a Detect character encoding using ICU.

Affected versions of this package are vulnerable to Improper Control of Resources. Missing closure of charsetDetector leads to a memory leak.

PoC

const express = require("express");
const detectCharacterEncoding = require("detect-character-encoding");

const app = express();

app.get("/", (req, res) => {
  detectCharacterEncoding(Buffer.from("somewhere"));
  res.end();
});

app.listen(3000);

CVSS Scores

version 3.1
Expand this section

Snyk

Recommended
7.5 high
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    Low
  • Privileges Required (PR)
    None
  • User Interaction (UI)
    None
  • Scope (S)
    Unchanged
  • Confidentiality (C)
    None
  • Integrity (I)
    None
  • Availability (A)
    High
Expand this section

NVD

7.5 high