Skip to main content
CriticalSecretsOWASP A07:2021CWE-798

How to fix: Resend API key in source

Resend API keys (re_*) grant the ability to send email from your verified sending domains and read email/audience data.

Why it matters

An exposed Resend API key lets an attacker send unlimited email from your verified sending domain, launching phishing campaigns that appear to come from your organization, damaging your domain reputation and potentially getting it blacklisted. Depending on key permissions, it may also expose stored audiences, contacts, and email logs.

Resend API keys (re_*) grant the ability to send email from your verified sending domains and read email/audience data.

How to fix it

  1. 1Revoke the key at resend.com → API Keys
  2. 2Create a new key scoped to 'Sending access' only, not 'Full access', unless audience/domain management is required
  3. 3Keep Resend API calls server-side only; never expose the key in browser bundles

Code examples

Next.js Route Handler: server-side Resend usage

TypeScript
// app/api/send/route.ts: server-only
import { Resend } from 'resend';
import { NextResponse } from 'next/server';

const resend = new Resend(process.env.RESEND_API_KEY!); // server-only

export async function POST(req: Request) {
  const { to, subject, html } = await req.json();
  const { data, error } = await resend.emails.send({
    from: '[email protected]',
    to,
    subject,
    html,
  });
  if (error) return NextResponse.json({ error }, { status: 500 });
  return NextResponse.json({ data });
}

References

Detected automatically by VulnRadar. The check id is secret-resend-api-key, stable across every scan so you can filter or diff on it.

See every secrets check

Questions

How severe is Resend API key in source?
VulnRadar rates this critical severity in the secrets category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
Does VulnRadar check for this automatically?
Yes. It runs as part of every scan under the check id secret-resend-api-key, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does Resend API key in source map to?
It maps to CWE-798. In the OWASP Top 10 it falls under A07:2021.

Missing a check?

The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.

Propose a checkHow a check is built

Scan your own site for resend api key in source

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

How to fix: Resend API key in source | VulnRadar