A GoCardless live access token lets whoever holds it call the GoCardless API on your merchant account, according to the scope it was created with. A read-write token can create customers, set up Direct Debit mandates, collect payments and issue refunds, and any token can read customer names, addresses and bank account details held for your mandates. The main danger is therefore twofold: unauthorized payment activity and exposure of your customers’ personal and banking data. Revoke the token first, then investigate what it was used for.
Check your GitHub account for leaked secrets — free
- Provider
- GoCardless
- Severity
- High
- Impact
- Payments and customer data
- Checked live by LeakWatch
- No
What a GoCardless access token looks like
A live access token starts with live_ followed by a long string of letters, digits, dashes and underscores. The sandbox equivalent starts with sandbox_:
live_XXXXXXXX… GoCardless live access token (masked, 40 characters after the prefix)
sandbox_XXXXXXXX… sandbox token, no access to real money
The part after live_ is 40 characters long in the format this rule targets. You will usually find it in a variable such as GOCARDLESS_ACCESS_TOKEN, in an Authorization: Bearer header sent to the GoCardless API, or passed to a client library when it is initialised with the live environment. A sandbox_ token cannot touch real mandates, so it is far less urgent, but a live token is the case this guide is about. Do not confuse the access token with the webhook endpoint secret, which only verifies incoming webhooks, or with an OAuth client secret used by partners.
How GoCardless access tokens get leaked
- Environment files in the repository. A
.envorconfigfile with the live token committed alongside the application code. - Billing scripts and one-off tools. A script written to import mandates or collect a batch of payments, pushed with the token pasted at the top.
- Continuous integration logs. A deployment step that prints its environment, or a pipeline file with the token written in clear text.
- Departed team members. A token created by a former administrator is still valid after the person’s access is removed, so it can linger in old notes and repositories.
- Support requests and screenshots. A request to a developer or to a vendor that includes the header or a screen capture of the developer settings.
What to do in the first hour
- Create a replacement token first. In the developer section of the GoCardless dashboard, create a new access token with the narrowest scope the integration needs, and copy it immediately, because it is shown only once.
- Deploy the new token to your application or secret store and confirm that a test call works.
- Disable the exposed token. Open it in the dashboard and use the option that disables an access token. This takes effect on the token, so every system still holding the old value stops working.
- Audit recent activity. Review payments, mandates, refunds, payouts and customers created or changed since the exposure. Look for payments you did not request, customers you do not recognize, and bank account details that were changed.
- Check the API surface around it. Review webhook endpoints, other access tokens and the list of users, and remove anything unfamiliar. A webhook pointing at an unknown address is a way to keep receiving your data.
- Tell the right people. If the token could read customer data, check whether data protection rules require you to notify your customers or a regulator, and contact GoCardless support if you see suspicious payments.
- Clean up the code and look for other secrets in the same files. See I accidentally pushed an API key to GitHub.
Not sure what else leaked from the same repository? Run a free scan.
Revoke it at GoCardless
GoCardless access tokens are managed in the developer section of your GoCardless dashboard, after you sign in as a user allowed to manage them. Open the token list, select the exposed token and disable it. The support documentation notes that disabling a user does not disable the tokens that user created, so check for tokens left behind by former administrators. A person has not confirmed the exact menu wording for this guide, and the interface can change, so if the page differs from this description, look for the section where access tokens are listed, and follow the GoCardless documentation.
How LeakWatch detects it
The rule is called GoCardless API Token. It needs the word gocardless in the text, followed within a short distance by an assignment (=, :, => and similar separators, with optional quotes), and then a value that starts with live_ and has exactly 40 characters from letters, digits, dashes, underscores and equals signs. The value must be followed by a quote, a space, a semicolon, an escaped line break or the end of the line. A sandbox_ token, a live_ value of another length, or a token with no gocardless word nearby is not reported. The severity is high. This type is not checked live: LeakWatch does not send any request to GoCardless with the token it found.
LeakWatch detects this format but does not check it live: it can tell you the key is exposed, not whether it still works. Assume it does until you have revoked it.
FAQ
Can someone take money from my customers with this token?
If the token has write scope, it can create payments against existing mandates, which collects money by Direct Debit. A read-only token cannot, but it still exposes customer and bank details.
Is a sandbox token a problem?
A sandbox_ token only reaches the test environment, which holds no real mandates or money. Replace it when convenient, but a leaked live token comes first.
Will disabling the token break my billing?
Yes, for any system using it, until you deploy a new one. That is why you create the replacement first. If you see payments being abused, disable the old token at once.