Vulnerabilities in pkg:npm/@hapi/inert
PACKAGECVE-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.
pkg:npm/@hapi/inert
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
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).
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.
npm install @hapi/inert@7.1.1
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
CVE-2026-48049 Affected @hapi/inert Versions
1 component(s)| 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?
Which @hapi/inert versions are affected?
What version fixes CVE-2026-48049?
Is @hapi/inert affected?
What is the CVSS score of CVE-2026-48049?
What CWE is associated with CVE-2026-48049?
How can I check npm dependencies for CVE-2026-48049?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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
}
}