Memory leak bug and new Toxcore release fixing it

A memory leak bug was discovered in Toxcore that can be triggered remotely to exhaust one’s system memory, resulting in a denial of service attack. The bug is present in the TCP Server module of Toxcore and therefore it affects mostly bootstrap nodes. Regular Tox clients generally have the TCP Server functionality disabled by default, leaving them unaffected.

The bug was introduced on July 15th, 2014 in commit 22d28ddf36563e2d0018fc20cafdfe61278dd67f, making all previous versions of TokTok c-toxcore and irungentoo’s toxcore vulnerable.

The bug is fixed in TokTok c-toxcore v0.2.8. The bug is also fixed in the master branch of irungentoo’s toxcore, in commit bf69b54f64003d160d759068f4816b2d9b2e1e21. As a general reminder, if you are still using irungentoo’s toxcore, we strongly encourage you to switch to using TokTok c-toxcore instead as it’s a lot more actively developed and maintained. In fact, irungentoo’s toxcore is neither being developed nor maintained for some time now, aside from merging only the most critical fixes from TokTok c-toxcore from time to time, missing all other important fixes.

If you are using TokTok c-toxcore v0.2.8, you should be unaffected by this bug.

If you are using an older Toxcore, for example a client you use didn’t release an update, make sure that you have the TCP Server functionality disabled in the client settings and you should be unaffected. Some clients, like qTox v1.16.3 and uTox v0.16.1, don’t provide the user with an option to enable the TCP Server, having it always disabled, and other clients, like Toxic v0.8.2, do provide the TCP Server option, but it’s disabled by default. Note that it’s possible that some other clients have the TCP Server option enabled by default.

If you are running a bootstrap node, we strongly encourage you to update to TokTok c-toxcore v0.2.8 rather than disable the TCP Server option. In fact, we will be making Toxcore v0.2.8 the minimal required version for all of the nodes on our bootstrap node list. TCP relay functionality is very useful for mobile users and those behind restrictive NATs, and given that it’s mostly bootstrap nodes that act as TCP relay servers, as clients generally have that option disabled, even a few of those nodes disabling TCP Server functionality would reduce the number of TCP relay servers Tox clients can use considerably.

ToxCon 2018 Update

ToxCon 2018 Info

As promised, here is more information on ToxCon 2018.

Tox developer community will be holding the conference from Friday, October 12th, to Sunday, October 14th — a 3 day event, at Metalab Vienna, a hackerspace located in the heart of Vienna, Austria. We have many talks prepared for you: from the progress Tox has made in the last 12 months, to security-related and other interesting topics. The the full schedule of the event is available online and there is also an Android app that you can use to get updates if more talks get added.

If you would like to learn more about Tox, meet the developers, do some live hacking, or just socialize, then this is the event for you. The tickets are free and you have an option to buy a sponsored ticket or a ToxCon T-shirt. All money from the sponsored tickets and the T-shirt sales will go towards a dinner for the speakers, and, if there is money left, T-shirts to give away.

For questions about booking, travel arrangements, talks, or anything related to the event feel free to join the #toxcon2018 IRC channel on Freenode and contact one of the event organizers: robinli, sudden6 or zoff99.

ToxCon 2018

ToxCon 2018 Poster

In October the Tox developer community will be holding a conference in Vienna. Join us as we talk about the progress we have made during the last 12 months with Tox and other security related topics. There will be lots of talks and other cool things to see.

For more details join the #toxcon2018 IRC channel on Freenode and contact robinli, sudden6 or zoff99.

More information will be revealed in a future post.

Security vulnerability and new Toxcore release

A vulnerability was discovered in Toxcore that allows one to learn the IP of a target user by only knowing their Tox Id and without being friends with the target user.

The Tox protocol is designed in such a way that only friends (contacts) which you have accepted friend requests of are able to learn your IP based on your Tox Id and no one else. Thus, being able to learn the IP of an owner of a Tox Id without them accepting a friend request is an undesired behavior.

This is a vulnerability in an implementation of the Tox protocol, a vulnerability in the Toxcore library, not in the Tox protocol itself.

The vulnerability affects both TokTok’s c-toxcore and irungentoo’s toxcore. The vulnerability affects only UDP mode of operation. TCP-only mode is not affected by the vulnerability.

