Uploaded image for project: 'Xerces2-J'
  1. Xerces2-J
  2. XERCESJ-1616

Extremly Slow XML declaration parsing

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.11.0
    • None
    • None

    Description

      For specially crafted XML files (e.g. created by codenomicon test tool) with injected data in the XML declaration the parser spends too much time parsing the XML decl until it fails, due to its per byte/character processing here. MayReadChunks is not used here for some reason and it is horrible slow because of that and just hogs the single CPU core until it finally fails.

      Either xerces should be very strict what can be in the XML decl (as that is defined by DTD and should fail with the first character that doesn't match the DTD and not use generic parsing for those attributes until the whole attribute is parsed) or provide reasonable performance processing XML decl (e.g. enable mayReadChunks while processing the XML decl, not sure what sideeffects it could have, worked fine for my request when enabled before).

      Attachments

        1. invalidversionValue.zip
          1 kB
          Tomas Kacer
        2. xmlDosAttack2MB.zip
          6 kB
          Tomas Kacer

        Activity

          People

            Unassigned Unassigned
            kacert Tomas Kacer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: