Santuario
  1. Santuario
  2. SANTUARIO-108

Xml canonization - UTF-8 encoding issue in Xml security 1.4.0

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Java
    • Security Level: Public (Public issues, viewable by everyone)
    • Labels:
      None
    • Environment:
      Operating System: Windows XP
      Platform: PC

      Description

      Overview Description:

      Implementation of c14n canonization method generates wrong canonical form of Xml
      document with latin characters.

      Steps to Reproduce:

      Generate canonical form of Xml document witch contains latin characters using
      Canonicalizer20010315OmitComments class and compare it with canonical form
      generated with Stylus Studio 2007 or Microsoft.NET 2.0.

      Actual Results:

      Canonicalizer20010315OmitComments class generates canonical form of Xml document
      with latin characters encoded in a wrong way.

      The problem is caused by wrong recognition if character is represented with one
      or many bytes in file "CanonicalizerBase.java" in method static final void
      outputTextToWriter(final String text, final OutputStream writer) in line 829
      ("if ((c & 0x80) ==0)")

      Example:
      let c = 0x15B //(int)c gives 347, a character 'ś'
      c & 0x80 == 0 is true so c is written to OutputStream as single byte 0x5B - '['
      character (line 830).

      As a result canonical form of input Xml document is generated in a wrong way.
      Wrong canonical form causes interoperability problems in verifying digital
      signature of files generated with libraries of other vendors.

      Expected Results:

      Xml security libraries for Apache should generate correct canonical form of Xml
      documents which contains latin characters.

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Unassigned
              Reporter:
              Karol Rewera
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development