TokTok’s c-toxcore has patched the vulnerability in version 0.2.2. irungentoo’s toxcore doesn’t have the vulnerability patched as of this moment and it’s unknown if it ever will, as it hasn’t been actively maintained for years. irungentoo’s toxcore was patched after this post was written.

The vulnerability was privately reported to us by Evgeny Kurnevsky on April 14th and publicly disclosed with our permission on April 15th, along with a patch fixing the vulnerability, made by Evgeny Kurnevsky. The vulnerability was found when Evgeny was working on tox-rs project – a Tox implementation in Rust.

We urge everyone to update to the latest TokTok c-toxcore as soon as possible. You can immediately mitigate the vulnerability for yourself by using TCP-only mode.

Due to the nature of the vulnerability, using Toxcore in which the vulnerability is patched is not enough to protect yourself. The way the patch works is that it can’t protect you from the vulnerability but it can and does protect other peers. So in order to be protected from the vulnerability, everyone should switch to using the patched Toxcore. The more people use the patched Toxcore, the less is the chance to be vulnerable. Note that this applies only to the UDP mode. If you use the TCP-only mode, you are fully protected as you are not affected by the vulnerability.

Details of the vulnerability

Here are the technical details of the vulnerability.

The vulnerability is caused by the Onion module of Toxcore erroneously allowing to onion-route any data, any Tox packets, without a restriction. By the Tox protocol specification, when Alice makes an onion-routed request to Bob and then Bob sends an onion-routed response back to Alice, the payload of the onion-routed response sent by Bob arrives to Alice as it is, stripped of any identification that it was ever onion-routed by the last onion hop, and is interpreted as a regular Tox packet by Alice. Alice has no way to distinguish onion and non-onion packets — she has no idea if the packet originated from the node it received the packet from, or if the packet was relayed on someone else’s behalf as part of an onion-routing. The way the onion routing is defined in the Tox specification and Toxcore erroneously not restricting the packets that can be onion-routed allows for some interesting interactions that weren’t meant to happen.

One of the packets that are onion-routed is the Announce Request packet. It’s used to announce ourselves to nodes close to our long term public key, the one that is a part of Tox Id, and the payload of that packet includes the long term public key itself. Let’s say Alice announces herself to a bunch of nodes, one of which happened to be Bob. (If Bob is malicious, he can purposefully keep re-generating his DHT keypair until his public key becomes close to Alice’s long term public key as to guarantee Alice announcing to him.) Based on the Announce Request packet, Bob now knows Alice’s long term public key and has a way to contact her back though the established onion path. If Bob is malicious, he could spawn many new DHT nodes, and send back to Alice a NAT Ping Request packet for one of its newly created nodes. The NAT Ping Request packet is used to ping a node on someone else’s behalf in order to circumvent the NAT. The NAT Ping Request is not meant to be onion routed. Alice will receive the NAT Ping Request packet and will diligently relay it to the Bob’s DHT node if it happened to be in Alice’s Close List of nodes, which will happen only if the DHT public key of Bob’s node is close to the DHT public key of Alice’s node. Bob doesn’t know Alice’s DHT public key, so Bob will have to make a guess. If Bob makes a bad guess and Alice doesn’t relay the packet to his node, Bob can re-try by sending the NAT Ping Request packet to Alice for a new DHT node, repeating this process as many times as he wants. Eventually Bob’s DHT node will have public key close to Alice’s DHT public key and end up in Alice’s Close Nodes list, making Alice relay the NAT Ping Request packet to it, unknowingly disclosing her IP to Bob. Now Bob knows both Alice’s long term public key and her IP without being friends with her.

What the patch does is make all nodes in the onion path check if the payload of the onion-routed response is a packet kind that shouldn’t be routed through the onion, and if so drop it. It also makes the node closest to the destination of the onion-routed request, which is the only node in the onion path of the onion-routed request that can see which packet kind is sent to the destination node, drop the onion-routed request if it has a packet kind that shouldn’t be routed through the onion. The latter doesn’t matter much as Alice can’t exploit Bob in any way by onion-routing him packets that are not supposed to be onion routed, it’s done more for data sanitization reasons.

Because there are only 3 nodes in the onion path, the source and destination excluded, the patch protects you as long as at least one of the three is using the patched Toxcore.

