Summary
Mogu Blog v2 up to 5.2 contains a server-side request forgery (SSRF) issue in the Picture Storage Service, specifically in LocalFileServiceImpl.uploadPictureByUrl.
When an attacker can control the URL used for image upload, they may coerce the server into making arbitrary HTTP requests to internal or external endpoints, potentially exposing internal services or metadata.
Affected context
This vulnerability appears in Mogu Blog deployments where users can submit image URLs that are fetched and stored by the Picture Storage Service (LocalFileServiceImpl.uploadPictureByUrl).
The risk is highest when:
- The application is reachable from the internet
- The backend server has network access to internal services, cloud metadata endpoints, or protected APIs
- There is little or no validation of destination URLs, IP ranges, or protocols used in the fetch request
Exploit preconditions
- Attack surface: HTTP endpoints that accept a URL parameter or field for "uploading" or "importing" an image by URL.
- Required access: Ability to send requests to the blog application (typically unauthenticated or low-privileged user access, depending on how image upload/import is exposed).
- Trigger point: Invocation of
uploadPictureByUrl, where the server performs an outbound HTTP request to the attacker-controlled URL. - Why exploitation is possible: The server trusts user-supplied URLs and issues outbound requests without enforcing strict allowlists, IP range checks, or protocol restrictions, enabling attackers to pivot through the server to other network targets.
Why this happens
The core issue maps to CWE-918: Server-Side Request Forgery (SSRF).
The Picture Storage Service uses user-provided URLs in LocalFileServiceImpl.uploadPictureByUrl to retrieve remote images, but does not sufficiently constrain where the server is allowed to connect.
Without robust validation and network egress controls, the application treats untrusted URLs as safe, allowing the server to act as a proxy to arbitrary hosts, including internal network resources or sensitive cloud endpoints.
Potential impact
- Access to internal HTTP services that are not directly exposed to the internet (e.g., admin panels, APIs, management interfaces)
- Interaction with cloud provider metadata services, which could lead to credential or token exposure
- Discovery of internal network structure via response content and timing behavior
- Use of the application server as a relay for attacks against other systems (e.g., port scanning, partial request smuggling)
- Potential chaining with other vulnerabilities (e.g., hitting internal admin APIs that lack strong authentication) for further compromise
General mitigation guidance
Effective mitigation focuses on constraining outbound requests and reducing trust in user-supplied URLs:
- Introduce strict allowlists of permitted domains or hostnames for image fetching, and resolve/verify DNS before each request.
- Block access to private and link-local IP ranges (e.g., RFC1918, 169.254.169.254) and non-HTTP/HTTPS schemes at the application layer.
- Normalize and re-resolve URLs after redirects, applying the same domain/IP validation on every hop.
- Use network-layer egress controls (firewalls, security groups) to restrict the server from reaching internal management networks or metadata endpoints.
- Decouple fetch logic into a hardened, least-privilege service with very limited network access, rather than running from the main application context.
- Apply conservative timeouts and response size limits to reduce abuse potential.
How teams detect issues like this
Detection typically involves a combination of code analysis and behavioral monitoring:
- Static analysis / code review:
- Search for HTTP client usage (e.g.,
HttpClient,RestTemplate,OkHttp, etc.) that takes URLs or hosts directly from request parameters or JSON bodies. - Flag any feature that "imports", "fetches", or "downloads" resources based on user-provided URLs, especially in
LocalFileServiceImpl.javaand related services. - Look for absence of domain allowlists, IP range checks, or protocol validation around outbound requests.
- Dynamic testing:
- Configure security tests that submit URLs pointing to internal-like hostnames or reserved IP ranges and observe if the application attempts connections.
- Monitor outbound traffic logs for unusual destinations triggered shortly after user interactions with image upload-by-URL features.
- Policy enforcement:
- Incorporate secure coding guidelines that prohibit unbounded outbound requests from user input.
- Use automated review tools or SAST rules tuned to SSRF patterns (user-controlled URL → outbound HTTP) as part of CI pipelines.

