Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
Patch Available
Description
There is a bug in the applicable policy set processing in PolicyComputationUtils which may cause a PolicyValidationException. Method addApplicablePolicySets(PolicySet, Document, int) has the following code:
String policySetPrefix = POLICYSET_PREFIX + prefixCount++;
String appPolicyAttrPrefix = APPLICABLE_POLICYSET_ATTR_PREFIX;
policySetPrefix =
declareNamespace((Element)aResultNode, policySetPrefix, policySet.getName()
.getNamespaceURI());
This code calls declareNamespace() to handle binding a prefix to the policy set's namespace. It generates the prefix though it has no idea whether the prefix is needed (it isn't needed if there is an existing prefix bound to the namespace). It generates the prefix using a counter which recycles to 1 each time an applicable policy set is added to the document. This means there is a possibility of reusing the same prefix for two different namespaces. If that happens, some of the applicable policy sets will have the wrong namespace. This may cause references to the policy set within the composite to fail validation due to the namespace mismatch.