{"id":"CVE-2026-48049","aliases":["CVE-2026-48049","GHSA-rcvq-m9j9-6f4g"],"related":[],"kind":"vulnerability","state":"published","title":"@hapi/inert: Static-file confinement bypass via sibling-prefix path","summary":"@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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"@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.","source":"cvelist"},{"lang":"en","text":"### 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","format":"markdown","source":"ghsa"},{"lang":"es","text":"@hapi/inert proporciona manejadores de archivos estáticos y directorios para hapi.js. Desde la versión 4.0.0 hasta la 7.1.0, @hapi/inert sirve archivos estáticos desde un directorio configurado con ’path’ en los manejadores de directorio o archivo, o con ’relativeTo’ para h.file(), con el confinamiento aplicado por la opción ’confine’, pero la verificación de confinamiento comparó la ruta absoluta resuelta con el directorio de confinamiento utilizando una prueba de prefijo de cadena en bruto, por lo que un directorio hermano como /app/static-secret junto a /app/static fue aceptado incorrectamente y podría permitir a un atacante remoto no autenticado leer archivos a través de /..%2fstatic-secret/secret.txt. Este problema está solucionado en la versión 7.1.1.","source":"nvd"}],"published":"2026-06-11T17:10:15.000Z","modified":"2026-10-24T20:10:00.137Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","score":5.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","score":5.3,"rating":"MEDIUM"}],"cwes":["CWE-22"],"affected":[{"ranges":[{"version":">= 4.0.0, < 7.1.1","status":"affected"}],"vendor":"hapijs","product":"inert","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"4.0.0","status":"affected","fixed":"7.1.1"}],"ecosystem":"npm","package":"@hapi/inert","purl":"pkg:npm/%40hapi/inert","source":"ghsa"}],"references":[{"url":"https://github.com/hapijs/inert/security/advisories/GHSA-rcvq-m9j9-6f4g","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/hapijs/inert/pull/176","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/hapijs/inert/commit/bcceb761a43b9d1178eb6bd553e4ad2bb70494d9","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/hapijs/inert/releases/tag/v7.1.1","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/hapijs/inert/commit/a65e5b271b5c3405af463469959c5e052eb23a62","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/hapijs/inert","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-07-21T02:25:52.865Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-48049","url":"https://www.cve.org/CVERecord?id=CVE-2026-48049","licence":"CVE Terms of Use","modified":"2026-07-21T02:26:04.404Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-rcvq-m9j9-6f4g","url":"https://github.com/advisories/GHSA-rcvq-m9j9-6f4g","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:50.445Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-48049","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-48049","licence":"Public domain","modified":"2026-10-24T20:10:00.137Z"}],"updatedAt":"2026-11-25T22:59:28.589Z","epss":{"score":0.0059,"percentile":0.42249,"date":"2026-11-30T12:00:22.000Z"}}