Skip to content

CefSharp.Common: `FolderSchemeHandlerFactory` path boundary check can expose files outside the configured root folder

Moderate severity GitHub Reviewed Published May 29, 2026 in cefsharp/CefSharp • Updated Jun 30, 2026

Package

CefSharp.Common (NuGet)

Affected versions

< 148.0.90

Patched versions

148.0.90

Description

Summary

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.

Details

In affected versions, FolderSchemeHandlerFactory canonicalized rootFolder, decoded the request path, combined it with the root, and then allowed the file when:

filePath.StartsWith(rootFolder, StringComparison.OrdinalIgnoreCase)

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

The affected code was reviewed at commit b5fef3bb4bc58798c95170078c41de92cfe9066e, assembly version 147.0.100.

PoC

Set rootFolder to a directory named www and create a sibling directory named www2:

<temp>/www/index.html
<temp>/www2/secret.txt

Register FolderSchemeHandlerFactory for <temp>/www, then request:

https://folderschemehandlerfactory.test/..%2fwww2/secret.txt

The request path is URL-decoded to ../www2/secret.txt, combined with <temp>/www, and canonicalized to:

<temp>/www2/secret.txt

Because <temp>/www2/secret.txt starts with <temp>/www as a string prefix, the affected check passes and secret.txt is served from outside rootFolder.

Expected vulnerable result: HTTP 200 with the contents of <temp>/www2/secret.txt.

Expected fixed result: 404 or equivalent not-found response because the resolved file is outside rootFolder.

Impact

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

An attacker must be able to cause the embedded browser to request URLs handled by the affected scheme registration.

References

@amaitland amaitland published to cefsharp/CefSharp May 29, 2026
Published to the GitHub Advisory Database Jun 30, 2026
Reviewed Jun 30, 2026
Last updated Jun 30, 2026

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N

EPSS score

Weaknesses

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. Learn more on MITRE.

CVE ID

CVE-2026-48796

GHSA ID

GHSA-85jm-cwp2-mvpv

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.