Interlace ESLint
ESLint Interlace
Secure CodingRules

no-sensitive-data-exposure

ESLint Rule: no-sensitive-data-exposure. This rule is part of [`eslint-plugin-secure-coding`](https://www.npmjs.com/package/eslint-plugin-secure-coding).

Keywords: no sensitive data exposure, security, ESLint rule, JavaScript, TypeScript, CWE-532

ESLint Rule: no-sensitive-data-exposure. This rule is part of eslint-plugin-secure-coding.

Quick Summary

AspectDetails
CWE ReferenceCWE-200 (Information Exposure)
SeverityHigh (security vulnerability)
Auto-Fix❌ No
CategorySecurity
ESLint MCP✅ Optimized for ESLint MCP integration
Best ForApplications handling PII

Vulnerability and Risk

Vulnerability: Sensitive data exposure happens when an application inadequately protects sensitive information such as passwords, financial data, or health records.

Risk: Attackers can access this data to conduct identity theft, credit card fraud, or further attacks on the system. It often leads to severe regulatory penalties (GDPR, PCI-DSS compliance failure).

Error Message Format

The rule provides LLM-optimized error messages (Compact 2-line format) with actionable security guidance:

⚠️ CWE-532 OWASP:A09 CVSS:5.3 | Log Information Exposure detected | MEDIUM [GDPR,HIPAA,PCI-DSS,SOC2]
   Fix: Review and apply the recommended fix | https://owasp.org/Top10/A09_2021/

Message Components

ComponentPurposeExample
Risk StandardsSecurity benchmarksCWE-532 OWASP:A09 CVSS:5.3
Issue DescriptionSpecific vulnerabilityLog Information Exposure detected
Severity & ComplianceImpact assessmentMEDIUM [GDPR,HIPAA,PCI-DSS,SOC2]
Fix InstructionActionable remediationFollow the remediation steps below
Technical TruthOfficial referenceOWASP Top 10

Rule Details

Why This Matters

IssueImpactSolution
🔒 Security/Code Quality[Specific issue][Solution approach]
🐛 Maintainability[Impact][Fix]
Performance[Impact][Optimization]

Configuration

No configuration options available.

Examples

❌ Incorrect

// Example of incorrect usage

✅ Correct

// Example of correct usage

Configuration Examples

Basic Usage

// eslint.config.mjs
export default [
  {
    rules: {
      'secure-coding/no-sensitive-data-exposure': 'error',
    },
  },
];

LLM-Optimized Output

🚨 no sensitive data exposure | Description | MEDIUM
   Fix: Suggestion | Reference

Known False Negatives

The following patterns are not detected due to static analysis limitations:

Values from Variables

Why: Values stored in variables are not traced.

// ❌ NOT DETECTED - Value from variable
const value = userInput;
dangerousOperation(value);

Mitigation: Validate all user inputs.

Wrapper Functions

Why: Custom wrappers not recognized.

// ❌ NOT DETECTED - Wrapper
myWrapper(userInput); // Uses dangerous API internally

Mitigation: Apply rule to wrapper implementations.

Dynamic Invocation

Why: Dynamic calls not analyzed.

// ❌ NOT DETECTED - Dynamic
obj[method](userInput);

Mitigation: Avoid dynamic method invocation.

Further Reading

On this page