This vulnerability affects only the UDP mode. In TCP-only mode the Onion module restricts which Tox packets are onion-routed correctly, and the Tox protocol specification is written in such a way that nodes using TCP-only mode can distinguish between onion and non-onion packets. So all of the above applies only to the UDP mode.

Toxcore v0.2.0 released

We are happy to announce the release of Toxcore v0.2.0. Download the tarballs, verify the signatures and read the changelog on Toxcore’s GitHub Releases page.

Some of the notable changes in this release are: fix for large video frame corruption [1], removal of libtoxdns [2], small API breaking changes in tox.h, toxav.h and toxencryptsave.h [3], [4], [5], [6], [7], [8], API deprecation notices for APIs that will get removed in v0.3.0 [9], and a build script change that results in a single big libtoxcore library being built, instead of separate libtoxcore, libtoxav and libtoxencryptsave like it was before [10]. One of the changes that we hoped would get in v0.2.0 but it didn’t was persistent group chats, but with how things are going it’s set to be added in one of the v0.2.x releases.

Some clients already have support for Toxcore v0.2.0, for example Toxic v0.8.2 and qTox master, while other clients are working on adding the support.

Shutdown of the Debian and Ubuntu package repository

I’m sad to announce this, but we have to shut down the Debian and Ubuntu package repository due to it being unmaintained and thus having outdated or even possibly broken packages. It has been several months since our last package maintainer maintained any packages and our search for a new package maintainer didn’t result in anything. The package repository is planned to be shut down sometime in the first half of March. The package repository might return in the future if there would be enough people willing to maintain it, but for now we have no choice but to close it.

Contributors wanted

It’s common knowledge that any open source project wouldn’t mind having more contributors and Tox is not an exception. This blog post is for those who want to contribute but don’t know where to start.

Starting contributing to Tox is as easy as joining #toktok channel on Freenode IRC, which is where majority of the development discussion takes place, and asking what part of Tox would benefit the most given your skill set and interests, unless you already have an idea which part of Tox you would like to help with. Just note that it might take some time for you to get a reply as not everyone is always in the chat, so please be patient. Many Tox developers and community members are connected to the chat 24/7 but get on it only in their free time. Mailing list might sound more appropriate for such possibly asynchronous discussions, and we do have a mailing list, but it doesn’t seem to catch on among developers much, so you will get better response on IRC.

Here is a non-exhaustive list of things you could help with, just to give an idea.

Non-programming

You don’t have to know programming in order to help. You can help by testing nightly builds of clients and translating clients to different languages.

Testing clients

You can help by testing nightly builds of Tox clients, the in-development, yet to be released, versions of clients, and reporting any problems you encounter to the developers. Testing nightly builds can help to find bugs and get them fixed before a release is made. Some clients don’t have nightly builds available for testing, or they do but they are not well maintained and might be broken. If this is the case for a client you want to test, simply asking developers for nightlies should resolve this issue. Also, even if the client you test is non-nightly, your testing is still useful. Just make sure that you are testing the latest release version of the client, as any issues you encounter might have been fixed in a newer version. You can get a client to test from the Download page of our website. You can provide feedback to the client developers by opening an issue in the client’s issue tracker, which is generally located on the client’s repository page. When reporting feedback, especially bugs, is a good idea to provide as much information to the developers as possible: operating system you are running and the version of it, the version of the Tox client you are running, exact steps on to how to reproduce the issue you are having and what you have expected to happen instead when you took those steps.

Translating clients

Some of the clients support multiple languages in their user interface, you can help translate the user interface to any language you know and correct existing translations if you find them unsatisfactory.

Here are links for some of clients:

Programming-related

Software development

Anyone with programming background is welcome, as we have quite diverse codebases. We could use help of people familiar with any of C, C++, Go, Haskell, Java, Python, Rust, Scala, Swift and other. Familiarity with networking, peer-to-peer software design, distributed hash table, cryptography and writing secure code is preferred, but not required for all of the codebases we have. You can help with an existing software project or start a new project of your own that would be useful to Tox. Also, you don’t have to write code to contribute. Reviewing the code that is considered for merging into the codebase is also a great way to help.

Website development

