Issue information

Issue ID
#292
Status
Fixed
Severity
Low
Started
Hercules Elf Bot
Oct 24, 2007 19:49
Last Post
Hercules Elf Bot
Oct 24, 2007 19:49
Confirmation
N/A

Hercules Elf Bot - Oct 24, 2007 19:49

Originally posted by [b]theultramage[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=292

There is a hole in the mail packet exchange scheme that in the right conditions would allow arbitrary item duplication using the 'attach item' feature.
This is due to the fact that items attached to a mail that's in the process of being sent don't actually get deleted, only after the confirmation from charserver arrives.

The details look like this:
  1. player A sends a mail+attachment to player B
  2. charserver saves mail, informs B and sends back an ack
  3. player A logs out before the 'ack' arrives - meaning the mail with the item has been permanently recorded on the charserver but the item hasn't been deleted from the sender's inventory!
  4. mapserver sends a desperate mail deletion request
  5. before it arrives, player B opens mailbox, retrieves item
Unlikely if map and char are on the same machine (the way the socket layer processes packets should make this scenario impossible), theoretically possible on multimap where A's server is on a very lagged / wiretapped connection.

The secure way would be to record the message as 'pending' in step 3., and add another step where the mapserver sends an ack after physically deleting the item. Then the charserver would change the mail into a permanent one.