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


##########
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:
   Sorry, my bad missed the isAllowedReference, however to your point - we use 
generic references mostly everywhere (fe EndpointReferenceUtils says "... as 
its URL scheme is not allowed"), I think it will be good idea to have reported 
there the same way, generically 
   
   ```
   throw new IllegalArgumentException("Not importing " + importLocation + " as 
its URL scheme is not allowed");
   ```
   
   But no strong preference to be fair



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