IntegrityError: duplicate key value violates unique constraint "ticketmessage_message_ticket_uniq

Bug #659184 reported by Curtis Hovey
4
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Critical
Unassigned

Bug Description

OOPS-1745CEMAIL15 shows a problem when processing an incoming email. I have never seen an issue like this.

Revision history for this message
Curtis Hovey (sinzui) wrote :

The message is spam. It was sent from a compromised email account:
    https://answers.launchpad.net/launchpad-registry/+question/130282

The violation is question.id and message.id. The rfc822msgid was reused in the spam attack.

The AnswerTrackerHandler.process() method, uses messageset.fromEmail() to create a message object, but fromEmail() is also a lookup method. Since the rfc822msgid was reused, the first attack message was retrieved instead of creating a new one. Question.addComment() failed because the message associated with rfc822msgid already exists. fromEmail() is used by both the answers and the bug handlers and both assume the message was created.

Both answers and bugs mail processes could trying looking up the message by rfc822msgid first or verify the message is not already linked. I suppose the latter is preferable since this kind of attack is rare.

Revision history for this message
Curtis Hovey (sinzui) wrote :

This is also bug 595166

tags: added: email
Changed in launchpad:
importance: High → Critical
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.