tabish121 commented on code in PR #1847:
URL: https://github.com/apache/activemq/pull/1847#discussion_r2998112450
##########
activemq-broker/src/main/java/org/apache/activemq/broker/jmx/BrokerView.java:
##########
@@ -603,18 +603,22 @@ public long getTotalMaxUncommittedExceededCount() {
return
safeGetBroker().getDestinationStatistics().getMaxUncommittedExceededCount().getCount();
}
-
- // Validate the Url does not contain VM transport
private static void validateAllowedUrl(String uriString) throws
URISyntaxException {
- URI uri = new URI(uriString);
+ validateAllowedUri(new URI(uriString));
+ }
+
+ // Validate the URI does not contain VM transport
+ private static void validateAllowedUri(URI uri) throws URISyntaxException {
// First check the main URI scheme
validateAllowedScheme(uri.getScheme());
- // If composite, also check all schemes for each component
+ // If composite, iterate and check each of the composite URIs
if (URISupport.isCompositeURI(uri)) {
URISupport.CompositeData data = URISupport.parseComposite(uri);
for (URI component : data.getComponents()) {
- validateAllowedScheme(component.getScheme());
+ // Each URI could be a nested composite URI so
+ // call validateAllowedUri() to validate it
+ validateAllowedUri(component);
Review Comment:
Need to create some limit on the recursion depth here otherwise bad input
could cause an overflow
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact