Email interface can create bug titles containing newlines

Bug #31618 reported by James Henstridge
14
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Medium
Stuart Bishop

Bug Description

The subject line of bug 31589 is set to the following:

"Attempting to set redirection_url to a tuple instead of a string\n in login machinery"

(where "\n" is a newline).

When I tried to add a comment to the bug without updating the subject line, the form machinary reports a "Constraint not satisfied" error for the subject line field. The newline must be removed from the subject line before the comment can be added.

My guess is that Stuart's orginal email had the subject line wrapped as follows, in keeping with RFC2822 header folding rules:

Subject: Attempting to set redirection_url to a tuple instead of a string
 in login machinery

The incoming email code then uses this wrapped version of the subject line as the bug title, which is where the problem starts.

The "Summary" header should be unfolded before being used as a bug title or message subject. The unfolding algorithm in RFC2822 is found in section 2.2.3:

   The process of moving from this folded multiple-line representation
   of a header field to its single line representation is called
   "unfolding". Unfolding is accomplished by simply removing any CRLF
   that is immediately followed by WSP. Each header field should be
   treated in its unfolded form for further syntactic and semantic
   evaluation.

Tags: lp-bugs
Dafydd Harries (daf)
Changed in malone:
status: Unconfirmed → Confirmed
Revision history for this message
Stuart Bishop (stub) wrote :

Once this bug is fixed in code, I will need to update the production data so please assign it to me at this point rather than closing the bug.

Changed in malone:
assignee: nobody → bjornt
Revision history for this message
Björn Tillenius (bjornt) wrote :

A fix is in the review queue.

Changed in malone:
status: Confirmed → In Progress
Changed in malone:
status: In Progress → Fix Committed
Revision history for this message
Christian Reis (kiko) wrote :

Landed in RF; reassigning to Stuart as requested.

Changed in malone:
assignee: bjornt → stub
Revision history for this message
Diogo Matsubara (matsubara) wrote :

Re-assigned to Stuart as per his request.

Revision history for this message
Stuart Bishop (stub) wrote :

Production data fixed.

Changed in malone:
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.