Smack

Packet parsing must look for depth

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Critical Critical
  • Resolution: Unresolved
  • Affects Version/s: 1.5.0
  • Fix Version/s: None
  • Component/s: Core

Activity

Matt Tucker made changes - 07/22/05 09:47 PM
Field Original Value New Value
Component/s Core [ 10000 ]
Affects Version/s 1.5.0 [ 10000 ]
Fix Version/s 1.5.1 [ 10090 ]
Gaston Dombiak made changes - 08/12/05 08:31 PM
Fix Version/s 1.5.1 [ 10090 ]
Fix Version/s 1.5.2 [ 10155 ]
Gaston Dombiak made changes - 08/26/05 10:05 PM
Fix Version/s 1.5.2 [ 10155 ]
Fix Version/s 2.1.0 [ 10160 ]
Gaston Dombiak made changes - 09/05/05 11:30 PM
Fix Version/s 2.2.0 [ 10170 ]
Fix Version/s 2.1.0 [ 10160 ]
Gaston Dombiak made changes - 03/09/06 03:27 AM
Fix Version/s 2.2.1 [ 10350 ]
Fix Version/s 2.2.0 [ 10170 ]
Hide
Paul D Johe added a comment - 05/14/06 02:36 PM

I have a suggestion to help resolve this issue. Use a customized MXParser:

import java.io.IOException;

import org.xmlpull.mxp1.MXParser;
import org.xmlpull.v1.XmlPullParserException;

public class SmackXMLPuller extends MXParser {

private int depth = 0;

private static final long serialVersionUID = 1L;

@Override
public int next() throws XmlPullParserException, IOException { int ret = super.next(); if (ret == START_TAG) depth++; if (ret == END_TAG) depth--; return ret; }

@Override
public int nextTag() throws XmlPullParserException, IOException { int ret = next(); if (ret == START_TAG || ret == END_TAG) return ret; throw new XmlPullParserException("The next tag was not a start or end tag."); }

/**

  • Get the current depth of the parser
  • @return int
    */
    public int getDepth() { return depth; }
    }
Show
Paul D Johe added a comment - 05/14/06 02:36 PM I have a suggestion to help resolve this issue. Use a customized MXParser: import java.io.IOException; import org.xmlpull.mxp1.MXParser; import org.xmlpull.v1.XmlPullParserException; public class SmackXMLPuller extends MXParser { private int depth = 0; private static final long serialVersionUID = 1L; @Override public int next() throws XmlPullParserException, IOException { int ret = super.next(); if (ret == START_TAG) depth++; if (ret == END_TAG) depth--; return ret; } @Override public int nextTag() throws XmlPullParserException, IOException { int ret = next(); if (ret == START_TAG || ret == END_TAG) return ret; throw new XmlPullParserException("The next tag was not a start or end tag."); } /**
  • Get the current depth of the parser
  • @return int */ public int getDepth() { return depth; } }
Gaston Dombiak made changes - 06/12/06 07:36 PM
Fix Version/s 3.0.0 [ 10440 ]
Fix Version/s 2.2.1 [ 10350 ]
Hide
Alex Wenckus submitted changeset 4342 to smack (1 file) - 07/10/06 01:15 PM

Fixed several xhtml processing bugs:
1) <br/> will no longer produce <br/><br/>. SMACK-93
2) XML entities inside of the xhtml bodies should now be properly escaped. SMACK-145
3) XHTML processing keeps track of depth. SMACK-65

Show
Alex Wenckus submitted changeset 4342 to smack (1 file) - 07/10/06 01:15 PM
Hide
Alex Wenckus submitted changeset 4343 to smack (1 file) - 07/10/06 01:27 PM

Switch or's to and's so that the exploit can't be used note that this doesn't fix the issue of invalid XML. SMACK-65

Show
Alex Wenckus submitted changeset 4343 to smack (1 file) - 07/10/06 01:27 PM
Matt Tucker made changes - 02/04/07 10:54 PM
Fix Version/s 3.0.0 Beta 1 [ 10440 ]
Fix Version/s 3.0.0 [ 10644 ]
Matt Tucker made changes - 03/31/07 07:54 PM
Fix Version/s 3.0.0 [ 10644 ]

People

Dates

  • Created:
    07/22/05 09:46 PM
    Updated:
    03/31/07 07:54 PM