Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sanitize nicknames more carefully #313

Merged
merged 3 commits into from
Dec 23, 2015

Conversation

special
Copy link
Member

@special special commented Dec 23, 2015

QML makes the questionable decision of parsing all Text items as
rich text if they appear to like HTML. This HTML parser is, fortunately,
nothing like a browser - it supports only simple visual formatting.
Still, in the worst case it can trigger network requests.

We were being too lax with sanitizing variables before display, if they
weren't directly from an external source. In one case, this could lead
to deanonymization if a user reviews and accepts a contact request
with a nickname containing an tag.

These commits harden against this problem in three ways: by blocking any possible network requests, ensuring nicknames are sanitized every time they're displayed, and by blocking a few more characters in incoming contact requests.

Nicknames in Ricochet are always set by the local user, so this wasn't directly a vulnerability. However, inbound contact requests can suggest a nickname, which is displayed (safely) and used if the user accepts the request without changing it. If that request was accepted despite the nickname, it would be possible for a remote user to trigger network activity.

Ricochet's UI does not make any network requests under any
circumstances; if one happens, it's likely a bug and potentially an
input sanitization issue that could lead to deanonymization.

Using QML's network access manager factory, intercept all of these
requests, trigger an assert, and make sure it's absolutely not possible
for any network traffic to occur as a result.

Contributes to ricochet-im#303, inspired by Sarah Jamie Lewis
QML makes the questionable decision of parsing all Text items as
rich text if they appear to like HTML. This HTML parser is, fortunately,
nothing like a browser - it supports only simple visual formatting.
Still, in the worst case it can trigger network requests.

We were being too lax with sanitizing variables before display, if they
weren't directly from an external source. In one case, this could lead
to deanonymization if a user reviews and accepts a contact request
with a nickname containing an <img> tag.

This is one of three commits aimed at preventing these issues in the
future; the others more carefully block all network requests, and reduce
the set of characters valid in nicknames.

Fixes ricochet-im#274, discovered by Sarah Jamie Lewis
@rburchell
Copy link
Contributor

👍

@s-rah
Copy link
Member

s-rah commented Dec 23, 2015

Awesome! 👍

special added a commit that referenced this pull request Dec 23, 2015
Sanitize nicknames more carefully
@special special merged commit 76da0e7 into ricochet-im:master Dec 23, 2015
@special special deleted the sanitize-nicknames branch December 23, 2015 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants