coheigea commented on code in PR #3803:
URL: https://github.com/apache/cxf/pull/3803#discussion_r4749525926


##########
rt/wsdl/src/main/java/org/apache/cxf/wsdl11/AbstractWrapperWSDLLocator.java:
##########
@@ -95,14 +93,12 @@ public String getBaseURI() {
     }
 
     public InputSource getImportInputSource(String parentLocation, String 
importLocation) {
-        // Do a check on the scheme to see if it's anything that could be a 
security risk
-        try {
-            URI url = new URI(importLocation);
-            if (!(url.getScheme() == null || 
URIResolver.getAllowedSchemes().contains(url.getScheme()))) {
-                throw new IllegalArgumentException("The " + url.getScheme() + 
" URI scheme is not allowed");
-            }
-        } catch (URISyntaxException e) {
-            // Just continue here as we might still be able to load it from 
the filesystem
+        // Do a check on the scheme to see if it's anything that could be a 
security risk. This also checks
+        // the location of an archive (e.g. jar:ftp://...), and does not need 
the import location to parse
+        // as a URI. A relative import is resolved against its parent, which 
has already been checked.
+        String scheme = URIResolver.getDisallowedScheme(importLocation, null);

Review Comment:
   Fair point, done: the locator now uses isAllowedReference and reports “Not 
resolving import <location> as its URL scheme is not allowed”, matching 
EndpointReferenceUtils. With that, getDisallowedScheme has no users outside 
URIResolver, so I’ve made it package-private, as you originally suggested



-- 
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]

Reply via email to