Skip to content
Payments · Secret guide

Leaked Duffel API Token: what to do in the first hour

Critical severityDetected onlyLast verified · 5 min read

A live Duffel access token lets whoever holds it use the Duffel flights API as your company: searching offers, creating orders and booking flights, and, depending on the permissions chosen when the token was created, reading existing bookings with passenger names, contact details and travel dates. A read-write live token can create real orders that are paid from your Duffel balance or card, which is why the damage can be both financial and a privacy incident. A test token is far less serious but is still worth replacing. Delete the token first, then audit the orders.

Check your GitHub account for leaked secrets — free

Provider
Duffel
Severity
Critical
Impact
Payments and customer data
Checked live by LeakWatch
No

What a Duffel API token looks like

A Duffel token starts with duffel_, then the mode (test or live), then an underscore and 43 characters:

duffel_live_XXXX…XXXX   Duffel live access token (masked, 43 characters after the mode)
duffel_test_XXXX…XXXX   Duffel test access token (masked)

The 43-character body uses letters, digits, underscores, dashes and the equals sign, which is the usual URL-safe encoding. The mode matters. A duffel_test_ token only reaches resources created in test mode, with sandbox airlines and fake cards. A duffel_live_ token reaches real resources, and it can be made read-only or read-write at creation. The token is sent in an Authorization: Bearer header together with a Duffel-Version header, so search code and logs for both. Variable names are often DUFFEL_ACCESS_TOKEN or DUFFEL_API_KEY.

How Duffel API tokens get leaked

  • Hardcoded in a server script. A first integration test with the token typed into the client constructor and committed to the repository.
  • Environment files. DUFFEL_ACCESS_TOKEN in a .env, a compose file or a deployment manifest that is published by mistake.
  • Front-end bundles. A booking widget that calls Duffel directly from the browser, so the token ships to every visitor. Duffel calls are meant to be made from a server.
  • Sample and tutorial repositories. A copied example project keeps the author’s token in its configuration.
  • Logs and support requests. The Bearer header printed by an HTTP debug option or pasted in a bug report.

What to do in the first hour

  1. Open the access tokens page of the Duffel dashboard, in the mode that matches the leaked token (test or live), and find the exposed token. Match it by name and by its last characters.
  2. Create a replacement. Create a new token in the same mode. If the integration only searches and reads, create a read-only token; give read-write access only to the service that really creates orders.
  3. Deploy the new token to your server or secret store, and run one search to check that it works.
  4. Delete the exposed token from the same list. Then repeat a request with the old value to confirm that it is rejected.
  5. Audit the orders. In the dashboard, list orders, payments and cancellations created since the exposure. Look for bookings you do not recognize, unusual routes, many small orders, or passengers that are not your customers.
  6. Check money movement. Review the balance, top-ups and card payments linked to the account for unexpected charges, and contact Duffel support if you see fraudulent orders so they can be cancelled while that is still possible.
  7. Assess personal data. If the token could read orders, treat it as possible access to passenger details, and apply your breach-notification process if needed.
  8. Clean up the code and look for other secrets next to the token. See I accidentally pushed an API key to GitHub.

Not sure what else leaked from the same repository? Run a free scan.

Not sure what else leaked? Run a free scan.

Revoke it at Duffel

Duffel tokens are managed in the access tokens section of the Duffel dashboard, after you sign in. Switch to the right mode, open the exposed token and delete it. Duffel’s documentation describes creating a token in the dashboard and choosing read-only or read-write access; see the Duffel documentation on test mode and access tokens. Deleting a token makes it stop working, so every service that used it must be updated. A person has not confirmed the exact menu wording for this guide, and the interface can change, so if what you see differs, look for the section where tokens are listed, and follow Duffel’s documentation.

How LeakWatch detects it

The rule is called Duffel API Token. It matches the literal duffel_ followed by test or live, an underscore, and exactly 43 characters among letters, digits, underscore, dash and equals sign, with word boundaries on both sides. It needs no other word nearby. A body of another length, uppercase DUFFEL_, or any other mode name is not reported. The rule uses the same severity for both modes, which is critical, so a test token is reported as critical even though its real impact is lower. This type is not checked live: LeakWatch does not send the token to Duffel, so it cannot tell you whether the token is still valid or whether it is read-only.

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

My token is a test token. Can I ignore it?

Mostly, yes for the impact: a test token only reaches sandbox data. Still delete it, because test and live tokens often sit in the same file, and a leaked test token shows how the configuration is handled.

Can the token buy flights on my account?

A live read-write token can create orders, which Duffel then charges to your account. A read-only token cannot. Check the access level of the token in the dashboard and look at the orders created since the exposure.

Does deleting the token cancel bookings made with it?

No. Deleting only stops new calls. Orders already created stay in place, so review them and cancel or contact Duffel about any that are not yours.

Get alerted next time a secret leaks — create a free account

LeakWatch is not affiliated with Duffel.