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

NPM Token detected in code

Rule Details

Cortex AppSec Rule ID

APPSEC_SECRET_12

Category

Sensitive Tokens

Severity

LOW

Framework

Git

Impact

The NPM Token authenticates the user or system to the NPM registry for operations like publishing, modifying, and deleting packages.

Compromise of this token enables an attacker to perform unauthorized package management operations, which could result in malicious code injection into downstream dependencies or complete package takeover.

How to Fix

To remediate exposed Source Control or CI/CD tokens:

  1. Log in to the relevant system or provider.

  2. Navigate to the settings menu to locate the exposed credential.

  3. Revoke or delete the compromised token immediately.

  4. Generate a new token if continued access is required.

  5. Update any dependent systems or services with the new credential.

Next, remove the secret from your codebase:

  1. Locate the exposed secret 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?