Skip to content
Heist/ feed
Back to feed
Medium

@hapi/inert: Static-file confinement bypass via sibling-prefix path

Type: advisorySources: OSV

@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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-48049
Confirmed fixed CVEs
Not specified
Updated in this feed
4 Nov 2026, 20:43 UTC · Revision 1

Source evidence

@hapi/inert: Static-file confinement bypass via sibling-prefix path

core-osv · Original source

Published 17 Jul 2026, 21:03 UTC

@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.

osv:CVE-2026-48049
Complete source record
{
  "id": "522bfccdf0e9ae17e4fde8ad75db6a5915439589f3ae640699a4688ab620af80",
  "url": "https://osv.dev/vulnerability/CVE-2026-48049",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "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.",
    "evidence": "osv:CVE-2026-48049",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2026-48049",
      "aliases": [
        "CVE-2026-48049",
        "GHSA-rcvq-m9j9-6f4g"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/hapijs/inert",
              "type": "GIT",
              "events": [
                {
                  "introduced": "c4f6b07e3864e7d0883b4f7a5675cb2e47a2096e"
                },
                {
                  "fixed": "9cd9da9f6535fb9c862f9b9e67386ed6bd92bb45"
                },
                {
                  "fixed": "bcceb761a43b9d1178eb6bd553e4ad2bb70494d9"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "4.0.0"
                      },
                      {
                        "fixed": "7.1.1"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "range": [
                      {
                        "fixed": "bcceb761a43b9d1178eb6bd553e4ad2bb70494d9"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "9cd9da9f6535fb9c862f9b9e67386ed6bd92bb45"
                      }
                    ],
                    "source": "REFERENCES_TAG",
                    "original_tag": "v7.1.1"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v7.1.0",
            "v7.0.1",
            "v7.0.0",
            "v6.0.5",
            "v6.0.4",
            "v6.0.3",
            "v6.0.2",
            "v6.0.1",
            "v6.0.0",
            "v5.2.2",
            "v5.2.1",
            "v5.2.0",
            "v5.1.3",
            "v5.1.2",
            "v5.1.1",
            "v5.1.0",
            "v5.0.1",
            "v5.0.0",
            "v5.0.0-rc8",
            "v5.0.0-rc7",
            "v5.0.0-rc5",
            "v5.0.0-rc4",
            "v5.0.0-rc1",
            "v4.2.1",
            "v4.2.0",
            "v4.1.0",
            "v4.0.4",
            "v4.0.3",
            "v4.0.2",
            "v4.0.1",
            "v4.0.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-48049.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:39.223741216Z",
      "provider": "osv",
      "references": [
        "https://github.com/hapijs/inert/releases/tag/v7.1.1",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/48xxx/CVE-2026-48049.json",
        "https://github.com/hapijs/inert/security/advisories/GHSA-rcvq-m9j9-6f4g",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-48049",
        "https://github.com/hapijs/inert/commit/bcceb761a43b9d1178eb6bd553e4ad2bb70494d9",
        "https://github.com/hapijs/inert/pull/176"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-22"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/48xxx/CVE-2026-48049.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-48049",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 506809,
  "published_at": "2026-07-17T21:03:16.577+00:00"
}