Adding an SSH key fails due to a UnicodeDecodeError

Bug #1270052 reported by Graham Binns
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Critical
Raphaël Badin

Bug Description

(Observed on Trusty; not verified on other releases yet).

Occasionally, adding an SSH key to a user profile will fail due to a UnicodeDecode error, which prevents the key from being added at all. The error appears to come from conch.

The fact that the key had a character that couldn't be decoded is weird in itself and quite likely due to PEBKAC, but the naked Django error is an unpleasant failure state.

Tags: pap

Related branches

Revision history for this message
Graham Binns (gmb) wrote :
Revision history for this message
Raphaël Badin (rvb) wrote :

An ssh key is of the form: <ssh-rsa> <base64-encoded string> <login@laptop>. In your stacktrace, the failure is due to the base64-encoded string not being ASCII (and thus not being a base64-encoded string).

I'm marking this critical since anything that causes Django to crash should be treated critical but the fix is pretty simple: we should add another validator to src/maasserver/models/sshkey.py:SSHKey.key to validate that the key is an ascii string.

Changed in maas:
status: New → Triaged
importance: Undecided → Critical
tags: added: pap
Raphaël Badin (rvb)
Changed in maas:
assignee: nobody → Raphaël Badin (rvb)
status: Triaged → In Progress
milestone: none → 14.04
Raphaël Badin (rvb)
Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.