|
| 1 | +--- |
| 2 | +title: Disclosure of potential remote code execution due to bug in miniupnpc (≤ version 0.11.1) |
| 3 | +name: blog-disclose-upnp-rce |
| 4 | +id: en-blog-disclose-upnp-rce |
| 5 | +lang: en |
| 6 | +type: advisory |
| 7 | +layout: post |
| 8 | + |
| 9 | +## If this is a new post, reset this counter to 1. |
| 10 | +version: 1 |
| 11 | + |
| 12 | +## Only true if release announcement or security annoucement. English posts only |
| 13 | +announcement: 1 |
| 14 | + |
| 15 | +excerpt: > |
| 16 | + Public disclosure of a buffer overflow in miniupnpc which could have led to a remote code execution in Bitcoin Core. |
| 17 | +--- |
| 18 | + |
| 19 | +A buffer overflow enabling a significant data leak was discovered in `miniupnpc`. Combined with the then |
| 20 | +recently-disclosed CVE-2015-6031 it enabled an RCE in `miniupnpc` which could have led to an RCE |
| 21 | +in Bitcoin Core. This was fixed in [Bitcoin Core 0.12](https://bitcoincore.org/en/releases/0.12.0/), |
| 22 | +released in February 2016. |
| 23 | + |
| 24 | +This issue is considered **Medium** severity. |
| 25 | + |
| 26 | +## Details |
| 27 | + |
| 28 | +[CVE-2015-6031](https://nvd.nist.gov/vuln/detail/CVE-2015-6031), disclosed in September 2015, made |
| 29 | +it possible for a malicious UPnP server to remotely crash a Bitcoin Core process on the local |
| 30 | +network at startup. See [here](https://nvd.nist.gov/vuln/detail/CVE-2015-6031) for details. The fix |
| 31 | +was [pulled in Bitcoin Core](https://github.com/bitcoin/bitcoin/pull/6789) and released in [version |
| 32 | +0.11.1](https://bitcoincore.org/en/releases/0.11.1/), released in October 2015. UPnP was then |
| 33 | +[turned off by default](https://github.com/bitcoin/bitcoin/pull/6795). |
| 34 | + |
| 35 | +CVE-2015-6031 disclosed a buffer overflow, which in addition to enabling a remote crash could have |
| 36 | +made it possible to remotely execute code on a victim's machine. While investigating this |
| 37 | +possibility, Wladimir J. Van Der Laan found another buffer overflow in `miniupnpc` which enabled a |
| 38 | +significant data leak. This was [fixed by Wladimir in |
| 39 | +`miniupnpc`](https://github.com/miniupnp/miniupnp/pull/157) in commit |
| 40 | +`4c90b87ce3d2517097880279e8c3daa7731100e6`. The fix was then [pulled into Bitcoin |
| 41 | +Core](https://github.com/bitcoin/bitcoin/pull/6980) and released as part of version 0.12. |
| 42 | + |
| 43 | +This data leak did not disclose secret information (such as the wallet's private keys) directly. But |
| 44 | +combined with another stack overflow (such as the one disclosed in CVE-2015-6031) this made it |
| 45 | +possible to trigger a remote code execution. Wladimir demonstrated this against Ubuntu's `miniupnpc` |
| 46 | +version `1.6-precise`. The specific approach used in this exploit was however not directly portable |
| 47 | +to Bitcoin Core. |
| 48 | + |
| 49 | +## Attribution |
| 50 | + |
| 51 | +Credits go to Aleksandar Nikolic for identifying CVE-2015-0035 and to Wladimir J. Van Der Laan for |
| 52 | +investigating its impact and discovering the second buffer overflow. |
| 53 | + |
| 54 | +## Timeline |
| 55 | + |
| 56 | +- 2015-09-15 CVE-2015-0035 is |
| 57 | + [fixed](https://github.com/miniupnp/miniupnp/commit/79cca974a4c2ab1199786732a67ff6d898051b78) and |
| 58 | + [disclosed](https://talosintelligence.com/vulnerability_reports/TALOS-2015-0035/). |
| 59 | +- 2015-10-09 [PR #6789](https://github.com/bitcoin/bitcoin/pull/6789) is merged in Bitcoin Core |
| 60 | +- 2015-10-14 Wladimir's remote code execution by leveraging the second buffer overflow is disclosed |
| 61 | + to Ubuntu security and Bitcoin developers. |
| 62 | +- 2015-10-15 Bitcoin Core 0.11.1 [is |
| 63 | + released](https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2015-October/011545.html) |
| 64 | +- 2015-10-26 The fix for the second buffer overflow [is |
| 65 | + merged](https://github.com/miniupnp/miniupnp/pull/157) into `miniupnpc`. |
| 66 | +- 2015-12-18 The fix is [pulled into Bitcoin Core](https://github.com/bitcoin/bitcoin/pull/6980). |
| 67 | +- 2016-02-23 Bitcoin Core version 0.12 [is |
| 68 | + released](https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2016-February/012456.html). |
| 69 | +- 2017-03-08 The last vulnerable Bitcoin Core Version (0.11.x) goes EOL |
| 70 | +- 2024-07-03 Public disclosure |
| 71 | + |
| 72 | +{% include references.md %} |
0 commit comments