CVE-2026-48049: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in hapijs inert
@hapi/inert provides static file and directory handlers for hapi.js. From 4.0.0 to 7.1.0, @hapi/inert serves static files from a directory configured with path in the directory or file handlers or relativeTo for h.file(), with confinement enforced by the confine option, but the confinement check compared the resolved absolute path against the confine directory using a raw string-prefix test, so a sibling directory such as /app/static-secret next to /app/static was incorrectly accepted and could allow an unauthenticated remote attacker to read files via /..%2fstatic-secret/secret.txt. This issue is fixed in version 7.1.1.
AI Analysis
Technical Summary
@hapi/inert is a static file and directory handler for hapi.js. Between versions 4.0.0 and 7.1.0, the module enforces directory confinement by comparing the resolved absolute path against the configured confine directory using a raw string-prefix test. This method is flawed because it incorrectly accepts sibling directories (e.g., /app/static-secret when confine is /app/static), enabling path traversal attacks. An attacker can exploit this to read unauthorized files by using encoded path traversal sequences such as /..%2fstatic-secret/secret.txt. The vulnerability is tracked as CVE-2026-48049 and is classified under CWE-22 (Improper Limitation of a Pathname to a Restricted Directory). The issue is resolved in version 7.1.1.
Potential Impact
An unauthenticated remote attacker can read arbitrary files outside the intended static file directory by exploiting the path traversal vulnerability. This leads to unauthorized disclosure of potentially sensitive information. There is no indication of impact on integrity or availability.
Mitigation Recommendations
Upgrade @hapi/inert to version 7.1.1 or later, where the path traversal vulnerability is fixed. Since no official patch link or advisory is provided, verify the upgrade from the vendor's official release notes or repository. Until upgraded, avoid exposing static file directories that may contain sensitive data or implement additional access controls outside of @hapi/inert.
CVE-2026-48049: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in hapijs inert
Description
@hapi/inert provides static file and directory handlers for hapi.js. From 4.0.0 to 7.1.0, @hapi/inert serves static files from a directory configured with path in the directory or file handlers or relativeTo for h.file(), with confinement enforced by the confine option, but the confinement check compared the resolved absolute path against the confine directory using a raw string-prefix test, so a sibling directory such as /app/static-secret next to /app/static was incorrectly accepted and could allow an unauthenticated remote attacker to read files via /..%2fstatic-secret/secret.txt. This issue is fixed in version 7.1.1.
CVSS v3.1
Score 5.3medium
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
@hapi/inert is a static file and directory handler for hapi.js. Between versions 4.0.0 and 7.1.0, the module enforces directory confinement by comparing the resolved absolute path against the configured confine directory using a raw string-prefix test. This method is flawed because it incorrectly accepts sibling directories (e.g., /app/static-secret when confine is /app/static), enabling path traversal attacks. An attacker can exploit this to read unauthorized files by using encoded path traversal sequences such as /..%2fstatic-secret/secret.txt. The vulnerability is tracked as CVE-2026-48049 and is classified under CWE-22 (Improper Limitation of a Pathname to a Restricted Directory). The issue is resolved in version 7.1.1.
Potential Impact
An unauthenticated remote attacker can read arbitrary files outside the intended static file directory by exploiting the path traversal vulnerability. This leads to unauthorized disclosure of potentially sensitive information. There is no indication of impact on integrity or availability.
Mitigation Recommendations
Upgrade @hapi/inert to version 7.1.1 or later, where the path traversal vulnerability is fixed. Since no official patch link or advisory is provided, verify the upgrade from the vendor's official release notes or repository. Until upgraded, avoid exposing static file directories that may contain sensitive data or implement additional access controls outside of @hapi/inert.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-05-20T18:15:53.578Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a5b401a34329bf928c718cb
Added to database: 07/18/2026, 08:58:02 UTC
Last enriched: 07/18/2026, 08:59:54 UTC
Last updated: 07/18/2026, 11:08:19 UTC
Views: 4
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.