Menu

How I found an XXE in a multi-tenant cloud platform through a translation file upload

DEV Community: bugbounty·Simon Köck·6 months ago
#MZ2Z4Stl
#dev#class#tolgee#translation#file
Reading 0:00
15s threshold

Tolgee is an open-source localization platform. Teams upload translation files in formats like Android XML, XLIFF, .resx, and Apple stringsdict. Every one of those formats is XML.

When I see an app that parses user-uploaded XML server-side, the first thing I check is whether the parser disables external entity resolution. In Java, XMLInputFactory and DocumentBuilderFactory ship with dangerous defaults: external entities are enabled out of the box.

I cloned the repo and grepped for those two classes. Six results. None of them had any security configuration.

The exploit is simple. Upload an Android XML translation file like this:

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE resources [ <!ENTITY xxe SYSTEM "file:///etc/passwd"> ]> <resources> <string name= "test_key" > &xxe; </string> </resources>

The parser resolves &xxe;, reads /etc/passwd, and returns the contents as the translation value. I confirmed this on Tolgee's own cloud platform at app.tolgee.io.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.