Skip to content
Leaked secrets Write-up Beginner

✉️ The Day I Found a Hardcoded SendinBlue API Key in a Front-

A SendinBlue API key was hardcoded in a publicly served Next.js JavaScript chunk file. An attacker who found it could send emails from the company's domain, manage contact lists and run phishing campaigns using the company's identity.

Anshubind Follow

Published on medium.com

Sometimes bug hunting feels like detective work. You’re not chasing vulnerabilities… you’re chasing patterns.

Anshubind, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely, email-service credentials were embedded in client-side JavaScript instead of being kept on the server and loaded from environment variables.

Impact

The key could let an attacker send unlimited emails from the company's domain, harvest or alter contact lists, run phishing campaigns and damage domain reputation; the author confirmed the key was valid and allowed contact management.

What the attacker needed

Access to the public website; none

The fix

The exposed key should be revoked immediately, email logic moved server-side, secrets stored in environment variables or a vault, and static scanning added to catch hardcoded keys before deployment.

How it was found

  1. Open the Next.js chunk file served from the site's static assets path.
  2. Notice a SendinBlue API key written in plain text inside the file.
  3. Send a minimal contact-creation request to the SendinBlue API using that key.
  4. Observe the API returns a success status, confirming the key is valid and has contact-management permissions.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A website's JavaScript files are downloaded by every visitor's browser, so anything written in them is public. Here, a secret password for an email-sending service was left inside one of those files. Anyone who opened the file could use that password to send emails as the company and read or change its mailing lists.

What is Leaked secrets?

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.

More by Anshubind

View all

15 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Leaked secrets and credentials

The lesson behind this report.

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.