Summary
A server-side request forgery vulnerability in n8n's Instance AI credential setup flow allows attacker-influenced content to affect the destination of credential tests or verification requests.
When the setup flow processes a manipulated URL, authenticated requests, redirects, or network probes may reach an unintended origin, potentially exposing sensitive services or credentials.
Affected context
The issue can occur in n8n deployments using the Instance AI credential setup flow when fetched, attacker-influenced content can affect the credential test or verification URL. The vulnerable logic does not reliably confirm that the selected URL belongs to the workflow node's expected origin before making a request.
Exploit preconditions
- Attack surface: Instance AI credential setup and verification workflow
- Required access: Ability to introduce or influence content processed by the setup flow; an authenticated user may also need to complete or trigger the credential setup interaction
- Trigger point: Credential testing, verification, redirect handling, or related origin derivation
- Why exploitation is possible: The requested URL can be influenced without sufficient validation that it matches the workflow node's trusted origin
Why this happens
The underlying flaw is insufficient server-side validation of a destination URL before the application performs a request. Origin derivation and request routing rely on attacker-influenced data without enforcing an appropriate same-origin or allowlisted-origin relationship.
This maps to CWE-918: Server-Side Request Forgery, in which application-side network functionality can be redirected toward attacker-selected or otherwise unintended resources.
Potential impact
- The server may make authenticated requests to an unintended origin
- Internal services or metadata endpoints could be probed
- Response data or credential-related information could be exposed
- Redirects could extend access beyond the initially supplied destination
- Network boundaries and service trust relationships could be bypassed
General mitigation guidance
Mitigation generally focuses on making outbound request destinations explicit, validated, and independent of untrusted content.
Common defensive patterns include:
- Deriving destinations from trusted server-side configuration rather than fetched content
- Enforcing strict origin or hostname allowlists before every outbound request
- Validating redirects and preventing transitions to unapproved origins
- Separating credential-bearing requests from general-purpose URL fetching
- Restricting outbound network access from application workers
- Running services with least-privilege credentials and network permissions
- Avoiding disclosure of detailed responses from internal or protected destinations
How teams detect issues like this
Organizations can look for SSRF risks through:
- Static analysis rules targeting user-controlled URLs passed to HTTP clients
- Code review checks for missing origin, hostname, scheme, port, and redirect validation
- Tests that attempt cross-origin, internal-address, metadata-service, and redirect-based destinations
- Network egress monitoring for unexpected requests from workflow and credential components
- Policy enforcement requiring approved destination registries for server-side HTTP requests
- Automated security review tools that identify tainted URL data reaching outbound request APIs

