Skip to main content

hapijs joi CVE-2026-48038

| EUVDEUVD-2026-44390 MEDIUM
Uncaught Exception (CWE-248)
2026-06-11 https://github.com/hapijs/joi GHSA-q7cg-457f-vx79
5.3
CVSS 3.1 · Vendor: https://github.com/hapijs/joi
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Send deeply nested JSON payload
  2. Delivery
    joi link() resolver traverses recursively
  3. Exploit
    JavaScript call stack exhausted
  4. Execution
    RangeError thrown uncaught
  5. Persist
    Node.js process crashes
  6. Impact
    Service unavailable

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A10:2025 - Mishandling of Exceptional Conditions
ASVS 5.0
V16 - Security Logging and Error Handling Exception handling completeness
Exploitation Conditions

Exploitation requires that the application defines at least one joi schema using the link() type for recursive structure validation (e.g., Joi.object({ a: Joi.link('/') })). The targeted endpoint must accept user-controlled JSON that reaches that schema's validate() or validateAsync() call. Process crash (highest impact) further requires that the validation call is NOT wrapped in a try/catch - a common omission in request handlers. Applications not using recursive link() schemas are entirely unaffected regardless of their joi version. Non-recursive joi schema usage (strings, numbers, objects without link()) is not vulnerable. No authentication, no specific platform, and no non-default configuration beyond recursive link() schema usage is required to trigger the RangeError.

Impact

The provided CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L) scores 5.3, reflecting medium severity. However, the A:L assignment appears conservative: when validate() is called without a try/catch in a request handler - a common real-world pattern - the uncaught RangeError crashes the entire Node.js process, constituting complete availability loss (A:H) of the service for all users, not just the requester. An independent assessment of A:H yields CVSS 7.5. This discrepancy should be noted by defenders when prioritizing. No EPSS data was provided, and the CVE is not listed in CISA KEV, indicating no confirmed widespread or active exploitation. No public exploit code (POC) has been identified, though the attack is trivially constructable - any nested JSON object with thousands of levels is sufficient. The practical blast radius is bounded by the specific use of joi's link() schema for recursive validation; applications using joi without recursive link schemas are completely unaffected.

Exploit ScenarioDerived

An unauthenticated attacker sends a single HTTP POST request to an API endpoint that accepts JSON and validates it with a joi schema containing a recursive link() definition. The payload is a JSON object nested 5,000 or more levels deep (e.g., {a:{a:{a:...}}}). If the endpoint's validation code does not wrap schema.validate() in a try/catch, the resulting RangeError is unhandled, crashing the Node.js process and taking the service offline for all users. No public exploit code is needed - the payload is trivially generated with a simple loop.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 11, 2026

Denial of service in the joi npm validation library (< 18.2.1) is triggered by submitting deeply nested JSON objects against schemas that use recursive link() definitions, causing a JavaScript call stack overflow. The untrapped RangeError propagates out of joi's link resolver - crashing the Node.js process entirely when validate() is invoked without a surrounding try/catch, or silently breaking error-handling logic when a RangeError is returned where a structured ValidationError was expected. No confirmed active exploitation (not in CISA KEV) and no public exploit code identified at time of analysis, but the attack surface is inherently wide given joi's prevalence in Node.js web services.

RemediationAI

Upgrade joi to version 18.2.1 or later (vendor-released patch: 18.2.1) via npm install joi@>=18.2.1 or by updating the version constraint in package.json. The upstream fix is commit 2392713d3e9dd91ba752ac0c96e0eaf3d24b9a11 in PR hapijs/joi#3113, which wraps link resolution in a RangeError-catching try/catch and emits a structured link.depth error instead of propagating the exception. For deployments that cannot upgrade immediately, wrapping all validate() and validateAsync() calls in try/catch blocks prevents process crashes, but callers will receive a native RangeError object rather than a joi ValidationError, requiring additional type-checking in error handlers - a meaningful operational trade-off. As an additional defense-in-depth measure (recommended by the advisory even post-patch), set link.maxRecursion(limit) on all recursive link() schemas to enforce a deterministic depth ceiling before the call stack is threatened. See https://github.com/hapijs/joi/security/advisories/GHSA-q7cg-457f-vx79 for full details.

Affected VersionsENISA

joi 18.0.0, < 18.2.1
joi < 17.13.4

Affected Packages

npm joi fix: 17.13.4, 18.2.1

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in npm

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

joi (pkg:npm/joi) is a widely deployed Node.js schema-description and data-validation library maintained by the hapi.js project. Its link() schema type enables self-referential, recursive schemas - for example, a tree node schema that references the root schema for child nodes. Internally, link() resolution in lib/types/link.js calls linked.$_validate() recursively for each nested level of the input object. With sufficiently deep nesting (the test case in PR #3113 uses 5,000 levels), the JavaScript engine's native call stack is exhausted, raising a RangeError: Maximum call stack size exceeded. This maps to CWE-248 (Uncaught Exception): the library failed to catch this runtime exception at the link-resolution boundary, allowing it to propagate to the caller. The patch wraps the recursive $_validate call in a try/catch block that intercepts RangeError and converts it into a structured link.depth validation error, preventing process-level propagation.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/hapijs/joi) PRIMARY 5.3 MEDIUM
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
vuln.today AI 7.5 HIGH

Network-reachable, no auth, no complexity; process crash from unhandled exception justifies A:H over the official A:L.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Red Hat 5.3 MEDIUM

Primary rating from Vendor (https://github.com/hapijs/joi).

CVSS VectorVendor: https://github.com/hapijs/joi

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
Low

DescriptionCVE.org

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.

Resources

  • Pull request: hapijs/joi#3113

Threat Intelligence Overview

EPSS Score
0.0%
Top 88% exploitable
Threat Intel
1
1 source
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact· derived
Medium

Priority Score

26
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +26
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy