nova shouldn't trust userdata is properly formated by client

Bug #837534 reported by Jesse Andrews
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Tushar Patil

Bug Description

When experimenting with a recent extension (user_data) in the openstack 1.1 api, I sent non-base64 encoded data.

If you then try to use the metadata api (to retrieve anything - even the instance-id via /latest/meta-data/instance-id) it causes an exception:

(nova.api.ec2.metadata): TRACE: Traceback (most recent call last):
(nova.api.ec2.metadata): TRACE: File "/usr/lib/pymodules/python2.6/nova/api/ec2/metadatarequesthandler.py", line 79, in __call__
(nova.api.ec2.metadata): TRACE: meta_data = self.cc.get_metadata(remote_address)
(nova.api.ec2.metadata): TRACE: File "/usr/lib/pymodules/python2.6/nova/api/ec2/cloud.py", line 299, in get_metadata
(nova.api.ec2.metadata): TRACE: 'user-data': self._format_user_data(instance_ref),
(nova.api.ec2.metadata): TRACE: File "/usr/lib/pymodules/python2.6/nova/api/ec2/cloud.py", line 1020, in _format_user_data
(nova.api.ec2.metadata): TRACE: return base64.b64decode(instance_ref['user_data'])
(nova.api.ec2.metadata): TRACE: File "/usr/lib/python2.6/base64.py", line 76, in b64decode
(nova.api.ec2.metadata): TRACE: raise TypeError(msg)
(nova.api.ec2.metadata): TRACE: TypeError: Incorrect padding

Related branches

Revision history for this message
Tushar Patil (tpatil) wrote :

Please assign this bug to me, if anyone is not working on it.

Changed in nova:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Tushar Patil (tpatil)
milestone: none → diablo-rbp
Thierry Carrez (ttx)
Changed in nova:
status: Triaged → In Progress
Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: diablo-rbp → 2011.3
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.