Security growing pains

Update: The issue mentioned in this blog post was assigned CVE-2017-1000051 by Distributed Weakness Filing, thanks Martin Gubri for applying for the number.

To sum things up:

  1. Martin Gubri volunteered to help us with security testing and found multiple XSS vulnerabilities
  2. We learned things and improved our security in multiple ways and we have plans to build even further improvements
  3. Update all the things

Exactly what happened

Late Tuesday night after work, I got an email from Martin Gubri telling me that he had found multiple XSS vulnerabilities in CryptPad. This is not fun news for anybody, but as the browser stores encryption keys, it is especially bad news. I want to reiterate what I said in our first blog post, CryptPad is just a regular web app but with provable ethics, it is not designed to provide military grade security.

Though we could have waited until our next release to fix this issue, we decided that we could not feel good working on new features while knowing about an issue which could harm our users. However, we wanted to fix the systemic issue which caused XSS to be possible in the first place, not just the symptoms which we became aware of.

CryptPad uses a modern web feature called Content Security Policy to prevent attacks such as this one. Content Security Policy allows a web server to mandate that javascript can only be loaded from domains which are explicitly authorized. Unfortunately, CKEditor makes heavy usage of inline scripts (scripts which are written directly into the HTML file), so we had made an exception for inline script which represents the most common type of XSS. When Martin did a review of our application, he found multiple places where we had not been properly escaping HTML content and sadly all of these were attackable despite our Content Security Policy.

How we reacted

For me, a security bug does not come alone, it is always the result of multiple failures at different levels. Zero Knowledge is about resilient software for resilient society and we allowed ourselves to rely entirely on proper escaping.

On Thursday, March 6th, 2017, we deployed and released a set of patches to our previous Bunyip release, which we’re calling 1.1.1 Bunyip’s Revenge. This not only sanitizes XSS in places where we know about but it also implements a strong Content Security Policy everywhere except inside of the CKEditor iframe, which insists on injecting script tags.

It is important to upgrade as soon as possible because XSS attacks can potentially give an adversary access to all of your pads. If you’re using cryptpad.fr on the website then there’s nothing you need to do, everything is fixed.

Moving forward

We want to find and pioneer better ways of protecting your data on CryptPad. We also hope to foster a whole movement of Zero Knowledge web services which feature layered security, protecting users from external threats as well as the mistakes that developers are sure to make.

Spurred on by the revelation of our own errors, we have reinvigorated a conversation about moving each of the apps such as CKEditor into a sandboxed iframe where they would be unable to access any of the cryptographic keys or other pads. This introduces some difficulty on our end, as we want to provide a resilient platform while making Zero Knowledge an approachable subject for web developers.

Finally I would like to also publically thank our friend kpcyrd for finding another XSS issue back in early December of 2016, before we had official releases or a blog where we could give him credit for his work.

Announcing biweekly releases

When I joined the research team at XWiki a little over a year ago, CryptPad was very much an experiment. We had ideas of what we wanted to accomplish, but we didn’t know whether it would work at all, let alone how we were going to get there.

We’ve come a long way since then. Having proven that zero knowledge, real time collaborative editing in the browser was possible, we’ve been thinking about an even more difficult task:

How do we make this something that anybody can use?

How we’ve gotten here

We’ve built CryptPad from a number of small pieces. In some cases, we were lucky enough to find existing software libraries which solved our problems. We love when this happens because it keeps us from having to reinvent the wheel, leaving more time for unsolved problems.

When you try to build something that nobody has built before, however, you run into problems that nobody else cares about. We’ve had to build a lot of our own components, and some of them have been incredibly complicated.

Some bugs only become obvious under very odd circumstances, when users with different browsers do very specific sequences or combinations of actions. Our growing userbase has been critical in helping us to identify these kinds of issues, and things have been improving steadily.

What we’ve learned

Our longest delays have come from working on tough problems that managed to get tangled up with smaller bug fixes, which kept them from reaching our users. At the end of 2016, however, most of these big, complicated issues were coming to a close. Our team took some much-needed vacation time, and upon returning we started working to release and deploy a tagged version of our codebase.

Our newest features went live to CryptPad.fr on Tuesday, the 14th of February. Some of them are big enough that we’ll probably dedicate entire blog posts to them, but the release notes are on GitHub.

Our new release policy

In the interest of getting feedback from our users more quickly, we’ve decided to adopt a two week release cycle. We’re going to focus on delivering features that directly improve your experience.

The live site will run code from our latest master branch, while the upcoming release will be on the staging branch.

Each release will come with a set of notes detailing what we did, and known issues that didn’t quite make it into that version. We’ll work on getting those issues fixed in the following cycle.

Whenever we deploy these big updates, we’ll announce when we expect the next one to arrive. Since we started on a Tuesday, we expect to deploy again on Tuesday, February the 28th, 2017.

Codenamed releases

