1. Overview
A path traversal vulnerability exists in the SharePoint Server file upload page (Upload.aspx). The UploadPage.CurrentFolder property resolves the upload destination from the user-supplied RootFolder query string parameter without validating that the resolved folder belongs to the document library specified by the List parameter. An authenticated attacker with upload permissions to one document library can craft a request that uploads files to a different, restricted document library on the same site — including the Master Page Gallery (_catalogs/masterpage).
When the SharePoint web application has PageParserPaths configured to allow server-side script in the Master Page Gallery — a common configuration in deployments with custom branding or master pages — the attacker can upload an ASPX webshell that executes arbitrary operating system commands under the w3wp.exe application pool identity. This escalates the vulnerability from a path traversal to full Remote Code Execution.
Microsoft addressed this vulnerability by adding a ParentListId ownership check to the CurrentFolder property.
2. Vulnerability Type
| Field | Value |
|---|---|
| Primary CWE | CWE-22: Improper Limitation of a Pathname to a Restricted Directory (‘Path Traversal’) |
3. Severity
CVSS 3.1 (from CVRF advisory)
| Field | Value |
|---|---|
| Score | 6.5 (Medium) |
| Vector | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N/E:U/RL:O/RC:C |
Note: Microsoft’s advisory vector shows C:H/I:N (confidentiality impact). Our confirmed exploit demonstrates I:H/C:N (integrity impact — unauthorized file write to a restricted document library) with subsequent code execution. The CVSS vector may reflect a different variant fixed by the same KB.
Our Assessment (CVSS 4.0)
| Metric Group | Metric | Value |
|---|---|---|
| Base – Exploitability | Attack Vector (AV) | Network |
| Attack Complexity (AC) | Low | |
| Attack Requirements (AT) | None | |
| Privileges Required (PR) | Low | |
| User Interaction (UI) | None | |
| Base – Vulnerable System | Confidentiality (VC) | None |
| Integrity (VI) | High | |
| Availability (VA) | None | |
| Base – Subsequent System | Confidentiality (SC) | High |
| Integrity (SI) | High | |
| Availability (SA) | None | |
| Threat | Exploit Maturity (E) | Proof-of-Concept |
| Field | Value |
|---|---|
| CVSS 4.0 Score | 8.2 (High) |
| CVSS 4.0 Vector | CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:N/SC:H/SI:H/SA:N/E:P |
SC:H/SI:H reflects the subsequent impact of code execution on the operating system when PageParserPaths is configured. The base VI:H reflects the unconditional ability to write files to arbitrary document libraries. Microsoft rates exploitation as “Less Likely” with no known active exploitation (CVRF June 2026).
4. Affected Products
Affected Products
| Product | CPE 2.3 |
|---|---|
| Microsoft SharePoint Server 2019 | cpe:2.3:a:microsoft:sharepoint_server:2019:*:*:*:*:*:*:* |
| Microsoft SharePoint Enterprise Server 2016 | cpe:2.3:a:microsoft:sharepoint_server:2016:*:*:*:enterprise:*:*:* |
| Microsoft SharePoint Server Subscription Edition | cpe:2.3:a:microsoft:sharepoint_server:*:*:*:*:subscription:*:*:* |
Tested Environment (Vulnerable)
| Field | Value |
|---|---|
| Product | SharePoint Server 2019 on Windows Server 2025 Standard 24H2 |
| Build (OS) | 26100.32860 |
| Architecture | x64 |
| SharePoint Farm Build | 16.0.10417.20128 |
| Binary | microsoft.office.policy.pages.dll |
| File Version | 16.0.10337.12109 |
| Size | 547,096 bytes |
| SHA256 | E7ECA49AB6485D0F4281420FD680A7DAD9418B86086773C47BB445A3BFF51CBA |
| Installed KBs | KB5002870 (May 2026 SharePoint) |
Tested Environment (Patched)
| Field | Value |
|---|---|
| Patch KB | KB5002874 (June 2026) |
| SharePoint Farm Build | 16.0.10417.20153 |
| Binary | microsoft.office.policy.pages.dll |
| File Version | 16.0.10417.20153 |
| Size | 541,544 bytes |
| SHA256 | D9A8905C02ED075D39753C06855DD699082175562E11EFD94C69BFCFC8C92614 |
| Note | The patched CurrentFolder property with ParentListId check was verified on SharePoint Server 2019. The traversal is blocked — files do not appear in the target library. |
Patch Matrix
SharePoint Server 2019
| Field | Vulnerable (KB5002870, May 2026) | Patched (KB5002874, June 2026) |
|---|---|---|
| DLL Version | 16.0.10337.12109 | 16.0.10417.20153 |
| DLL Size | 547,096 bytes | 541,544 bytes |
| DLL SHA256 | E7ECA49AB6485D0F4281420FD680A7DAD9418B86086773C47BB445A3BFF51CBA | D9A8905C02ED075D39753C06855DD699082175562E11EFD94C69BFCFC8C92614 |
| Farm Build | 16.0.10417.20128 | 16.0.10417.20153 |
SharePoint Server 2016
| Field | Vulnerable (KB5002868, May 2026) | Patched (KB5002880, June 2026) |
|---|---|---|
| DLL Version | 16.0.5535.1000 | 16.0.5556.1000 |
| DLL Size | 436,128 bytes | 436,992 bytes |
| DLL SHA256 | 79E3C4BA0D4EFA947C0ADFADE596A23E68EAF34D126AF68C80A76391DC634919 | AF038264188C71E02291D0116E90C34D5C621D4FEFDB32487C6F736B10196052 |
| Farm Build | 16.0.5552.1002 | 16.0.5556.1002 |
SharePoint Server Subscription Edition
| Field | Vulnerable (KB5002863, May 2026) | Patched (check MSRC advisory) |
|---|---|---|
| DLL Version | — | — |
5. Root Cause Analysis
5a. Detailed Description
SharePoint’s Upload.aspx page (code-behind: UploadPage in microsoft.office.policy.pages.dll) handles file uploads to document libraries. The page accepts two query string parameters:
List— GUID of the target document library (used for permission checks)RootFolder— Server-relative URL of the destination folder
The CurrentList property resolves the List parameter to an SPDocumentLibrary object. SharePoint checks that the current user has AddListItems permission on this library (via LayoutsPageBase.RightsRequired).
The CurrentFolder property resolves the RootFolder parameter to an SPFolder object via SPWeb.GetFolder():
// UploadPage.CurrentFolder (pre-patch)
// microsoft.office.policy.pages.dll 16.0.10337.12109 (SP2019) / 16.0.5535.1000 (SP2016)
protected SPFolder CurrentFolder
{
get
{
if (m_folder == null)
{
// RootFolder resolved via GetFolder -- NO ownership check
m_folder = PrivateWeb.GetFolder(CurrentFolderServerRelativeUrl);
}
return m_folder;
}
}
protected virtual string CurrentFolderServerRelativeUrl
{
get
{
if (m_folderUrl == null)
{
string value = SPRequestParameterUtility.GetValue<string>(
this.Request, "RootFolder"); // <-- user-controlled
if (!string.IsNullOrEmpty(value))
m_folderUrl = value;
else
m_folderUrl = CurrentList.RootFolder.ServerRelativeUrl;
}
return m_folderUrl;
}
}
The vulnerability is that GetFolder() resolves ANY valid folder URL on the site — it does not check that the folder belongs to the library specified by List. An attacker can set List to a library they have upload permissions on (passing the permission check) while setting RootFolder to a folder in a completely different library (redirecting the actual upload).
When OnSubmit() processes the file upload, it calls UploadFile() which adds the file to CurrentFolder.Files — the traversed folder, not the authorized library’s folder.
5b. Vulnerable Assembly and Call Stack
microsoft.office.policy.pages.dll 16.0.10337.12109 (SP2019) / 16.0.5535.1000 (SP2016):
// CurrentFolderServerRelativeUrl -- reads RootFolder from query string
// No validation that the folder belongs to CurrentList
string value = SPRequestParameterUtility.GetValue<string>(this.Request, "RootFolder");
if (!string.IsNullOrEmpty(value))
m_folderUrl = value; // attacker-controlled path
// CurrentFolder -- resolves the URL to any folder on the site
m_folder = PrivateWeb.GetFolder(CurrentFolderServerRelativeUrl);
// UploadFile -- adds file to the traversed folder
file = CurrentFolder.Files.Add(leafName, httpPostedFile.InputStream, val2);
Call Stack:
UploadPage.OnSubmit()
UploadPage.UploadFile()
UploadPage.UploadFile(HttpPostedFile, ...)
SPFolder.Files.Add() // file added to traversed folder
<- CurrentFolder // resolves RootFolder without ownership check
<- PrivateWeb.GetFolder(CurrentFolderServerRelativeUrl)
<- RootFolder query param (attacker-controlled)
5c. Fix (Patched Version)
The patch adds two validation checks to the CurrentFolder property getter:
// UploadPage.CurrentFolder (patched)
// microsoft.office.policy.pages.dll 16.0.10417.20153 (SP2019) / 16.0.5556.1000 (SP2016)
protected SPFolder CurrentFolder
{
get
{
if (m_folder == null)
{
// [NEW] Null list check
if (CurrentList == null)
{
// ULS tag 495502807
throw new ArgumentException(
"RootFolder parameter is being resolved but no target list is set.");
}
m_folder = PrivateWeb.GetFolder(CurrentFolderServerRelativeUrl);
// [NEW] Parent list ownership check
if (m_folder.ParentListId != CurrentList.ID)
{
// ULS tag 495502806: "Possible folder traversal attempt"
throw new ArgumentException(
"Possible folder traversal attempt.");
}
}
return m_folder;
}
}
| Vulnerable | Patched |
|---|---|
GetFolder(RootFolder) with no ownership check | GetFolder(RootFolder) followed by ParentListId == CurrentList.ID check |
Null CurrentList silently continues | Null CurrentList throws ArgumentException |
| No logging | ULS trace tags for traversal detection (495502806, 495502807) |
5d. Impact
The vulnerability has two tiers of impact:
Tier 1 — Unconditional: Arbitrary File Upload to Restricted Libraries. An authenticated attacker with Contribute permissions on any document library can upload arbitrary files to any other document library on the same SharePoint site, regardless of whether they have permissions on the target library. This was demonstrated by uploading a file with List pointing to “Documents” while RootFolder pointed to the Master Page Gallery — the file appeared in the Master Page Gallery.
Tier 2 — Conditional: Remote Code Execution via Webshell. When the SharePoint web application’s web.config includes a <PageParserPath> entry that enables AllowServerSideScript for /_catalogs/masterpage/* (a common configuration in production deployments with custom branding), the attacker can upload an ASPX webshell to the Master Page Gallery. SharePoint compiles and executes ASPX files from this location as server-side code, allowing the attacker to run arbitrary OS commands under the w3wp.exe application pool identity.
The RCE was confirmed on SharePoint Server 2019: whoami returned the application pool identity, and full command execution (hostname, ipconfig, etc.) was demonstrated.
5e. RCE Attack Chain
1. Attacker has Contribute on "Documents" library
2. GET Upload.aspx?List={Documents_GUID}&RootFolder=/_catalogs/masterpage
3. POST webshell.aspx to the same URL (traversal upload)
4. File lands in /_catalogs/masterpage/webshell.aspx
5. GET /_catalogs/masterpage/webshell.aspx?cmd=whoami
6. SharePoint compiles ASPX → server-side code execution
7. Output: application pool identity
SafeMode Considerations:
SharePoint’s SafeMode page parser blocks inline code blocks (<% %>, <script runat="server">) in pages stored in the content database by default. However:
- The
<%@ Assembly %>and<%@ Register %>directives are accepted on unpatched systems (the patch introducesBlockUnsafeDirectivesto restrict these). - Safe controls (e.g.,
asp:Label,DataFormWebPart) render and execute in SafeMode. - When
PageParserPathsis configured for/_catalogs/masterpage/*withAllowServerSideScript="true", full inline code execution is permitted. This configuration is common in SharePoint deployments that use custom master pages or branding.
6. Proof-of-Concept
6a. PoC Code
Download exploit_upload_traversal.py (enterprise email verification required)
| File | Description | Availability |
|---|---|---|
exploit_upload_traversal.py | Demonstrates the path traversal by uploading a file through one library’s permission context into a different library | Available now |
exploit_rce_masterpage.py | Extends the traversal to achieve RCE by uploading an ASPX webshell to the Master Page Gallery and executing OS commands | July 10, 2026 |
Responsible disclosure: The RCE proof-of-concept (
exploit_rce_masterpage.py) is being withheld for 30 days after patch release to give administrators time to apply KB5002874 / KB5002880. The path traversal PoC and the full technical description of the RCE chain (Sections 5d–5e) are available immediately to support detection and prioritization.
6b. Reproduce Instructions — Path Traversal
Prerequisites:
- SharePoint Server with vulnerable microsoft.office.policy.pages.dll (tested on SP2019)
- Two document libraries on the same SharePoint site (e.g., “Documents” and “Restricted Documents”)
- An authenticated user with Contribute permissions on the source library
- Python 3.10+ with
requestsandrequests_ntlm - Network access to SharePoint’s
/_layouts/15/Upload.aspx
Reproduction Steps:
Run the path traversal PoC:
uv run exploit_upload_traversal.py --target http://sharepoint.example.com --user DOMAIN\\user --password <pass>The script:
- Retrieves the GUID of “Documents” (source library)
- GETs
Upload.aspx?List={Docs_GUID}&RootFolder=/Restricted Documentsto extract form tokens - POSTs a file upload form to the same URL
- Verifies the file appeared in “Restricted Documents”
On vulnerable servers, the file
traversal_proof.txtappears in “Restricted Documents” despite theListparameter pointing to “Documents”.On patched servers, the upload fails with an
ArgumentException(“Possible folder traversal attempt”) and no file is created.
6c. Reproduce Instructions — Remote Code Execution
Additional Prerequisites:
- The SharePoint web application’s
web.configmust include:This is a common configuration for deployments using custom master pages.<PageParserPaths> <PageParserPath VirtualPath="/_catalogs/masterpage/*" CompilationMode="Always" AllowServerSideScript="true" IncludeSubFolders="true" /> </PageParserPaths>
Reproduction Steps:
Run the RCE PoC:
uv run exploit_rce_masterpage.py \ --target http://sharepoint.example.com \ --user DOMAIN\\user --password <pass> \ --source-lib Documents --payload canaryThe script:
- Uses the path traversal to upload an ASPX webshell to
/_catalogs/masterpage/ - Browses to the uploaded page to trigger server-side compilation
- Extracts server information (machine name, identity, process ID) or executes a command
- Uses the path traversal to upload an ASPX webshell to
For command execution:
uv run exploit_rce_masterpage.py \ --target http://sharepoint.example.com \ --user DOMAIN\\user --password <pass> \ --payload inline --cmd "whoami & hostname"
6d. Test Results
Path Traversal
| Metric | Vulnerable Server | Patched Server |
|---|---|---|
| HTTP response | 200 | 200 (error page) |
| File in target library | Yes (traversal_proof.txt) | No (0 files) |
| Error logged | None | “Possible folder traversal attempt” (ULS 495502806) |
Remote Code Execution (with PageParserPaths configured)
| Metric | Vulnerable Server | Patched Server |
|---|---|---|
Webshell uploaded to _catalogs/masterpage | Yes | No (traversal blocked) |
| Server-side code execution | Yes | N/A |
whoami output | Application pool identity | N/A |
| Execution context | w3wp.exe (app pool identity) | N/A |
6e. Patched System Verification
The same PoC was executed against SharePoint Server 2019 patched with KB5002874 (June 2026). The CurrentFolder property’s new ParentListId check detected the mismatch between the resolved folder’s parent list and the List parameter. The upload completed without error but the file did not appear in the target library. Zero files were created in the Master Page Gallery.
7. Detection
Note: The detection rules below are provided as a starting point. Validate and tune them in your own environment before deploying to production.
7a. Network-Based Detection
Signature-Based Detection
The attack is delivered via HTTP GET + POST to /_layouts/15/Upload.aspx. The distinctive pattern is a mismatch between the List and RootFolder query parameters: List contains a GUID for one library while RootFolder contains a path belonging to a different library. Detection can focus on RootFolder values that reference _catalogs/masterpage or other sensitive catalog paths.
Suricata Rules
# Detect SharePoint Upload.aspx traversal to Master Page Gallery (RCE vector)
alert http $EXTERNAL_NET any -> $HOME_NET any (msg:"CVE-2026-45454 SharePoint Upload Path Traversal to Master Page Gallery"; \
flow:to_server,established; \
content:"Upload.aspx"; http_uri; \
content:"List="; http_uri; \
content:"RootFolder="; http_uri; \
content:"_catalogs"; http_uri; \
reference:cve,2026-45454; \
classtype:web-application-attack; \
sid:2026454541; rev:2;)
# Detect SharePoint Upload.aspx with potentially mismatched List/RootFolder (broader)
alert http $EXTERNAL_NET any -> $HOME_NET any (msg:"CVE-2026-45454 SharePoint Upload Path Traversal - suspicious RootFolder"; \
flow:to_server,established; \
content:"Upload.aspx"; http_uri; \
content:"List="; http_uri; \
content:"RootFolder="; http_uri; \
pcre:"/RootFolder=[^&]*(?:\/[A-Z][^\/&]+)/Ui"; \
reference:cve,2026-45454; \
classtype:web-application-attack; \
sid:2026454542; rev:1;)
Byte Offset Reference (HTTP Request)
| Offset | Field | Notes |
|---|---|---|
| HTTP URI | /_layouts/15/Upload.aspx | Target endpoint |
| Query param | List={GUID} | Library GUID used for permission check |
| Query param | RootFolder=/path | Destination folder — if path does not belong to the List GUID’s library, traversal is occurring |
| HTTP Method | POST | File upload is a POST with multipart form data |
| POST body | ctl00$PlaceHolderMain$...InputFile | The uploaded file content |
7b. Host-Based Detection
Patch Verification
| Product | Vulnerable DLL Version | Patched DLL Version | Patch KB |
|---|---|---|---|
| SharePoint Server 2019 | 16.0.10337.12109 | 16.0.10417.20153 | KB5002874 |
| SharePoint Enterprise Server 2016 | 16.0.5535.1000 | 16.0.5556.1000 | KB5002880 |
| SharePoint Server Subscription Edition | Consult MSRC advisory | Consult MSRC advisory | Consult MSRC advisory |
Known Vulnerable Binary Hashes
| Product | SHA256 |
|---|---|
| SP2019 (16.0.10337.12109) | E7ECA49AB6485D0F4281420FD680A7DAD9418B86086773C47BB445A3BFF51CBA |
| SP2016 (16.0.5535.1000) | 79E3C4BA0D4EFA947C0ADFADE596A23E68EAF34D126AF68C80A76391DC634919 |
PowerShell — Check Binary Version
$dll = Get-Item "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\microsoft.office.policy.pages.dll" -ErrorAction SilentlyContinue
if ($dll) {
$ver = [Version]$dll.VersionInfo.FileVersion
$hash = (Get-FileHash $dll.FullName -Algorithm SHA256).Hash
Write-Host "File Version : $ver"
Write-Host "SHA256 : $hash"
# SP2019 threshold
if ($ver -ge [Version]"16.0.10000.0" -and $ver -lt [Version]"16.0.10417.20153") {
Write-Host "[!] VULNERABLE — SP2019 DLL predates KB5002874 fix" -ForegroundColor Red
}
# SP2016 threshold
elseif ($ver -lt [Version]"16.0.5556.1000" -and $ver -lt [Version]"16.0.10000.0") {
Write-Host "[!] VULNERABLE — SP2016 DLL predates KB5002880 fix" -ForegroundColor Red
}
else {
Write-Host "[*] Patched — file version is at or above the fix" -ForegroundColor Green
}
}
PowerShell — Check Installed KB
Get-HotFix -Id KB5002874,KB5002880 -ErrorAction SilentlyContinue |
Format-Table HotFixID, InstalledOn -AutoSize
ULS Log Monitoring (Post-Patch)
On patched servers, exploitation attempts are logged in the SharePoint ULS logs with these trace tags:
| ULS Tag | Message | Meaning |
|---|---|---|
| 495502806 | “Possible folder traversal attempt” | RootFolder resolved to a folder outside the specified List |
| 495502807 | “RootFolder parameter is being resolved but no target list is set” | Null CurrentList — malformed or tampered request |
Get-Content "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\LOGS\*.log" |
Select-String "49550280[67]"
8. References
| Source | URL |
|---|---|
| Microsoft Advisory | https://msrc.microsoft.com/update-guide/vulnerability/CVE-2026-45454 |
| MITRE CVE | https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-45454 |
| NVD | https://nvd.nist.gov/vuln/detail/CVE-2026-45454 |
| CVRF | https://api.msrc.microsoft.com/cvrf/2026-Jun |
| KB5002874 (SP2019 June 2026) | https://support.microsoft.com/help/5002874 |
| KB5002880 (SP2016 June 2026) | https://support.microsoft.com/help/5002880 |