CVE-2026-48038: Joi Joi Has An Uncaught RangeError Vulnerability

MODERATE
Advisory Identifier: GHSA-q7cg-457f-vx79
CVSS 5.3
CWE-400 CWE-248
Published
Advisory Summary

CVE-2026-48038 is a MODERATE (CVSS 5.3) joi has an uncaught rangeerror vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Joi libraries in the npm ecosystem. The issue involves joi has an uncaught rangeerror on deeply nested input through recursive `link()` schemas. Remediation is available by upgrading affected packages to version 18.2.1, 17.13.4.

CVE-2026-48038 at a Glance

CVE Identifier CVE-2026-48038
GHSA Identifier GHSA-q7cg-457f-vx79
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Joi
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.3

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:L).

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 Low (A:L)

How to Fix CVE-2026-48038

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

joi fixed: 18.2.1
npm install joi@18.2.1
joi fixed: 17.13.4
npm install joi@17.13.4
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 joi

How to Check if You Are Affected

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

npm ls joi

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

Note: The npm ls joi 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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Joi, 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 Denial of service via untrapped exception in services validating user-supplied JSON / object input with recursive link schemas. The blast radius depends on how the application invokes joi: - Highest impact: `validate()` called without `try/catch` in a request handler would cause an unhandled exception, potentially crashing the process. - Lower impact: `validateAsync()` or `validate()` inside a `try/catch`, the validation fails, but the error type is `RangeError` rather than a structured `ValidationError`, complicating error handling. ### Patches Upgrade to version >= 18.2.1. ### Workarounds Try/catch the validation to avoid uncaught exceptions. ### References - Pull request: hapijs/joi#3113

CVE-2026-48038 Affected Joi Versions

2 component(s)
Fixed Versions:
18.2.117.13.4
Product / Package Ecosystem Affected Versions Fixed Version
joi
npm
≥ 18.0.0
< 18.2.1
18.2.1
joi
npm
< 17.13.4
17.13.4

References

Frequently Asked Questions

What is CVE-2026-48038?
CVE-2026-48038 is a security vulnerability in Joi involving joi has an uncaught RangeError on deeply nested input through recursive `link()` schemas under CWE-400: Uncontrolled Resource Consumption.
Which Joi versions are affected?
Affected versions include releases prior to 18.2.1, 17.13.4 across affected packages: joi.
What version fixes CVE-2026-48038?
Upgrading to 18.2.1, 17.13.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is joi affected?
Yes, joi is affected in releases prior to 18.2.1, 17.13.4. Upgrade your dependency to 18.2.1, 17.13.4 or later.
What is the CVSS score of CVE-2026-48038?
CVE-2026-48038 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2026-48038?
CVE-2026-48038 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check npm dependencies for CVE-2026-48038?
Run the dependency tree command: 'npm ls joi'. 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-q7cg-457f-vx79",
  "modified" : "2026-06-12T19:28:27Z",
  "published" : "2026-06-11T13:27:32Z",
  "aliases" : [ "CVE-2026-48038" ],
  "summary" : "joi has an uncaught RangeError on deeply nested input through recursive `link()` schemas",
  "details" : "### Impact\nDenial of service via untrapped exception in services validating user-supplied JSON / object input with recursive link schemas. \n\nThe blast radius depends on how the application invokes joi:\n- Highest impact: `validate()` called without `try/catch` in a request handler would cause an unhandled exception, potentially crashing the process.\n- Lower impact: `validateAsync()` or `validate()` inside a `try/catch`, the validation fails, but the error type is `RangeError` rather than a structured `ValidationError`, complicating error handling.\n\n### Patches\nUpgrade to version >= 18.2.1.\n\n### Workarounds\nTry/catch the validation to avoid uncaught exceptions.\n\n### References\n- Pull request: hapijs/joi#3113",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "joi"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "18.0.0"
      }, {
        "fixed" : "18.2.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "joi"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "17.13.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/hapijs/joi/security/advisories/GHSA-q7cg-457f-vx79"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hapijs/joi/pull/3113"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hapijs/joi/commit/2392713d3e9dd91ba752ac0c96e0eaf3d24b9a11"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/hapijs/joi"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-248", "CWE-400" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-11T13:27:32Z",
    "nvd_published_at" : null
  }
}