Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-48049: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in hapijs inert

0
Medium
VulnerabilityCVE-2026-48049cvecve-2026-48049cwe-22
Published: 07/17/2026 (07/17/2026, 21:03:16 UTC)
Source: CVE Database V5
Vendor/Project: hapijs
Product: 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

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
None
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

Affected software

@hapi/inert
pkg:npm/@hapi/inert
Affected versions
<7.1.1 >=4.0.0

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/18/2026, 08:59:54 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses