Microsoft Exchange Authenticated Arbitrary File Read via EWS Reference Attachment (CVE-2026-45504)
by Batuhan Er (@int20z) · 2026-07-05
- Severity
- High
- CVE
- CVE-2026-45504
- Category
- web
- Affected product
- Microsoft Exchange Server (OWA / EWS)
- Affected versions
- Per source repository (script targets Exchange2016 SOAP schema)
- Disclosed
- 2026-07-05
- Patch status
- patched
References
Archive entry
intelseclab/poc-archiveMetadata
| Field | Value |
|---|---|
| Date Added | 2026-07-05 |
| Last Updated | 2026-07 |
| Author / Researcher | Batuhan Er (@int20z) |
| CVE / Advisory | CVE-2026-45504 |
| Category | web |
| Severity | High |
| CVSS Score | Not specified in source |
| Status | PoC |
| Tags | exchange, owa, ews, file-read, ssrf, ntlm, soap, lfi |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | Microsoft Exchange Server (OWA / EWS) |
| Versions Affected | Per source repository (script targets Exchange2016 SOAP schema) |
| Language / Platform | Python 3 |
| Authentication Required | Yes (valid Exchange/OWA domain credentials via NTLM) |
| Network Access Required | Yes |
Summary
CVE-2026-45504 is an authenticated arbitrary file read vulnerability in Microsoft Exchange Server. An attacker with valid mailbox credentials authenticates to OWA and, via the Exchange Web Services (EWS) CreateItem/CreateAttachment SOAP calls, creates a message with a ReferenceAttachment of ProviderType OneDrivePro whose AttachLongPathName and ProviderEndpointUrl point at an attacker-controlled HTTP callback server. That callback server responds with a crafted XML metadata document declaring a file:/// WebApplicationUrl, causing the Exchange server to resolve and read the referenced local file when the client requests GetAttachmentPreview via the owa/service.svc endpoint. The returned attachment preview content is the raw contents of the target file on the Exchange server’s filesystem.
Vulnerability Details
Root Cause
Exchange’s EWS ReferenceAttachment / OneDrivePro attachment-provider flow trusts a remote metadata endpoint (controlled by the requester) to supply the actual resource location (WebApplicationUrl). Because this URL is not restricted to http(s):// schemes/expected provider hosts, an attacker-hosted metadata server can supply a file:/// URI, causing the Exchange server-side attachment-preview handler to open and return the contents of an arbitrary local file when the OWA client later requests a preview of that attachment.
Attack Vector
- Authenticate to OWA (
/owa/auth.owa) with valid domain credentials to obtain a session and anti-CSRF “canary” token. - Stand up a local attacker-controlled HTTP callback server that answers any GET with an XML document declaring
d:WebApplicationUrlasfile:///<target-file-path>#. - Via EWS SOAP (
/ews/exchange.asmx), callCreateItemto create a draft message, thenCreateAttachmentwith aReferenceAttachmentofProviderType=OneDriveProwhoseAttachLongPathName/ProviderEndpointUrlpoint to the attacker’s callback server. - Request
GetAttachmentPreviewfor the resulting attachment ID via/owa/service.svc, using the session cookie andX-OWA-CANARYheader. - The Exchange server fetches metadata from the attacker’s callback, resolves the declared
file://path, and returns the target file’s contents in the preview response.
Impact
An authenticated attacker (any valid mailbox user) can read arbitrary files from the Exchange server’s local filesystem (e.g., configuration files, web.config, private keys, or OS files such as hosts), which can lead to further compromise (credential/secret disclosure, privilege escalation, or full server compromise depending on the file contents accessible).
Environment / Lab Setup
Target: Microsoft Exchange Server (OWA + EWS enabled), reachable at https://<exchange-host>
Attacker tooling: Python 3 with `requests` and `requests_ntlm` installed
Attacker requires: a routable IP/port reachable by the Exchange server for the callback HTTP listener
Valid domain\user credentials with OWA mailbox access
Proof of Concept
PoC Script
See
CVE-2026-45504.pyin this folder.
| |
Running this logs into OWA, spins up a local callback HTTP server, creates a draft message with a malicious ReferenceAttachment via EWS, then requests the attachment preview, printing the contents of the specified target file read from the Exchange server.
Detection & Indicators of Compromise
- EWS/OWA logs showing CreateItem/CreateAttachment SOAP calls with ReferenceAttachment / ProviderType=OneDrivePro
- Outbound HTTP requests from the Exchange server to unexpected/external attacker-controlled IPs shortly after CreateAttachment calls
- owa/service.svc requests with action=GetAttachmentPreview immediately following unusual EWS attachment creation
- Draft messages with attachment names like "doc.docx" referencing non-standard ProviderEndpointUrl values
Signs of compromise:
- Unexpected outbound connections from the Exchange server to unknown external hosts/ports.
- Draft/sent items containing reference attachments pointing to unfamiliar external URLs.
- Anomalous
GetAttachmentPreviewactivity correlated with sensitive file paths in logs.
Remediation
| Action | Detail |
|---|---|
| Primary fix | Apply the vendor security update addressing CVE-2026-45504 for Microsoft Exchange Server. |
| Interim mitigation | Restrict/monitor outbound network access from Exchange servers, disable or tightly scope ReferenceAttachment/OneDrivePro provider support if not required, and enforce least-privilege OWA/EWS access. |
References
Notes
Mirrored from https://github.com/hawktrace/CVE-2026-45504 on 2026-07-05.
| |