Vulnerabilities in pkg:npm/@digitalbazaar/zcap

PACKAGE
Advisory Identifier: GHSA-hp8h-7x69-4wmv
Advisory Summary

CVE-2024-31995 is a MODERATE (CVSS 4.3) zcap has incomplete expiration checks vulnerability (CWE-613: Insufficient Session Expiration) affecting @digitalbazaar/zcap libraries in the npm ecosystem. The issue involves zcap has incomplete expiration checks in capability chains.. Remediation is available by upgrading affected packages to version 9.0.1.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@digitalbazaar/zcap

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/@digitalbazaar/zcap. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-hp8h-7x69-4wmv CVE-2024-31995 MODERATE zcap has incomplete expiration checks in capability chains.

CVE-2024-31995 at a Glance

CVE Identifier CVE-2024-31995
GHSA Identifier GHSA-hp8h-7x69-4wmv
Severity MODERATE
CVSS v3.1 Base Score 4.3
CWE Classification CWE-613: Insufficient Session Expiration
Affected Product @digitalbazaar/zcap
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 4.3

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

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

How to Fix CVE-2024-31995

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

@digitalbazaar/zcap fixed: 9.0.1
npm install @digitalbazaar/zcap@9.0.1
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 @digitalbazaar/zcap

How to Check if You Are Affected

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

npm ls @digitalbazaar/zcap

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

Note: The npm ls @digitalbazaar/zcap 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-613: Insufficient Session Expiration, where according to wasc, "insufficient session expiration is when a web site permits an attacker to reuse old session credentials or session ids for authorization.". In @digitalbazaar/zcap, 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 When invoking a capability with a chain depth of 2, i.e., it is delegated directly from the root capability, the `expires` property is not properly checked against the current date or other `date` param. This can allow invocations outside of the original intended time period. A zcap still cannot be invoked without being able to use the associated private key material. ### Patches `@digitalbazaar/zcap` v9.0.1 fixes expiration checking. ### Workarounds A zcap could be revoked at any time. ### References https://github.com/digitalbazaar/zcap/pull/82

CVE-2024-31995 Affected @digitalbazaar/zcap Versions

1 component(s)
Fixed Versions:
9.0.1
Product / Package Ecosystem Affected Versions Fixed Version
@digitalbazaar/zcap
npm
< 9.0.1
9.0.1

References

Frequently Asked Questions

What is CVE-2024-31995?
CVE-2024-31995 is a security vulnerability in @digitalbazaar/zcap involving zcap has incomplete expiration checks in capability chains. under CWE-613: Insufficient Session Expiration.
Which @digitalbazaar/zcap versions are affected?
Affected versions include releases prior to 9.0.1 across affected packages: @digitalbazaar/zcap.
What version fixes CVE-2024-31995?
Upgrading to 9.0.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @digitalbazaar/zcap affected?
Yes, @digitalbazaar/zcap is affected in releases prior to 9.0.1. Upgrade your dependency to 9.0.1 or later.
What is the CVSS score of CVE-2024-31995?
CVE-2024-31995 has a CVSS v3.1 base score of 4.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2024-31995?
CVE-2024-31995 is classified under CWE-613: Insufficient Session Expiration (According to WASC, "Insufficient Session Expiration is when a web site permits an attacker to reuse old session credentials or session IDs for authorization.").
How can I check npm dependencies for CVE-2024-31995?
Run the dependency tree command: 'npm ls @digitalbazaar/zcap'. 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-hp8h-7x69-4wmv",
  "modified" : "2024-04-11T14:31:30Z",
  "published" : "2024-04-10T17:16:15Z",
  "aliases" : [ "CVE-2024-31995" ],
  "summary" : "zcap has incomplete expiration checks in capability chains.",
  "details" : "### Impact\n\nWhen invoking a capability with a chain depth of 2, i.e., it is delegated directly from the root capability, the `expires` property is not properly checked against the current date or other `date` param.  This can allow invocations outside of the original intended time period.  A zcap still cannot be invoked without being able to use the associated private key material.\n\n### Patches\n\n`@digitalbazaar/zcap` v9.0.1 fixes expiration checking.\n\n### Workarounds\n\nA zcap could be revoked at any time.\n\n### References\n\nhttps://github.com/digitalbazaar/zcap/pull/82",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@digitalbazaar/zcap"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "9.0.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/digitalbazaar/zcap/security/advisories/GHSA-hp8h-7x69-4wmv"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-31995"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/digitalbazaar/zcap/pull/82"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/digitalbazaar/zcap/commit/261eea040109b6e25159c88d8ed49d3c37f8fcfe"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/digitalbazaar/zcap/commit/55f8549c80124b85dfb0f3dcf83f2c63f42532e5"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/digitalbazaar/zcap"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-613" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-10T17:16:15Z",
    "nvd_published_at" : "2024-04-10T22:15:07Z"
  }
}