Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
Java 1.4.6, Java 1.5
-
Security Level: Public (Public issues, viewable by everyone)
-
None
Description
StringIndexOutOfBoundsException is thrown during reference verification (if Reference contains URI = "#"):
java.lang.StringIndexOutOfBoundsException: String index out of range: 1
at java.lang.String.charAt(String.java:686)
at org.apache.xml.security.utils.resolver.implementations.ResolverFragment.engineCanResolve(ResolverFragment.java:133)
at org.apache.xml.security.utils.resolver.ResourceResolver.canResolve(ResourceResolver.java:338)
at org.apache.xml.security.utils.resolver.ResourceResolver.getInstance(ResourceResolver.java:107)
at org.apache.xml.security.utils.resolver.ResourceResolver.getInstance(ResourceResolver.java:183)
at org.apache.xml.security.signature.Reference.getContentsBeforeTransformation(Reference.java:417)
at org.apache.xml.security.signature.Reference.dereferenceURIandPerformTransforms(Reference.java:614)
at org.apache.xml.security.signature.Reference.calculateDigest(Reference.java:705)
at org.apache.xml.security.signature.Reference.verify(Reference.java:761)
at org.apache.xml.security.signature.Manifest.verifyReferences(Manifest.java:336)
at org.apache.xml.security.signature.Manifest.verifyReferences(Manifest.java:281)
Method org.apache.xml.security.utils.resolver.implementations.ResolverFragment.engineCanResolve(...) code:
if (uriNodeValue.equals("") ||
((uriNodeValue.charAt(0) == '#')
&& !((uriNodeValue.charAt(1) == 'x') && uriNodeValue.startsWith("#xpointer(")))
) {
if (log.isDebugEnabled())
return true;
}
is unsafe, since charAt(1) may not exist.