Missing memory corruption protection on Windows release built
The Windows desktop client was built without ASLR and DEP memory-corruption protections, despite a prior code change intended to enable them. An attacker who finds a separate memory-corruption vulnerability could exploit it more easily because these mitigations are absent.
Originally disclosed on HackerOne
- Triaged in 4 hours
- Fixed in 2.1 years
- Paid in 12 months
- Disclosed after 2.1 years
Hi, we have noticed that the Windows Desktop Client doesn't enable the protections ASLR and DEP (and others). These protections are per-default enabled since approximately 10 years in Visual Studio and are very important because they make exploitation a lot harder (or even make some vulnerabilities not exploitable).
Please note: The Nextcloud code was updated on 4 September 2017 to enable ASLR and DEP. Here is the commit: https://github.com/nextcloud/desktop/commit/6f270a364895d7f1f0a424c8347cd2913971cca4#diff-95e351a3805a1dafa85bf20b81d086e6
However, the current NextCloud Client (version 2.3.3.1) from 20 November 2017 from revision 57bc79 still doesn't have ASLR and DEP enabled. Here is the revision (where ASLR/DEP is also not enabled in the CMakeLists.txt file: https://github.com/owncloud/client/commit/57bc7918d7b0650c116f3512787f7677d4e5ab17
Attached is a detailed description of the issue.
Impact
An attacker has to find an additional vulnerability to exploit the missing memory corruption protections. For example, an attacker can search for a buffer overflow, use-after-free, type-confusion, ... vulnerability in the network communication and send a malicious payload / file from his Nextcloud server. This vulnerability must not exist in the Nextcloud source code, for example, vulnerabilities in QT or other third-party libraries can also be used. For example, the current Nextcloud version uses QT 5.6.2 which was released on 11-Oct-2016. On 19-Oct-2016 a heap buffer overflow was found in QJsonDocument: https://www.peter.hartmann.tk/single-post/2016/11/29/Fuzzing-Qt-with-libFuzzer
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the build configuration did not actually apply the ASLR and DEP compiler/linker flags for the Windows release build, despite an earlier commit that was meant to enable them.
Impact
An attacker would still need to find a separate memory-corruption vulnerability, but the missing protections could make such a flaw easier to exploit.
What the attacker needed
Windows desktop client; separate memory-corruption bug
The fix
The build configuration should be corrected so that ASLR and DEP are enabled in the Windows release build.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
ASLR and DEP are safety features built into Windows programs that make it much harder for an attacker to turn a bug into a working attack. This report says the Nextcloud desktop app for Windows was built without them, so if someone found a separate memory bug, it would be easier to exploit.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.