Skip to content
Messaging · Secret guide

Leaked Mailjet SMS API Key: what to do in the first hour

High severityDetected onlyLast verified · 4 min read

A Mailjet SMS API key is the credential that lets a program send text messages through Mailjet’s SMS service. It is separate from the key used for Mailjet’s email API. Whoever holds it can send SMS messages billed to your account, under your sender name, to any number they choose. The direct harm is usually fraud and cost: unwanted messages to your customers, a large bill and damage to your sender reputation. The key can also be used to test which numbers are active, so it should be removed quickly.

Check your GitHub account for leaked secrets — free

Provider
Mailjet SMS
Severity
High
Impact
SaaS account access and billing
Checked live by LeakWatch
No

What a Mailjet SMS API key looks like

The SMS credential is a long string of letters and digits, about 32 characters in the form the rule expects. Mailjet’s SMS service authenticates with a bearer token, which is sent in the authorization header of each request. The value has no public prefix, so it is recognized by its context, usually a variable or setting whose name contains the word mailjet:

MAILJET_SMS_TOKEN=<32-character value, masked as XXXX…>

The SMS token is separate from the email API key and secret pair, so a leaked email key does not automatically expose SMS, and the reverse is also true. Check which service a leaked value belongs to before you decide what else to rotate. Third-party integration guides say the SMS token is generated from the SMS section of the Mailjet account.

How Mailjet SMS keys get leaked

  • Notification code. An application that sends order or login messages, with the token in its source code or in a settings file that was committed.
  • Automation tools. A workflow tool or a plug-in configured with the token, where the configuration is exported and shared.
  • Shared examples. A code sample pasted into a tutorial or a support thread, with the real token left in place of the placeholder.
  • CI logs. A deployment step that prints the environment or the full request, including the authorization header.
  • Front-end code. A token placed in a browser application, where anyone can read it in the developer tools.

What to do in the first hour

  1. Revoke the token. Sign in to Mailjet and open the SMS section of your account. Find the token and remove it, then generate a new one. Do this before you clean the repository, because a token keeps working until it is removed.
  2. Update the sending services with the new token, stored in a secret manager or an environment variable. Send one test message to a number you control to confirm the service works.
  3. Check the send log. Open the SMS history for the period since the token may have been exposed. Look for messages you did not send, for bursts at unusual hours, and for many messages to unfamiliar numbers, which can be a sign of number testing.
  4. Check the billing. Review the charges for the same period and compare them with your normal volume. Ask Mailjet about any charges you cannot explain.
  5. Check the other secrets in the same file. Messaging setups often hold keys for several providers, such as an email service and a voice service, so rotate those too.
  6. Clean the repository after the rotation: remove the value from the files, add the file to .gitignore and decide whether to rewrite history. An old clone still holds the value until it is deleted.

Not sure what else leaked? Run a free scan.

Not sure what else leaked? Run a free scan.

Revoke it at Mailjet

Sign in to Mailjet and open the account settings, then the SMS area of the account. Remove the leaked token and create a new one for the service that needs it. Mailjet’s developer documentation covers the SMS send request and the authorization header, but we could not confirm from its pages the exact menu wording or whether a token can be regenerated in place during this review. Check the labels in the dashboard when you act, and ask Mailjet support if the token is not listed where described.

How LeakWatch detects it

The rule is called Mailjet SMS API Key. It looks for the word mailjet close to a standalone value of exactly 32 letters or digits, with a separator such as an equals sign, a colon or a comma between them. A 32-character string with no Mailjet context nearby is not reported, and an email-only key with a different shape is handled by its own rule if one exists. The severity is high, with the impact class for SaaS services. This type is not checked live: LeakWatch does not send the value to Mailjet.

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 a leaked SMS token send email as well?

Not normally. The SMS token is for the SMS service. Email uses a separate key and secret, so check the Mailjet account for email credentials if the same file held them.

How do I stop sending from a leaked token straight away?

Remove the token in the SMS section of the account. The removal stops new requests that use it, so do it before you clean anything else.

Should I tell my customers?

Only if unwanted messages reached them. If they did, a short notice explaining that some texts were sent in error, and that you have fixed the issue, is usually enough, and it also protects your sender reputation.

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

LeakWatch is not affiliated with Mailjet SMS.