Since it’s difficult to remember versions of the software if they have names like 1.0.0, we’ve decided to give each one a more memorable codename. With there being 26 letters in the Latin alphabet, and 26 two week releases in the year, we started looking for alphabetical lists from which we could choose names. We didn’t look for very long until we thought of Cryptids

an animal whose existence or survival is disputed or unsubstantiated, such as the yeti

We quickly settled on picking a name from this list every two weeks, starting with the letter A, and proceding through the alphabet. For version 1.0.0, we went with Agogwe.

There won’t necessarily be much significance to the name we choose, but we hope that nobody will worry if we choose a particularly frightening cryptid for a given release. Some of the code is bound to be difficult and scary to write, but we want your experience to be as easy as possible.

As always, if you have any feedback you’d like to share, we want to hear it! Contact us and let us know how you use Cryptpad.

If you aren’t using CryptPad yet, give it a try at CryptPad.fr!

Time to Encrypt the Cloud

From typing a business letter to taking pictures with friends, the internet has changed every part of our lives. We don’t just share information with people, we also want it synced across our computers, tablets, and phones.

Modern technology allows us to do this, but it does so by sending all our data to the Cloud.

A lot of what we think of as the Cloud is owned by multinational corporations like Google. Though they may seem like innocent custodians of our data, behind the scenes they are often using it to target us with advertising.

There is little that one person can do

Terms of service are long, vague documents which usually don’t address knowledge derived from your data. More sinister: you can never really know if they’re cheating. Ad networks don’t tell you how they know or even what they know. They just show you ads, based on what they discovered about you… somehow.

What’s your personal information worth?

  • Normally $0.0005 - $0.0021 per person
  • Pregnant in your second trimester? $0.11 (52 times as much)
  • Have a specific health condition? $0.26 (123 times as much)

This is only going to get worse. Artificial Intelligence technology is maturing and Silicon Valley is using it to derive even more value from _us_, its most valuable products.

The result of this will be a veritable weapon of mass manipulation. The tragedy is, manipulating people to get what you want is not that complex. We don’t need to wait for the AI singularity, all we need is a deep mind with the cleverness of a spoiled 5 year old.

All data, over time, approaches deleted, or public.

–Quinn Norton

While we must seek to use services with ethical foundations, we must also recognize that once we give up our data, we are at the mercy of economics. Companies which don’t extract maximum value from our data will eventually be acquired by those which do.

Zero Knowledge

Fortunately we don’t have to go back to the typewriter age. Using basic cryptography, the cloud can make information available across your devices without being able to read the data which it stores.

We do this by adding a hash character (#) to a link. By design, browsers don’t share anything after this character. That means we can share encryption keys just by sharing links. Furthermore, a username and password can be made into a secret key which allows a person’s private data to be kept encrypted using their login credentials.

How do we know you’re secure?

Zero Knowledge web apps are not intended to make you secure, they’re intended to be provably ethical. This cannot be overstated, for too long we have been forced to choose between “James Bond” security protocols which are too difficult to use, and slick web apps which monetize your data.

Our promise to you is that our business model is not to spy on you, and it never will be.

We hope that the security community will join us in building user-friendly, Zero Knowledge services. Privacy is a social problem as much as it is a mathematical one, and it is time we take that seriously.

What we’re going to do

We are going to show the world that web apps can be elegant and usable while still respecting privacy in a verifiable way. We cannot easily prove that we’ve never collected any data but we can prove we’re not doing it systematically.

To start off this conversation, we have developed CryptPad, the first ever Zero Knowledge Realtime Collaborative Editor. We are aiming to make it the most user friendly, most productive collaboration tool available, and still Zero Knowledge.

Finally, we have chosen to make the CryptPad project Open Source. We did this not only because Open Source is in our culture, but also because we want Zero Knowledge web apps to become the universal standard.

The plan in four steps

  1. Develop the most user friendly collaboration tool available which is also Zero Knowledge.
  2. Use this tool to explain the problem and show that an alternative is possible.
  3. Open Source the work we do so that others can also build Zero Knowledge apps.
  4. Foster a culture where privacy by default is a baseline expectation.

How you can help

  • Use CryptPad and other Zero Knowledge services evey day, tell us what you like and what we can do better.
  • Show your support: Buy an upgraded account (coming soon) from us, the people who are developing the code.
  • If you install the Open Source code of CryptPad on your own servers, consider buying a support contract.
  • Talk to your friends and colleagues about Zero Knowledge, show them CryptPad and explain that this is what the cloud can be.
  • If you’re a web developer, think about Zero Knowledge for your next web app.

Other Zero Knowledge Services

Open Source

Proprietary

While we value Open Source, the need for Zero Knowledge Cloud is paramount and we respect the decision of some organizations to keep parts of their codebases proprietary.

An important one which we forgot? Get in touch!

Updated

  • August 9, 2017, Wire is now fully Open Source, yay