Skip to main content
LowSecretsOWASP A07:2021CWE-798

How to fix: Twilio Account SID in source

Twilio Account SIDs (AC*) are not strictly secret but should not be public.

Why it matters

Twilio Account SIDs are semi-public and require a paired auth token to perform any sensitive operations. However, knowing your Account SID combined with other leaked credentials enables account takeover. The SID alone leaks your Twilio account association.

Twilio Account SIDs (AC*) are not strictly secret but should not be public.

How to fix it

  1. 1Move the SID to a server-side environment variable as a precaution
  2. 2Ensure the paired Twilio auth token is never exposed client-side
  3. 3If the auth token is also exposed, rotate it immediately in the Twilio console

Code examples

Store Twilio credentials server-side only

TypeScript
// Server-side only: never import in client components
import twilio from 'twilio';

const client = twilio(
  process.env.TWILIO_ACCOUNT_SID,   // AC...: server-only
  process.env.TWILIO_AUTH_TOKEN     // never expose this
);

References

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

See every secrets check

Questions

How severe is Twilio Account SID in source?
VulnRadar rates this low 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-twilio-account-sid, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does Twilio Account SID 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 twilio account sid 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: Twilio Account SID in source | VulnRadar