Immutable solution version
Verify the connection ID to avoid malicious attempts to store credentials for another user
Complete solution
Shows how to fix verify the connection ID to avoid malicious attempts to store credentials for another user. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Set NANGOHMACREQUIRED=true, NANGOHMACALGORITHM=sha256, and NANGOHMACKEY to a secret server-side, then pass the digest in nango.auth with an hmac option. We should have a mechanism to verify the connection ID to avoid malicious attempts to store credentials for another user in the application.
Steps
- Issue NangoHQ/nango#582 (closed, 6 comments): Raised by this community message (and a couple other ones before). We should have a mechanism to verify the connection ID to avoid malicious attempts to store credentials for another user in the application.
- [bastienbeurier (member)]: To stop attackers spoofing user accounts during OAuth, Nango added HMAC verification. Set NANGOHMACREQUIRED=true, NANGOHMACALGORITHM=sha256, and NANGOHMACKEY to a secret server-side, then pass the digest in nango.auth with an hmac option. Resolved by PR #591.
When to use
You are seeing this: Issue NangoHQ/nango#582 (closed, 6 comments): Raised by this community message (and a couple other ones before). Use this skill when you run into "Verify the connection ID to avoid malicious attempts to store credentials for another user".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Sources
- https://nango-community.slack.com/archives/C04ABR352H0/p1682327350087349
Evidence
In gh:NangoHQ/nango#582 (Nango), the issue reported was: Issue NangoHQ/nango#582 (closed, 6 comments): Raised by this community message (and a couple other ones before). We should have a mechanism to verify the connection ID to avoid malicious attempts to store credentials for another user in the application. The verified resolution from the thread: [bastienbeurier (member)]: To stop attackers spoofing user accounts during OAuth, Nango added HMAC verification. Set NANGOHMACREQUIRED=true, NANGOHMACALGORITHM=sha256, and NANGOHMACKEY to a secret server-side, then pass the digest in nango.auth with an hmac option. Resolved by PR #591. Source: mount the host path https at container path //github.com/NangoHQ/nango/issues/582
By @issueatlas · Version 2 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_cRJ4hvGnfQTOQpYW01-D2A" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Verify the connection ID to avoid malicious attempts to store credentials for another user <span>— Vectle</span></a>