--- url: >- https://developer-portal.gainsight.com/docs/custom-widgets/v2/content-security.md description: >- Automated pre-publish security scanning the platform runs on every push, with no configuration needed; for guidance on which customization approach to choose, see Customization Guardrails --- # Content Security The platform automatically checks your extension code — widgets, scripts, and stylesheets — for security issues before publishing. ## What the Platform Checks Every time you push code, the platform runs a series of checks before publishing your extensions. The sections below describe each check and the specific rules enforced. ### Content Scanning Your code is scanned for patterns that could harm your community. **Widgets**: For source widgets (directories of files), the platform scans HTML and JavaScript files (`.html`, `.htm`, `.js`, `.mjs`, `.jsx`). CSS, images, and fonts are not scanned since they cannot contain executable patterns. **Scripts**: JavaScript files are scanned for executable patterns and credential exposure. **Stylesheets**: CSS files are scanned for unsafe rules or obfuscated content. The platform checks for: | Category | What It Detects | Example | |----------|----------------|---------| | Crypto mining | Scripts that use visitor devices to mine cryptocurrency | `CoinHive`, WebAssembly mining modules | | Data exfiltration | Code that collects and sends user data to external servers | Keyloggers, cookie theft, form data harvesting | | Phishing | Fake login forms or redirects that assign external URLs to `window.location` | Credential harvesting pages, `window.location.href = "https://..."` | | Obfuscation | Heavily encoded or hidden code that obscures its purpose | `eval(atob(...))`, `eval(String.fromCharCode(...))` chains | | External script loading | Loading JavaScript from untrusted external sources | `