{"id":"CVE-2026-48796","aliases":["CVE-2026-48796","GHSA-85jm-cwp2-mvpv"],"related":[],"kind":"vulnerability","state":"published","title":"CefSharp: `FolderSchemeHandlerFactory` path boundary check can expose files outside the configured root folder","summary":"CefSharp provides .NET bindings for the Chromium Embedded Framework for Windows Forms and Windows Presentation Foundation applications. Prior to version 148.0.90, CefSharp/SchemeHandler/FolderSchemeHandlerFactory.cs used filePath.StartsWith(rootFolder, StringComparison.OrdinalIgnoreCase) to decide whether a decoded and canonicalized request path remained inside rootFolder. That raw prefix test did not enforce a directory boundary, so a request such as ..%2fwww2/secret.txt could escape a configured www directory into a sibling www2 directory whose path shared the same string prefix. Applications that register FolderSchemeHandlerFactory for a custom scheme or an HTTP or HTTPS scheme can therefore serve local files outside the intended root when an attacker can cause the embedded browser to request the crafted URL. The issue affects both Unix-style paths such as /tmp/app/www2 and Windows paths such as C:\\app\\www2, and the fix appends a directory separator to the normalized root before comparison while rejecting null bytes and alternate data stream syntax. This issue is fixed in version 148.0.90.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"CefSharp provides .NET bindings for the Chromium Embedded Framework for Windows Forms and Windows Presentation Foundation applications. Prior to version 148.0.90, CefSharp/SchemeHandler/FolderSchemeHandlerFactory.cs used filePath.StartsWith(rootFolder, StringComparison.OrdinalIgnoreCase) to decide whether a decoded and canonicalized request path remained inside rootFolder. That raw prefix test did not enforce a directory boundary, so a request such as ..%2fwww2/secret.txt could escape a configured www directory into a sibling www2 directory whose path shared the same string prefix. Applications that register FolderSchemeHandlerFactory for a custom scheme or an HTTP or HTTPS scheme can therefore serve local files outside the intended root when an attacker can cause the embedded browser to request the crafted URL. The issue affects both Unix-style paths such as /tmp/app/www2 and Windows paths such as C:\\app\\www2, and the fix appends a directory separator to the normalized root before comparison while rejecting null bytes and alternate data stream syntax. This issue is fixed in version 148.0.90.","source":"cvelist"},{"lang":"en","text":"### Summary\n\n`FolderSchemeHandlerFactory` was intended to restrict served files to a configured `rootFolder`, but its path validation used a raw string prefix check. A request could escape to a sibling directory whose full path starts with the root folder path, allowing files outside the configured root to be served.\n\n### Details\n\nIn affected versions, `FolderSchemeHandlerFactory` canonicalized `rootFolder`, decoded the request path, combined it with the root, and then allowed the file when:\n\n```csharp\nfilePath.StartsWith(rootFolder, StringComparison.OrdinalIgnoreCase)\n```\n\nThis does not enforce a directory boundary. For example, `/tmp/app/www2/secret.txt` starts with `/tmp/app/www`, but `www2` is a sibling of `www`, not a child. The same issue applies on Windows, for example `C:\\app\\www2\\secret.txt` starts with `C:\\app\\www`.\n\nThe affected code was reviewed at commit `b5fef3bb4bc58798c95170078c41de92cfe9066e`, assembly version `147.0.100`.\n\n### PoC\n\nSet `rootFolder` to a directory named `www` and create a sibling directory named `www2`:\n\n```text\n<temp>/www/index.html\n<temp>/www2/secret.txt\n```\n\nRegister `FolderSchemeHandlerFactory` for `<temp>/www`, then request:\n\n```text\nhttps://folderschemehandlerfactory.test/..%2fwww2/secret.txt\n```\n\nThe request path is URL-decoded to `../www2/secret.txt`, combined with `<temp>/www`, and canonicalized to:\n\n```text\n<temp>/www2/secret.txt\n```\n\nBecause `<temp>/www2/secret.txt` starts with `<temp>/www` as a string prefix, the affected check passes and `secret.txt` is served from outside `rootFolder`.\n\nExpected vulnerable result: HTTP 200 with the contents of `<temp>/www2/secret.txt`.\n\nExpected fixed result: 404 or equivalent not-found response because the resolved file is outside `rootFolder`.\n\n### Impact\n\nApplications using `FolderSchemeHandlerFactory` for a custom scheme or registered HTTP/HTTPS scheme may expose local files outside the intended served directory. This is most relevant when sensitive sibling directories share the root path prefix, such as `www`/`www2`, `public`/`public_backup`, or `static`/`static-secrets`.\n\nAn attacker must be able to cause the embedded browser to request URLs handled by the affected scheme registration.","format":"markdown","source":"ghsa"},{"lang":"es","text":"CefSharp proporciona enlaces .NET para el Chromium Embedded Framework para aplicaciones de Windows Forms y Windows Presentation Foundation. Antes de la versión 148.0.90, CefSharp/SchemeHandler/FolderSchemeHandlerFactory.cs utilizaba filePath.StartsWith(rootFolder, StringComparison.OrdinalIgnoreCase) para decidir si una ruta de solicitud decodificada y canonizada permanecía dentro de rootFolder. Esa prueba de prefijo sin procesar no aplicaba un límite de directorio, por lo que una solicitud como ..%2fwww2/secret.txt podría escapar de un directorio www configurado a un directorio www2 hermano cuya ruta compartía el mismo prefijo de cadena. Las aplicaciones que registran FolderSchemeHandlerFactory para un esquema personalizado o un esquema HTTP o HTTPS pueden, por lo tanto, servir archivos locales fuera de la raíz prevista cuando un atacante puede hacer que el navegador incrustado solicite la URL manipulada. El problema afecta tanto a las rutas de estilo Unix como /tmp/app/www2 como a las rutas de Windows como C:\\app\\www2, y la solución añade un separador de directorio a la raíz normalizada antes de la comparación, al tiempo que rechaza los bytes nulos y la sintaxis de flujo de datos alternativo. Este problema se corrige en la versión 148.0.90.","source":"nvd"}],"published":"2026-06-30T18:36:12.000Z","modified":"2026-11-09T20:10:00.200Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N","score":5.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N","score":5.3,"rating":"MEDIUM"}],"cwes":["CWE-22"],"affected":[{"ranges":[{"version":"< 148.0.90","status":"affected"}],"vendor":"cefsharp","product":"CefSharp","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"148.0.90"}],"ecosystem":"NuGet","package":"CefSharp.Common","purl":"pkg:nuget/CefSharp.Common","source":"ghsa"}],"references":[{"url":"https://github.com/cefsharp/CefSharp/security/advisories/GHSA-85jm-cwp2-mvpv","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/cefsharp/CefSharp/commit/3475c7ef14119f67ec3720866bb3e4b1c6c68632","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/cefsharp/CefSharp/releases/tag/v148.0.90","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/cefsharp/CefSharp","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-08-19T18:03:47.436Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-48796","url":"https://www.cve.org/CVERecord?id=CVE-2026-48796","licence":"CVE Terms of Use","modified":"2026-08-19T18:19:59.005Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-85jm-cwp2-mvpv","url":"https://github.com/advisories/GHSA-85jm-cwp2-mvpv","licence":"CC-BY-4.0","modified":"2026-09-10T03:51:08.931Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-48796","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-48796","licence":"Public domain","modified":"2026-11-09T20:10:00.200Z"}],"updatedAt":"2026-11-25T22:59:33.879Z","epss":{"score":0.00293,"percentile":0.23531,"date":"2026-12-01T12:00:22.000Z"}}