Summary
DataLinkDC Dinky's SQL Gateway may be vulnerable to server-side request forgery when SqlGateway.onOpen handles a manipulated connectAddress value. If the endpoint is reachable and an attacker can influence that value, the server may be induced to make requests to unintended destinations.
Affected context
The issue is reported in the SqlGateway.onOpen function in SqlGateway.java, within the SQL Gateway endpoint, in DataLinkDC Dinky versions up to 1.2.5. It may arise when the endpoint uses the supplied connectAddress to initiate a server-side connection without sufficiently restricting its destination.
Exploit preconditions
- Attack surface: The SQL Gateway endpoint must be reachable by the attacker.
- Required access: The attacker must be able to submit or influence the
connectAddressargument; the description does not specify whether authentication is required. - Trigger point: The endpoint processes the argument in
SqlGateway.onOpen. - Why exploitation is possible: If the value can direct server-side requests to destinations that are not appropriately restricted, the server may access resources on the attacker's behalf.
Why this happens
The underlying issue is insufficient control over a destination used for server-side network requests. When an application accepts an attacker-influenced address and uses it without adequate destination validation, it can make requests to unintended systems. This behavior maps to CWE-918: Server-Side Request Forgery (SSRF).
Potential impact
- The server may make requests to internal or otherwise unintended services.
- Responses from reachable services could be exposed to the requester, depending on how the application handles them.
- Requests could reach sensitive services or trigger actions, depending on network access and the behavior of those services.
General mitigation guidance
Common defensive patterns focus on reducing control over outbound request destinations:
- Prefer selecting destinations from a trusted, predefined set rather than accepting arbitrary addresses.
- Validate and canonicalize destinations, and enforce controls on resolved addresses and redirect behavior.
- Apply network egress restrictions so the service can reach only required systems.
- Avoid exposing sensitive response details from server-side requests.
- Run the service with the least network and system privileges needed.
How teams detect issues like this
- Review code paths that use
connectAddressor other user-controlled values to initiate network connections. - Use static analysis to flag outbound request APIs whose destinations originate from untrusted inputs.
- Monitor SQL Gateway traffic and outbound connections for unexpected destinations or unusual request patterns.
- Enforce code-review and CI policies requiring destination validation and documented egress controls.

