Under certain circumstances, Microsoft Office 365 and Exchange Server allow access to attachments and images in emails without the need for authentication. In most cases it should be difficult to exploit this problem, but the reader L. Herzog writes to me that this problem could be exploited in his environment. L. Herzog described the problem to me and I was able to reproduce it with Office 365 and Exchange Server 2019 (latest updates). The problem was reported to Microsoft at the beginning of January, but it was not classified as critical or important. There is therefore currently no fix.
What is the problem?
The web version of Outlook (outlook.office.com) and OWA of an Exchange server generate a link for images in an email, which can be accessed without prior authentication. If you know the link, you can access images and attachments in an email. However, the links are only valid for approx. 10 minutes and can hardly be guessed, which is why Microsoft has probably classified the problem as a cosmetic defect rather than a security vulnerability. However, there are scenarios in which unauthorized access to images or attachments is possible. Here is an example so that the problem can be understood.
Ich habe mir eine Mail mit einem Bild geschickt und diese in der Webversion von Outlook geöffnet, dabei habe ich die Chrome Entwicklertools geöffnet. Unter dem Reiter Quellcode in den Entwicklertools taucht nun die Domain „attachments.office.net“ auf. Dies ist die Downloaddomain welche auch für Exchange Server konfiguriert werden sollte. Unter der Domain attachments.office.com finden sich nun die Links zu den Bildern in der E-Mail:
The link can now be copied and accessed on other computers without prior authentication. Here is an example of such a link:
https://attachments.office.net/owa/frank%40frankysweb.de/service.svc/s/GetAttachmentThumbnail?id=AAMkADhiOTBmNWY5LTJjZDYtNGUxOC1iY2I2LThjOTFkY2ViZDJmMABGAAAAAACqEuTD%2F84uQJlfTnDiiGALBwCPvJCIdcncRYIsgFJ3hL2WAAJfmVKcAACPvJCIdcncRYIsgFJ3hL2WAAJfmm5wAAABEgAQADiPQD5c74VDoe%2B%2B3g92WzE%3D&thumbnailType=2&token=eyJhbGciOiJSUzI1NiIsImtpZCI6IkU1RDJGMEY4REE5M0I2NzA5QzQzQTlFOEE2MTQzQzAzRDYyRjlBODAiLCJ0eXAiOiJKV1QiLCJ4NXQiOiI1ZEx3LU5xVHRuQ2NRNm5vcGhROEE5WXZtb0EifQ.eyJvcmlnaW4iOiJodHRwczovL291dGxvb2sub2ZmaWNlLmNvbSIsInVjIjoi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imO4r2E-HsoQOA6XVGZWYGrPkSdhLb32EBZgq0IblTfiItb1fPr7VTC4k9Vm4sYFtpjkrOu3PnOkE-UyLCgWjb9kpuOzAzB7vvURCuGL9AUl53Bjzh3YSDmmNvcO2xjEYVVA&X-OWA-CANARY=bdvoV4IHMRAAAAAAAAAAAFAoC4YFN9wYyMPHZpmfClg-YZZg6lISRIbwSQqv1QEttZFuKmS4x00.&owa=outlook.office.com&scriptVer=20240209002.20&clientId=10B3F6878DF34150B26E9D9E22FA37AC&animation=true
As you can see, the link is extremely long and cannot be easily guessed, but it can happen that such links appear in logs. And this is exactly where the problem lies.
How could this be exploited?
Eins vorweg: Ich teile hier durchaus die Einschätzung von Microsoft, dass es sich hier um keine Schwachstelle der Kategorie „Kritisch“ oder „Wichtig“ handelt. Um das Problem auszunutzen, muss man also an die Links kommen, damit man Bilder und auch Anhänge aus E-Mails ohne Authentifizierung runterladen kann. Dies ist aber gar nicht so einfach, denn es handelt sich hier ja um eine HTTPS Verbindung. Befinde ich mich beispielsweise in einem öffentlichen WLAN, dann wird in allen Logs maximal eine Verbindung zu der Domain attachments.office.net auftauchen, nicht aber der Link wie „https://attachments.office.net/owa/frank%40frankysweb.de/service.svc/s/GetAttachmentThumbnail?id=AAMkADhi….“ denn der komplette Link (außer die Domain) ist bei HTTPS Verbindungen schon verschlüsselt und nur für mich sichtbar.
An den kompletten Link würde man nur kommen, wenn die HTTPS Verbindung aufgebrochen wird (SSL Inspection, MitM), dies würde in öffentlichen Netzwerken aber zu einem SSL Fehler führen. In manchen Umgebungen könnte aber genau hier eine Möglichkeit liegen an die URLs zu kommen. Wird beispielsweise im Unternehmen eine Firewall mit SSL Inspektion eingesetzt, dann wird die komplette URL in den Logfiles sichtbar. Als interner Admin mit Zugriff auf die Logfiles könnte man sich mit einem kleinen Script einfach alles was mit „https://attachments.office.net/owa“ beginnt runterladen und sich später in Ruhe anschauen. Anhand der URL ist auch erkennbar, wer der Empfänger des Anhangs oder Bilds ist: https://attachments.office.net/owa/frank%40frankysweb.de/
The generated links are only valid for a good 10 minutes, after which only an HTTP 401 is delivered.
Where could the lack of authentication become a problem?
I think it is undisputed that this problem should be fixed, even if it has not been classified as critical or important. In public networks, the problem can probably only be exploited by using MitM to connect to the HTTPS connection. This would lead to an SSL error, but the user may simply click the message away. In this case, however, the problem described here no longer needs to be exploited, as the entire traffic could now be recorded anyway (not just images and attachments, but complete emails and possibly also login data).
In a company, however, the situation is somewhat different, as there could be several places where the URLs are visible. For example, some virus scanners log the URLs accessed in the log files and report them to the management server. Some XDR systems or browser plugins also log the URLs accessed. Reader L. Herzog was able to extract the URLs from the logs of Sophos Intercept-X and the Central Data Lake, for example, so that the team that administers the endpoint antivirus would also have anonymous access to the images and file attachments of all employees in the company that were displayed in OWA. Although there are no Exchange admins in this team.
Since the URLs do not require authentication, no 2FA or MFA solution is effective here and unauthorized access should be very difficult to detect.
Ihr könnt euch ja mal den Spaß machen und in euren Logs nach „attachments.office.net“ oder alternativ der Exchange on-Prem Download Domain suchen. Vielleicht findet ihr da ja auch was.
Many thanks to L. Herzog for reporting the problem and for the pleasant e-mail correspondence.