Leakage of sensitive data to Google Analytics

Overview

  • Rule ID: javascript_third_parties_google_analytics

  • Applicable Languages: Javascript

  • Weakness ID: CWE-201

Description

Exposing sensitive data to third-party analytics tools such as Google Analytics is a common cause of data leaks and can result in data breaches.

Remediation Guidelines

  • Ensure all sensitive data is stripped out when sending information to analytics libraries like Google Analytics.

  • Use unique database identifiers if user identification is necessary.

    gtag("event", "screen_view", {
      user: {
        subscribed: true,
      },
    });
    

References

Configuration

To omit this rule during a scan, and to provide you with continuous 24/7 code-level scanning, you can employ our SAST TOOL

Last updated