CVE-2022-39381: Hummus Unchecked Return Value To NULL Vulnerability

HIGH
Advisory Identifier: GHSA-rcrx-fpjp-mfrw
CVSS 7.5
CWE-690 CWE-476
Published
Advisory Summary

CVE-2022-39381 is a HIGH (CVSS 7.5) unchecked return value to null vulnerability (CWE-690: Unchecked Return Value to NULL Pointer Dereference) affecting Hummus libraries in the npm ecosystem. The issue involves unchecked return value to null pointer dereference in pdfdocumenthandler.cpp. Remediation is available by upgrading affected packages to version 1.0.111, 2.6.0.

CVE-2022-39381 at a Glance

CVE Identifier CVE-2022-39381
GHSA Identifier GHSA-rcrx-fpjp-mfrw
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-690: Unchecked Return Value to NULL Pointer Dereference
Affected Product Hummus
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.5

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

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

How to Fix CVE-2022-39381

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

hummus fixed: 1.0.111
npm install hummus@1.0.111
muhammara fixed: 2.6.0
npm install muhammara@2.6.0
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 hummus

How to Check if You Are Affected

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

npm ls hummus

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

Note: The npm ls hummus 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-690: Unchecked Return Value to NULL Pointer Dereference, where the product does not check for an error after calling a function that can return with a null pointer if the function fails, which leads to a resultant null pointer dereference. In Hummus, 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

### Impact The package muhammara before 2.6.0; all versions of package hummus are vulnerable to Denial of Service (DoS) when supplied with a maliciously crafted PDF file to be appended to another. ### Patches It has been patched in 2.6.0 for muhammara and not at all for hummus ### Workarounds Do not process files from untrusted sources ### References PR: https://github.com/julianhille/MuhammaraJS/pull/194 Issue: https://github.com/julianhille/MuhammaraJS/issues/191 Issue in hummus: https://github.com/galkahana/HummusJS/issues/293 ### Outline differences to https://nvd.nist.gov/vuln/detail/CVE-2022-25892 The difference is one is in [src/deps/PDFWriter/PDFParser.cpp](https://github.com/julianhille/MuhammaraJS/commit/1890fb555eaf171db79b73fdc3ea543bbd63c002#diff-09ac2c64aeab42b14b2ae7b11a5648314286986f8c8444a5b3739ba7203b1e9b) and the other is [PDFDocumentHandler.cpp](https://github.com/julianhille/MuhammaraJS/pull/194/files#diff-38d338ea4c047fd7dd9a05b5ffe7c964f0fa7e79aff4c307ccee7596457b1ef2) both is a null pointer but for different cases These are totally diffent issues, one is in reading a pdf the other is in appendending a maliciously crafted one. The function calls are different the versions in which they are solved are diffent.

CVE-2022-39381 Affected Hummus Versions

2 component(s)
Fixed Versions:
1.0.1112.6.0
Product / Package Ecosystem Affected Versions Fixed Version
hummus
npm
< 1.0.111
1.0.111
muhammara
npm
< 2.6.0
2.6.0

References

Frequently Asked Questions

What is CVE-2022-39381?
CVE-2022-39381 is a security vulnerability in Hummus involving Unchecked Return Value to NULL Pointer Dereference in PDFDocumentHandler.cpp under CWE-690: Unchecked Return Value to NULL Pointer Dereference.
Which Hummus versions are affected?
Affected versions include releases prior to 1.0.111, 2.6.0 across affected packages: hummus, muhammara.
What version fixes CVE-2022-39381?
Upgrading to 1.0.111, 2.6.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is hummus affected?
Yes, hummus is affected in releases prior to 1.0.111. Upgrade your dependency to 1.0.111 or later.
Is muhammara affected?
Yes, muhammara is affected in releases prior to 2.6.0. Upgrade your dependency to 2.6.0 or later.
What is the CVSS score of CVE-2022-39381?
CVE-2022-39381 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2022-39381?
CVE-2022-39381 is classified under CWE-690: Unchecked Return Value to NULL Pointer Dereference (The product does not check for an error after calling a function that can return with a NULL pointer if the function fails, which leads to a resultant NULL pointer dereference.).
How can I check npm dependencies for CVE-2022-39381?
Run the dependency tree command: 'npm ls hummus'. 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-rcrx-fpjp-mfrw",
  "modified" : "2022-11-02T18:10:47Z",
  "published" : "2022-11-02T18:10:47Z",
  "aliases" : [ "CVE-2022-39381" ],
  "summary" : "Unchecked Return Value to NULL Pointer Dereference in PDFDocumentHandler.cpp",
  "details" : "### Impact\nThe package muhammara before 2.6.0; all versions of package hummus are vulnerable to Denial of Service (DoS) when supplied with a maliciously crafted PDF file to be appended to another.\n\n### Patches\nIt has been patched in 2.6.0 for muhammara and not at all for hummus\n\n### Workarounds\nDo not process files from untrusted sources\n\n### References\nPR: https://github.com/julianhille/MuhammaraJS/pull/194\nIssue: https://github.com/julianhille/MuhammaraJS/issues/191\nIssue in hummus: https://github.com/galkahana/HummusJS/issues/293\n\n### Outline differences to https://nvd.nist.gov/vuln/detail/CVE-2022-25892\n\nThe difference is one is in [src/deps/PDFWriter/PDFParser.cpp](https://github.com/julianhille/MuhammaraJS/commit/1890fb555eaf171db79b73fdc3ea543bbd63c002#diff-09ac2c64aeab42b14b2ae7b11a5648314286986f8c8444a5b3739ba7203b1e9b) and the other is [PDFDocumentHandler.cpp](https://github.com/julianhille/MuhammaraJS/pull/194/files#diff-38d338ea4c047fd7dd9a05b5ffe7c964f0fa7e79aff4c307ccee7596457b1ef2) both is a null pointer but for different cases\nThese are totally diffent issues, one is in reading a pdf the other is in appendending a maliciously crafted one. The function calls are different the versions in which they are solved are diffent. ",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "muhammara"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.6.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "hummus"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.0.111"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/julianhille/MuhammaraJS/security/advisories/GHSA-rcrx-fpjp-mfrw"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-39381"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/galkahana/HummusJS/issues/293"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/julianhille/MuhammaraJS/issues/191"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/julianhille/MuhammaraJS/pull/194"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/galkahana/HummusJS/commit/a9bf2520ab5abb69f9328906e406fbebfb36159a"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/julianhille/MuhammaraJS"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-476", "CWE-690" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-11-02T18:10:47Z",
    "nvd_published_at" : "2022-11-02T15:15:00Z"
  }
}