Error: Incorrect padding (base64 error) during authentication

Bug #151362 reported by Barry Warsaw
22
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Critical
j.c.sackett

Bug Description

If you attempt to authenticate to Launchpad using a non-base64 encoded credentials, Launchpad tracebacks. E.g.

from zope.testbrowser.browser import Browser
browser = Browser()
browser.addHeader('Authorization', 'Basic email:password')
browser.open('http://launchpad.dev/people/+newteam')

Here's the traceback you get:

2007-10-10T13:35:12 ERROR SiteError http://launchpad.dev
Traceback (most recent call last):
  File "/home/barry/projects/launchpad/mlist-experts/database/schema/../../lib/zope/publisher/publish.py", line 132, in publish
    publication.beforeTraversal(request)
  File "/home/barry/projects/launchpad/mlist-subs-3/lib/canonical/launchpad/webapp/publication.py", line 177, in beforeTraversal
    p = prin_reg.authenticate(request)
  File "/home/barry/projects/launchpad/mlist-subs-3/lib/canonical/launchpad/webapp/authentication.py", line 120, in authenticate
    credentials = ILoginPassword(request, None)
  File "/home/barry/projects/launchpad/mlist-experts/database/schema/../../lib/zope/interface/interface.py", line 675, in __call__
    adapter = self.__adapt__(obj)
  File "/home/barry/projects/launchpad/mlist-experts/database/schema/../../lib/zope/interface/interface.py", line 742, in __adapt__
    adapter = hook(self, obj)
  File "/home/barry/projects/launchpad/mlist-experts/database/schema/../../lib/zope/app/component/hooks.py", line 96, in adapter_hook
    return siteinfo.adapter_hook(interface, object, name, default)
  File "/home/barry/projects/launchpad/mlist-experts/database/schema/../../lib/zope/interface/adapter.py", line 415, in adapter_hook
    adapter = factory(object)
  File "/home/barry/projects/launchpad/mlist-experts/lib/zope/app/security/basicauthadapter.py", line 32, in __init__
    lpw = request._authUserPW()
  File "/home/barry/projects/launchpad/mlist-experts/database/schema/../../lib/zope/publisher/http.py", line 495, in _authUserPW
    name, password = base64.decodestring(
  File "base64.py", line 321, in decodestring
    return binascii.a2b_base64(s)
Error: Incorrect padding

Related OOPS: OOPS-1146F13, OOPS-1188C1227

Related branches

Ursula Junque (ursinha)
description: updated
Ursula Junque (ursinha)
description: updated
Changed in launchpad-foundations:
importance: Undecided → Low
status: New → Triaged
Revision history for this message
Robert Collins (lifeless) wrote :

We may have turned basic auth off now, which would make this irrelevant?

visibility: private → public
Revision history for this message
Gary Poster (gary) wrote :

It is not disabled: I can duplicate Barry's report today.

FWIW, the last time we saw this OOPS in production was April 2009.

Changed in launchpad:
importance: Low → Critical
Revision history for this message
Curtis Hovey (sinzui) wrote :

Latest oops from 2011-01-21 OOPS-1188C1227

j.c.sackett (jcsackett)
Changed in launchpad:
assignee: nobody → j.c.sackett (jcsackett)
Revision history for this message
j.c.sackett (jcsackett) wrote :

A bunch of the OOPses listed here are actually for parsing base64 on filebug, not Basic auth.

See bug 746607.

j.c.sackett (jcsackett)
Changed in launchpad:
status: Triaged → In Progress
Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
Changed in launchpad:
milestone: none → 11.04
tags: added: qa-needstesting
Changed in launchpad:
status: In Progress → Fix Committed
William Grant (wgrant)
tags: added: qa-ok
removed: qa-needstesting
William Grant (wgrant)
Changed in launchpad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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