Mailgun Key

ID

mailgun_key

Severity

high

Vendor

Mailgun

Family

API Token

Description

Mailgun provides APIs for accessing email sending and management services. The Mailgun Key is used to authenticate API requests to access these services and resources.

Security

Any hardcoded Mailgun Key is a potential secret reported by this detector.

Accidentally checking-in the key to source control repositories could compromise your Mailgun account, potentially leading to unauthorized access to email sending capabilities and sensitive email data.

Examples

mailgun_api_key = "key-9mX7bC6fj8V6pR4lQ9H5T3zJ1oZ2D3F"

Mitigation / Fix

  1. Remove the API Key from the source code or committed configuration file.

  2. Follow your policy for handling leaked secrets, which typically require revoking the secret in the target system(s). Go to your settings page in the Mailgun dashboard to revoke the key.

  3. If under a git repository, you may remove unwanted files from the repository history using tools like git filter-repo or BFG Repo-Cleaner. You may follow the procedure listed here for GitHub.

You should consider any sensitive data in commits with secrets as compromised.

Remember that secrets may be removed from history in your projects, but not in other users' cloned or forked repositories.