CVE-2018-16982: Opencc Denial of Service Vulnerability

MODERATE
Advisory Identifier: GHSA-9qh2-6fxg-9m4g
CVSS 5.5
CWE-125
Published
Advisory Summary

CVE-2018-16982 is a MODERATE (CVSS 5.5) denial of service vulnerability (CWE-125: Out-of-bounds Read) affecting Opencc libraries in the npm ecosystem. The issue involves open chinese convert subject to denial of service via out-of-bounds read. Remediation is available by upgrading affected packages to version 1.1.2.

CVE-2018-16982 at a Glance

CVE Identifier CVE-2018-16982
GHSA Identifier GHSA-9qh2-6fxg-9m4g
Severity MODERATE
CVSS v3.1 Base Score 5.5
CWE Classification CWE-125: Out-of-bounds Read
Affected Product Opencc
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2018-16982

To remediate this vulnerability, upgrade all affected Opencc dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

opencc fixed: 1.1.2
npm install opencc@1.1.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls opencc

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2018-16982, inspect your project dependencies using npm:

npm ls opencc

Analyze the terminal output to locate any version of Opencc in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.1.2), your application is affected.

Note: The npm ls opencc command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-125: Out-of-bounds Read, where the product reads data past the end, or before the beginning, of the intended buffer. In Opencc, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Open Chinese Convert (OpenCC) 1.0.5 allows attackers to cause a denial of service (segmentation fault) because BinaryDict::NewFromFile in BinaryDict.cpp may have out-of-bounds keyOffset and valueOffset values via a crafted .ocd file.

CVE-2018-16982 Affected Opencc Versions

1 component(s)
Fixed Versions:
1.1.2
Product / Package Ecosystem Affected Versions Fixed Version
opencc
npm
< 1.1.2
1.1.2

References

Frequently Asked Questions

What is CVE-2018-16982?
CVE-2018-16982 is a security vulnerability in Opencc involving Open Chinese Convert subject to Denial of Service via Out-of-bounds Read under CWE-125: Out-of-bounds Read.
Which Opencc versions are affected?
Affected versions include releases prior to 1.1.2 across affected packages: opencc.
What version fixes CVE-2018-16982?
Upgrading to 1.1.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is opencc affected?
Yes, opencc is affected in releases prior to 1.1.2. Upgrade your dependency to 1.1.2 or later.
What is the CVSS score of CVE-2018-16982?
CVE-2018-16982 has a CVSS v3.1 base score of 5.5 (MODERATE) with vector string CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2018-16982?
CVE-2018-16982 is classified under CWE-125: Out-of-bounds Read (The product reads data past the end, or before the beginning, of the intended buffer.).
How can I check npm dependencies for CVE-2018-16982?
Run the dependency tree command: 'npm ls opencc'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-9qh2-6fxg-9m4g",
  "modified" : "2024-11-22T17:59:52Z",
  "published" : "2022-05-14T01:55:28Z",
  "aliases" : [ "CVE-2018-16982" ],
  "summary" : "Open Chinese Convert subject to Denial of Service via Out-of-bounds Read",
  "details" : "Open Chinese Convert (OpenCC) 1.0.5 allows attackers to cause a denial of service (segmentation fault) because BinaryDict::NewFromFile in BinaryDict.cpp may have out-of-bounds keyOffset and valueOffset values via a crafted .ocd file.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "opencc"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.1.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-16982"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/BYVoid/OpenCC/issues/303"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/BYVoid/OpenCC/pull/309"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/BYVoid/OpenCC/pull/560"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/BYVoid/OpenCC/pull/560/commits/e1b8c7949738100e4747dd4109ef1f16e1bd99c4"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/BYVoid/OpenCC/commit/4a4f9e58e505fca93605f22363c133df66a91a5e"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/BYVoid/OpenCC"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/opencc-py/PYSEC-2018-153.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-125" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-09-30T13:10:06Z",
    "nvd_published_at" : "2018-09-13T02:29:00Z"
  }
}