Skip to content

When receiving a large uid set, net-imap will consume a significant amount of CPU resources and take long time to raise ResponseParseError. #410

@xiaoge1001

Description

@xiaoge1001

The test code comes from:
GHSA-7fc5-f82f-cx69

require "net/imap"

def test(size)
  input = "A004 OK [COPYUID 1 1:#{size} 1:#{size}] too large?\r\n"
  parser = Net::IMAP::ResponseParser.new
  parser.parse input
end

when size = 99999999:

Image

when size = 4294967295:

Image

when size = 4294967295, it occupies over 90% of CPU resources:
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    backportThis issue or PR is for a stable release branchbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions