Summary
A server-side request forgery (SSRF) vulnerability in BuildingAI's Remote Upload API allows attackers to control the URL parameter used by the backend to fetch remote files.
When abused, this can coerce the server into making arbitrary outbound HTTP requests, potentially reaching internal services or metadata endpoints that are not directly exposed to the internet.
Affected context
The vulnerability resides in the uploadRemoteFile function within packages/core/src/modules/upload/services/file-storage.service.ts of the BuildingAI application.
It affects deployments where the Remote Upload API is exposed and accepts a user-provided url parameter that the server then uses to download content.
Risk increases in environments where the application server can reach internal services, cloud metadata endpoints, or other sensitive network locations not intended for public access.
Exploit preconditions
- Attack surface: The Remote Upload API endpoint that supports fetching files from a user-supplied URL.
- Required access: Ability to send HTTP requests to the affected API (typically over the public internet or from any client that can reach the service).
- Trigger point: Supplying a crafted
urlargument that points to internal or otherwise sensitive network locations. - Why exploitation is possible: The implementation forwards the user-controlled
urldirectly to server-side HTTP client logic without sufficient validation, restriction, or network-level egress controls, enabling arbitrary outbound requests from the server's network context.
Why this happens
This issue is a classic instance of CWE-918: Server-Side Request Forgery (SSRF).
The uploadRemoteFile function appears to trust the url parameter and uses it directly to initiate server-side HTTP requests.
Without robust validation (such as strict allowlists, hostname/IP checks, and scheme enforcement) and without isolating outbound network access, user input effectively controls where the server connects.
This breaks the intended network trust boundaries by turning the application into a proxy capable of reaching targets the attacker cannot access directly.
Potential impact
- The server may be used to probe and scan internal network services that are not exposed externally.
- Attackers could access sensitive internal HTTP endpoints, such as admin panels, APIs, or debugging interfaces.
- In cloud environments, the vulnerability can potentially reach metadata services, which may lead to credential exposure and privilege escalation.
- The server could be abused as part of a pivoting strategy for further lateral movement within the infrastructure.
- The application might be coerced into interacting with attacker-controlled endpoints, enabling secondary attacks such as response-based data exfiltration or logging-based injection.
General mitigation guidance
Effective mitigation centers on strictly controlling how remote URLs are accepted and used by server-side components:
- Apply a positive security model (allowlist) for outbound destinations or domains that the Remote Upload API is allowed to contact.
- Enforce URL validation rules, including allowed schemes (e.g., HTTPS only), disallowing IP literals, localhost, and private or link-local address ranges.
- Perform DNS resolution and IP range checks server-side before making any outbound request, and re-validate post-resolution to prevent DNS rebinding issues.
- Separate and constrain egress network access for the service using firewall rules, VPC controls, or container-level network policies, so that the component cannot reach sensitive internal systems by default.
- Consider replacing generic "download from arbitrary URL" functionality with controlled integration endpoints or pre-registered sources, reducing or eliminating user-controlled destination URLs.
- Log and monitor outbound requests from this feature, and alert on suspicious patterns such as requests to internal IP ranges or unusual hostnames.
How teams detect issues like this
Detection of SSRF issues typically combines code-centric and environment-centric approaches:
- Static analysis and code review:
- Flag functions where user-supplied URL or host parameters are passed into HTTP clients (e.g.,
fetch,axios,http.request) without allowlist checks or scheme/host validation. - Identify upload or import flows that accept arbitrary URLs and lack explicit filtering of internal address ranges and non-HTTP protocols.
- Review error handling and logging around remote fetches to ensure no sensitive response data is inadvertently exposed to clients.
- Automated testing and fuzzing:
- Use security tests that try internal addresses (e.g.,
127.0.0.1,169.254.169.254, RFC1918 ranges) and verify that the service rejects them. - Employ DAST tools configured with SSRF test payloads targeting local and internal endpoints.
- Operational monitoring:
- Monitor outbound traffic patterns from the application for unusual destinations, particularly internal IPs or cloud metadata endpoints.
- Use network policies and egress filtering logs to detect blocked requests that originate from user-driven features like remote upload.

