Summary
hm_editor up to version 2.2.3 contains a server-side request forgery (SSRF) vulnerability in the image-to-base64 endpoint, specifically in the client.get function of src/mcp-server.js.
By manipulating the url argument, a remote attacker can coerce the server into making arbitrary HTTP requests to internal or external resources on behalf of the application.
Affected context
This vulnerability appears in deployments of huimeicloud hm_editor (up to 2.2.3) that expose the image-to-base64 endpoint over a network.
The issue arises when the server accepts a user-controlled url parameter and uses it directly in client.get within src/mcp-server.js to fetch remote images for conversion.
In environments where the hm_editor instance can reach internal services, cloud metadata endpoints, or otherwise non-public network locations, this behavior can become particularly risky.
Exploit preconditions
- Attack surface: Network-exposed
image-to-base64HTTP endpoint provided by hm_editor. - Required access: Ability to send crafted requests to the endpoint (typically unauthenticated or low-privilege access, depending on deployment).
- Trigger point: Supplying a controlled
urlvalue that the server uses inclient.getto initiate outbound HTTP requests. - Why exploitation is possible: The server trusts the
urlparameter and forwards it directly to an HTTP client without adequate validation, filtering, or network egress restrictions, allowing attackers to pivot the server as a proxy to arbitrary destinations.
Why this happens
The core issue is unvalidated, user-controlled URL input being used to drive server-side HTTP requests.
The image-to-base64 endpoint accepts a url argument and passes it directly into client.get in src/mcp-server.js, effectively turning the server into an open HTTP proxy.
This maps to CWE-918: Server-Side Request Forgery (SSRF), where a server-side component that can reach internal or sensitive resources is tricked into issuing requests chosen by an attacker.
The lack of allow-listing, scheme restriction, host validation, and network segmentation enables attackers to explore internal networks or access metadata and management services through the vulnerable application.
Potential impact
- May allow access to internal HTTP(S) services that are not directly exposed to the internet.
- Could enable interaction with cloud provider instance metadata endpoints, potentially leading to credential exposure or environment takeover.
- Can be used for network reconnaissance, including port scanning and service enumeration on internal hosts reachable from the server.
- Might facilitate bypassing IP-based access controls by using the trusted application server as a proxy.
- Could leak sensitive data returned by internal services if responses are reflected back to the attacker.
General mitigation guidance
Effective mitigation generally centers on constraining outbound requests and validating untrusted URLs before use:
- Introduce strict allow-listing of permitted domains or hostnames for the
image-to-base64endpoint, rejecting any URL outside of known-safe destinations. - Enforce URL parsing and validation rules that restrict schemes (e.g., only
https), block private and link-local IP ranges, and disallow direct IP literals where appropriate. - Apply network-level egress controls so the hm_editor server can only reach approved external services and cannot directly access internal administration or metadata endpoints.
- Consider separating image-fetching functionality into a dedicated, low-privilege service with highly constrained network access.
- Fail closed on URL validation errors, and avoid following redirects to untrusted or unvalidated destinations.
How teams detect issues like this
Organizations can look for SSRF patterns in both code and runtime behavior:
- Static/code review: Flag uses of HTTP client libraries where URLs include direct user input (e.g.,
client.get(req.body.url)or similar) without validation, domain checks, or allow-lists. - Security policy checks: Enforce coding standards that require URL validation helpers and prohibit direct use of externally supplied URLs in outbound requests.
- Network monitoring: Monitor outbound traffic from hm_editor instances for unusual destinations, such as internal IP ranges, metadata IP addresses (e.g., 169.254.169.254), or unexpected ports.
- Automated analysis: Use SAST/IAST tools configured with SSRF-specific rules to identify untrusted URL sinks and missing validation logic across server-side components.

