For the complete documentation index, see llms.txt. This page is also available as Markdown.
Cortex CloudApplication Security

Midtrans API Key detected in code

Rule Details

Cortex AppSec Rule ID

APPSEC_SECRET_272

Category

Secrets

Severity

MEDIUM

Framework

Git

Impact

The Midtrans API Key (Client/Server Key pair) authenticates with the payment gateway.

Exposure is an Extremely Critical Risk, granting an attacker access to payment processing capabilities, which could result in fraudulent transactions, theft of funds, and severe data breaches.

How to Fix

To remediate exposed API & Service Keys:

  1. Log in to the service provider's dashboard.

  2. Navigate to the API or credentials settings to locate the exposed key.

  3. Rotate or regenerate the compromised key immediately.

  4. Update your application configuration or environment variables with the new key.

Next, remove the secret from your codebase:

  1. Locate the exposed key in your codebase.

  2. Replace the hardcoded value with a secure variable or reference.

Finally, clean your version control history:

  1. Permanently remove the sensitive data from your version control history to ensure it cannot be retrieved.

Last updated

Was this helpful?