Vulnerabilities in pkg:npm/@hapi/inert

PACKAGE
Advisory Identifier: GHSA-rcvq-m9j9-6f4g
Advisory Summary

CVE-2026-48049 is a MODERATE (CVSS 5.3) @hapi/inert has a static-file confinement vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting @hapi/inert libraries in the npm ecosystem. The issue involves @hapi/inert has a static-file confinement bypass via sibling-prefix path. Remediation is available by upgrading affected packages to version 7.1.1.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@hapi/inert

1 Known Advisory Record(s)

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

Advisory ID CVE / NVD Severity Summary
GHSA-rcvq-m9j9-6f4g CVE-2026-48049 MODERATE @hapi/inert has a static-file confinement bypass via sibling-prefix path

CVE-2026-48049 at a Glance

CVE Identifier CVE-2026-48049
GHSA Identifier GHSA-rcvq-m9j9-6f4g
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product @hapi/inert
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:L/I:N/A:N).

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 Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-48049

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

@hapi/inert fixed: 7.1.1
npm install @hapi/inert@7.1.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 @hapi/inert

How to Check if You Are Affected

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

npm ls @hapi/inert

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

Note: The npm ls @hapi/inert 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-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In @hapi/inert, 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 `@hapi/inert` serves static files from a directory configured with `path` (in the `directory` / `file` handlers) or `relativeTo` (for `h.file()`), with confinement enforced by the `confine` option (default `true`). Before the patch, the confinement check compared the resolved absolute path against the confine directory using a raw string-prefix test, so a sibling directory whose absolute path begins with the same characters as the confine directory (eg. `/app/static-secret` next to a served `/app/static`) was incorrectly accepted as confined. An unauthenticated remote attacker who knows or guesses such a sibling name can read any file inside it via a request like `/..%2fstatic-secret/secret.txt`, provided the file is readable by the server process. Only applications that happen to have a sibling directory sharing a string prefix with the served directory are exploitable; applications with no such sibling are unaffected. ### Patches Upgrade to 7.1.1. ### Workarounds For users who cannot upgrade immediately: ensure the directory served via inert has no sibling whose name starts with the same characters (for example, rename `static-secret/` to `secret/`, or move it to a different parent directory). ### Resources Pull Request: https://github.com/hapijs/inert/pull/176

CVE-2026-48049 Affected @hapi/inert Versions

1 component(s)
Fixed Versions:
7.1.1
Product / Package Ecosystem Affected Versions Fixed Version
@hapi/inert
npm
≥ 4.0.0
< 7.1.1
7.1.1

References

Frequently Asked Questions

What is CVE-2026-48049?
CVE-2026-48049 is a security vulnerability in @hapi/inert involving @hapi/inert has a static-file confinement bypass via sibling-prefix path under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which @hapi/inert versions are affected?
Affected versions include releases prior to 7.1.1 across affected packages: @hapi/inert.
What version fixes CVE-2026-48049?
Upgrading to 7.1.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @hapi/inert affected?
Yes, @hapi/inert is affected in releases prior to 7.1.1. Upgrade your dependency to 7.1.1 or later.
What is the CVSS score of CVE-2026-48049?
CVE-2026-48049 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:L/I:N/A:N.
What CWE is associated with CVE-2026-48049?
CVE-2026-48049 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check npm dependencies for CVE-2026-48049?
Run the dependency tree command: 'npm ls @hapi/inert'. 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-rcvq-m9j9-6f4g",
  "modified" : "2026-06-11T17:10:15Z",
  "published" : "2026-06-11T17:10:15Z",
  "aliases" : [ "CVE-2026-48049" ],
  "summary" : "@hapi/inert has a static-file confinement bypass via sibling-prefix path",
  "details" : "### Impact\n`@hapi/inert` serves static files from a directory configured with `path` (in the `directory` / `file` handlers) or `relativeTo` (for `h.file()`), with confinement enforced by the `confine` option (default `true`). Before the patch, the confinement check compared the resolved absolute path against the confine directory using a raw string-prefix test, so a sibling directory whose absolute path begins with the same characters as the confine directory (eg. `/app/static-secret` next to a served `/app/static`) was incorrectly accepted as confined. An unauthenticated remote attacker who knows or guesses such a sibling name can read any file inside it via a request like `/..%2fstatic-secret/secret.txt`, provided the file is readable by the server process. Only applications that happen to have a sibling directory sharing a string prefix with the served directory are exploitable; applications with no such sibling are unaffected.\n\n### Patches\nUpgrade to 7.1.1.\n\n### Workarounds\nFor users who cannot upgrade immediately: ensure the directory served via inert has no sibling whose name starts with the same characters (for example, rename `static-secret/` to `secret/`, or move it to a different parent directory).\n\n### Resources\nPull Request: https://github.com/hapijs/inert/pull/176",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@hapi/inert"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "fixed" : "7.1.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 7.1.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/hapijs/inert/security/advisories/GHSA-rcvq-m9j9-6f4g"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hapijs/inert/pull/176"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/hapijs/inert/commit/a65e5b271b5c3405af463469959c5e052eb23a62"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/hapijs/inert"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-11T17:10:15Z",
    "nvd_published_at" : null
  }
}