Uploaded image for project: 'ActiveMQ'
  1. ActiveMQ
  2. AMQ-4258

Endless loop when received incorrect AMQP message

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 5.8.0
    • Fix Version/s: 5.8.0
    • Component/s: Transport
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      When you send incorrect message to AMQP transform, it will stuck in endless loop and write lot of error messages to console output.

      This way, you can send numbers of incorrect messages and ActiveMQ will create new thread for each of them. This way can attacker create thousands of threads in few minutes and completely overload server machine.

      Problem is in org.apache.activemq.transport.amqp.AmqpProtocolConverter class. It throws exception(exception.txt) and loop never ends:

      Line 158:
      int count = protonTransport.input(frame.data, frame.offset, frame.length);

      Two solutions are possible:

      1. Add "return" statement to catch block (patch1.txt).
      2. Run "frame.moveHead(count);" in finally block with some default positive count (patch2.txt)

      I would prefer the first variant.

      This happens when you try to send message from client with older version of AMQP protocol.

        Attachments

        1. patch1.txt
          0.6 kB
          Robert Balent
        2. patch2.txt
          1 kB
          Robert Balent
        3. exception.txt
          1 kB
          Robert Balent

          Activity

            People

            • Assignee:
              chirino Hiram R. Chirino
              Reporter:
              rbalent Robert Balent
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: