Skip to content

Conversation

@pablomendezroyo
Copy link
Contributor

Potential fix for https://github.com/dappnode/DNP_DAPPMANAGER/security/code-scanning/8

To fix the SSRF vulnerability, restrict the use of the device parameter when constructing outgoing URLs. The safest way is to only permit requests for devices that are already registered (i.e., present in the list returned by getDevices()), so unregistered or fabricated device names cannot be used to target arbitrary endpoints of the backend API service. Specifically, in WireguardClient.getDeviceCredentials, check if the passed device name is present in the wireguard devices list before constructing and calling the backend API endpoint. If the device is not permitted, throw an error.

Files/regions to change:

  • In WireguardClient.getDeviceCredentials() method (in packages/dappmanager/src/calls/wireguard.ts): Before URL construction and API calls, check that the device exists in the output of getDevices().
  • No need to change validation regex, but placement and enforced existence must be checked.
  • No changes in other files required.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@github-actions github-actions bot temporarily deployed to commit September 10, 2025 08:19 Inactive
@github-actions github-actions bot temporarily deployed to commit September 10, 2025 08:19 Inactive
@github-actions
Copy link

@pablomendezroyo pablomendezroyo marked this pull request as ready for review September 10, 2025 08:25
@pablomendezroyo pablomendezroyo requested a review from a team as a code owner September 10, 2025 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants