# CVE-2026-48049: @hapi/inert: Static-file confinement bypass via sibling-prefix path

> An unauthenticated attacker can read files outside the intended directory by exploiting a flawed path confinement check in the hapi.js static file handler.

- **Severity:** Medium 5.3 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 17 Jul 2026
- **Updated:** 21 Jul 2026
- **Also known as:** GHSA-rcvq-m9j9-6f4g, MINI-29r5-prr9-3788, MINI-36rg-3329-wrph, MINI-7w8j-p27v-7m5v, MINI-8j8g-rr3w-fwqr, MINI-chwf-5g5j-hxp7, MINI-f7rj-7pm2-w983, MINI-gj34-3959-x5fj, MINI-j63h-9fxf-9373, MINI-m4m6-w4r3-6q7h, MINI-m834-wgwf-vqm5, MINI-wpp4-c43h-66fq, MINI-xrqr-j7w9-rxqc, ROOT-APP-NPM-CVE-2026-48049

## What is CVE-2026-48049?

CVE-2026-48049 is a medium-severity path traversal vulnerability in hapijs inert, published on 17 Jul 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official 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.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2026-48049?

2 open source packages ship an affected version, including @hapi/inert.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@hapi/inert` | npm | From 4.0.0 | 7.1.1 |
| `@hapi/inert` | npm | From 4.0.0 | 7.1.1 |

## How do I fix CVE-2026-48049?

Upgrade @hapi/inert to 7.1.1 or later.

## Is CVE-2026-48049 being exploited?

There is no known exploitation of CVE-2026-48049 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-48049 and fix it if it is affected.

What it is: CVE-2026-48049 is a medium-severity path traversal vulnerability in hapijs inert, published on 17 Jul 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-48049 in the wild and no public exploit code.

Affected packages and fixed versions:
- @hapi/inert (npm): affected from 4.0.0; fixed in 7.1.1
- @hapi/inert (npm): affected from 4.0.0; fixed in 7.1.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-48049/ (Markdown: https://insights.sbomify.com/CVE-2026-48049/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-48049
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-48049
- OSV: https://osv.dev/vulnerability/CVE-2026-48049

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-48049/
Summaries are generated and may contain mistakes; the official description above is the record.