We are in need of a website developer/designer or anyone familiar with HTML, CSS, Bootstrap, Jinja 2 templates and Python. The person currently maintaining the website is more of a C++ developer than a web developer, so while they keep the information on the website up-to-date, doing more involved changes, like changing the page layout, is something that is hard for them. The Tox website doesn’t use anything fancy, we try to keep it as simple as possible: it’s a static page website which uses Jinja2 template engine and Python for page generation. We limit the use of JavaScript to the point that the website is perfectly functional without it while enabling it adds optional enhancements.

Packaging

We are in need of package maintainers (to the point that we don’t have packages for Ubuntu 17.10 (Artful) at all), anyone familiar with shell scripting, building software, debugging and fixing failed builds and creating packages is welcome. We maintain Debian and Ubuntu package repositories, with packages being created using pbuilder, so familiarity with pbuilder helps.

Join #toktok and become a contributor today!

Update on Toxcore and the upcoming breaking version

Hello everyone! Time flies fast, we spent all of 2017 without any status update, so a blog post is due, especially given that we are about to hit a new milestone and introduce some breaking changes.

Since our last blog post about Toxcore getting a stable version release, version 0.1.0, Toxcore has seen eleven more releases, which brings it to the version 0.1.11. Some of the notable changes in these releases include: (a little) reduction of bandwidth usage [1], [2], fix of issues related to reconnecting [3], improvement of LAN discovery [4], ability to disable LAN discovery [5], fix of the read receipts sometimes never arriving [6], reduced video corruption [7] and better support of the FreeBSD platform [8], [9], [10], [11], [12] and the Microsoft Visual C++ compiler [13], [14], [15], [16]. Aside from these, there were also many other bug fixes and code maintainability improvements.

The next Toxcore release that is planned after 0.1.11 is 0.2.0. Toxcore versioning scheme follows that of Semantic Versioning with x.y.z versions with leading zeros being stripped, meaning that 0.1.0 has the same API promise as 1.0.0. Which means that 0.2.0 will be a breaking release, it will break the compatibility with 0.1.x versions. Some of the breaking changes planned for 0.2.0 include: removal of the toxdns library [17], building resulting in just a single Toxcore library file containing all sublibraries’ code [18] and toxencryptsave library’s API breakage [19]. Other breaking changes might be added as the work on 0.2.0 release goes on.

It’s worth to note that since our last Toxcore blog post the adoption of the TokTok Toxcore fork of the original Toxcore has been going well and all of the actively maintained clients have switched to using it as their Toxcore library.

That’s all with updates on Toxcore.

As usual, happy Toxing!

Bug in musl-libc discovered, affecting the fully static Toxic builds

We advise everyone using the fully static Toxic builds that are listed on our download page to update them to the newest version by re-downloading them from that page. Those Toxic builds use musl-libc and there was a fairly serious bug discovered in musl-libc (CVE-2017-15650) and patched yesterday . The new Toxic builds include this patch. This affects only the fully static Toxic builds, no other builds currently use musl-libc.

First Stable Release of TokTok Toxcore

Good news everyone!

The first stable version of TokTok Toxcore, 0.1.0, got released. This release will be API compatible with other 0.1.x releases, until 0.2.0 is released, which will break the API.

This marks the first stable release of TokTok Toxcore and is an exciting milestone on the road to future Toxcore improvements.

The packages of TokTok Toxcore are now available in the stable and nightly streams on pkg.tox.chat.

Most clients are switching to using TokTok Toxcore as their Toxcore library. Antidote and ┬ÁTox clients already use TokTok Toxcore, qTox has gained support for TokTok Toxcore and will use it in the next release, and Antox and Toxic are in the process of gaining support for TokTok Toxcore.

Thanks to iphy, grayhatter, nurupo and others for their hard work on Toxcore, as well as thanks to Encrypt for the work on packaging it.

TokTok Toxcore version follows the rules of Semantic Versioning. The API promise of x.y.z version is defined to be the same as the Semantic Versioning API promise of x.y.z with leading zeros stripped, meaning 0.1.0 has the same API promise as 1.0.0.

While we were being excited with the 0.1.0 release, TokTok Toxcore has already released 0.1.1 version. The current release cycle of patch versions is approximately one per week, so they keep incrementing relatively fast.

Happy Toxing!