You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "tju-yxq (via GitHub)" <gi...@apache.org> on 2026/08/10 05:21:23 UTC

[I] [Bug] SSRF bypass: loopback IP 127.0.0.1 is not blocked by data source URL guard [rocketmq-dashboard]

tju-yxq opened a new issue, #1422:
URL: https://github.com/apache/rocketmq-dashboard/issues/1422

   ## Bug Report
   
   ### Before Creating the Bug Report
   
   - [x] I found a bug, not just asking a question, which should be created in [GitHub Discussions](https://github.com/apache/rocketmq/discussions).
   - [x] I have searched the [GitHub Issues](https://github.com/apache/rocketmq/issues) and [GitHub Discussions](https://github.com/apache/rocketmq/discussions) of this repository and believe that this is not a duplicate.
   - [x] I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.
   
   ### Runtime platform environment
   
   OS: Ubuntu 20.04 / Any OS running RocketMQ Studio
   
   ### RocketMQ version
   
   branch: rocketmq-studio
   version: 5.3.2+
   Git commit id: f727341
   
   ### JDK Version
   
   OpenJDK 21
   
   ### Describe the Bug
   
   The SSRF guard in `SettingsService.isAllowedDataSourceHost()` blocks `"localhost"` by string comparison and blocks link-local addresses (`169.254.x.x`) and any-local addresses (`0.0.0.0`), but it does **not** check `isLoopbackAddress()`. This means `127.0.0.1` (and any `127.x.x.x` address) bypasses the guard, allowing an attacker to make the Studio server send HTTP requests to its own loopback interface.
   
   ```java
   private boolean isAllowedDataSourceHost(String host) {
       if (!StringUtils.hasText(host)) {
           return false;
       }
       String normalized = host.toLowerCase(Locale.ROOT);
       if ("localhost".equals(normalized)) {
           return false;  // blocks "localhost" string
       }
       try {
           InetAddress address = InetAddress.getByName(normalized);
           return !address.isAnyLocalAddress()      // blocks 0.0.0.0
                   && !address.isLinkLocalAddress(); // blocks 169.254.x.x
           // MISSING: !address.isLoopbackAddress()  ← 127.0.0.1 is NOT blocked!
       } catch (UnknownHostException exception) {
           return true;
       }
   }
   ```
   
   ### Impact
   
   An authenticated user (even a non-admin reader, since `/api/settings/datasources/test` is in `READER_POST_PATHS`) can test a data source URL pointing to `http://127.0.0.1:<port>/` and observe the response status and error messages. This allows:
   
   - **Port scanning** the Studio server's loopback interface by varying the port number.
   - **Accessing internal services** running on localhost (e.g., Spring Actuator endpoints at `http://127.0.0.1:8080/actuator/env`, database admin panels, etc.).
   - The response body is not returned, but the error message (`"Prometheus query failed"`, `"Connection refused"`, timeout vs. auth error) leaks whether a service is running on that port.
   
   ### Steps to Reproduce
   
   1. Open RocketMQ Studio settings.
   2. Go to Data Sources > Add.
   3. Enter URL: `http://127.0.0.1:8080/actuator/env` (or any internal service URL).
   4. Click "Test Connection".
   5. Observe: the test succeeds or returns a specific error (not "Data source URL must not point to a local or private address").
   6. Try with `http://localhost:8080/actuator/env` - this is correctly blocked.
   
   ### What Did You Expected to See?
   
   All loopback addresses (`127.0.0.1` through `127.255.255.255`) should be blocked, matching the existing `"localhost"` string filter.
   
   ### What Did You See Instead?
   
   `127.0.0.1` bypasses the SSRF guard because `isLoopbackAddress()` is not checked.
   
   ### Additional Context
   
   **Affected file**: `server/src/main/java/org/apache/rocketmq/studio/settings/SettingsService.java`, method `isAllowedDataSourceHost()` at approximately line 245.
   
   **Fix**: Add `!address.isLoopbackAddress()` to the return condition:
   
   ```java
   return !address.isAnyLocalAddress()
           && !address.isLinkLocalAddress()
           && !address.isLoopbackAddress();
   ```
   
   This is a one-line fix that closes the SSRF bypass.
   


-- 
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: commits-unsubscribe@rocketmq.apache.org.apache.org

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


Re: [I] [Bug] SSRF bypass: loopback IP 127.0.0.1 is not blocked by data source URL guard [rocketmq-dashboard]

Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #1422:
URL: https://github.com/apache/rocketmq-dashboard/issues/1422#issuecomment-5237575589

   **Issue Evaluation**
   
   Category: `bug` | Status: **Confirmed**
   
   SSRF bypass: loopback IP not blocked in data source URL guard
   
   **Severity:** High
   **Impact:** Security vulnerability
   
   A fix PR is available: #1423.
   
   ---
   *Automated evaluation by RockteMQ-AI*


-- 
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: commits-unsubscribe@rocketmq.apache.org

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


Re: [I] [Bug] SSRF bypass: loopback IP 127.0.0.1 is not blocked by data source URL guard [rocketmq-dashboard]

Posted by "tju-yxq (via GitHub)" <gi...@apache.org>.
tju-yxq commented on issue #1422:
URL: https://github.com/apache/rocketmq-dashboard/issues/1422#issuecomment-5270111672

   Follow-up audit note:
   
   This is fixed in current `rocketmq-studio`, and follow-up PR #2034 adds explicit service coverage that `http://127.0.0.1:9090` is rejected as a local/private data source URL.
   
   Verification result: `BUILD SUCCESS`; `Tests run: 9, Failures: 0, Errors: 0, Skipped: 0`.
   
   I updated the issue description to remove unverified live SSRF/internal-service probing claims. The current evidence is code inspection plus focused unit tests; no live exploit reproduction was run.
   


-- 
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: commits-unsubscribe@rocketmq.apache.org

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


Re: [I] [Bug] SSRF bypass: loopback IP 127.0.0.1 is not blocked by data source URL guard [rocketmq-dashboard]

Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #1422:
URL: https://github.com/apache/rocketmq-dashboard/issues/1422#issuecomment-5237586875

   **Issue Evaluation**
   
   Category: `bug` | Status: **Confirmed**
   
   SSRF bypass: loopback IP 127.0.0.1 not blocked by data source URL guard — valid security vulnerability.
   
   **Severity:** High | **Impact:** Security — data source URL validation can be bypassed to reach internal services.
   
   A fix PR is available: #1423.
   
   ---
   *Automated evaluation by RockteMQ-AI*


-- 
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: commits-unsubscribe@rocketmq.apache.org

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


Re: [I] [Bug] SSRF bypass: loopback IP 127.0.0.1 is not blocked by data source URL guard [rocketmq-dashboard]

Posted by "tju-yxq (via GitHub)" <gi...@apache.org>.
tju-yxq commented on issue #1422:
URL: https://github.com/apache/rocketmq-dashboard/issues/1422#issuecomment-5270115426

   Closing as completed: current rocketmq-studio rejects loopback data-source URLs, and follow-up PR #2034 adds explicit 127.0.0.1 coverage. The issue body/comment now reflects the verified evidence boundary.


-- 
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: commits-unsubscribe@rocketmq.apache.org

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


Re: [I] [Bug] SSRF bypass: loopback IP 127.0.0.1 is not blocked by data source URL guard [rocketmq-dashboard]

Posted by "tju-yxq (via GitHub)" <gi...@apache.org>.
tju-yxq closed issue #1422: [Bug] SSRF bypass: loopback IP 127.0.0.1 is not blocked by data source URL guard
URL: https://github.com/apache/rocketmq-dashboard/issues/1422


-- 
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: commits-unsubscribe@rocketmq.apache.org

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