You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "zstan (via GitHub)" <gi...@apache.org> on 2026/08/11 13:33:26 UTC

Re: [PR] IGNITE-28743 Block remote HTTP/HTTPS/FTP URLs in resolveSpringUrl prevent RCE via JDBC cfg:// [ignite]

zstan commented on code in PR #13382:
URL: https://github.com/apache/ignite/pull/13382#discussion_r3758396870


##########
modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java:
##########
@@ -2558,12 +2566,72 @@ public static boolean mkdirs(File dir) {
     public static URL resolveSpringUrl(String springCfgPath) throws IgniteCheckedException {
         A.notNull(springCfgPath, "springCfgPath");
 
+        String prop = IgniteSystemProperties.IGNITE_ALLOW_REMOTE_SPRING_CFG_URL;
+
         URL url;
 
         try {
             url = new URL(springCfgPath);
+
+            URL cfgUrl = url;
+
+            String scheme = cfgUrl.getProtocol().toLowerCase(Locale.ROOT);
+
+            // Unwrap jar:<nested_url>!/path (potentially nested) to avoid bypassing remote-scheme checks.
+            while ("jar".equals(scheme)) {
+                String file = cfgUrl.getFile();
+
+                int sep = file.indexOf("!/");
+
+                if (sep <= 0)
+                    break;
+
+                try {
+                    cfgUrl = new URL(file.substring(0, sep));
+                    scheme = cfgUrl.getProtocol().toLowerCase(Locale.ROOT);
+                }
+                catch (MalformedURLException ignored) {
+                    break;
+                }
+            }

Review Comment:
   I wonder - why do we need such a code ? I comment it and all tests are passed.
   Also plz merge master branch !



-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org