/** * Copyright (c) 2025 Ofri Peretz * Licensed under the MIT License. Use of this source code is governed by the * MIT license that can be found in the LICENSE file. */ /** * ESLint Rule: no-electron-security-issues * Detects Electron security vulnerabilities (CWE-16) * * Electron applications can be vulnerable to security issues when not properly * configured. This rule detects insecure Electron configurations and patterns * that could allow privilege escalation, code execution, or data leakage. * * False Positive Reduction: * This rule uses security utilities to reduce false positives by detecting: * - Safe Electron configurations * - Development vs production environments * - JSDoc annotations (@electron-safe, @dev-only) * - Trusted Electron security patterns */ import type { TSESLint } from '@interlace/eslint-devkit'; import { type SecurityRuleOptions } from '@interlace/eslint-devkit'; type MessageIds = 'electronSecurityIssue' | 'nodeIntegrationEnabled' | 'contextIsolationDisabled' | 'webSecurityDisabled' | 'insecureContentEnabled' | 'unsafePreloadScript' | 'directNodeAccess' | 'insecureIpcPattern' | 'missingSandbox' | 'enableSecurityFeatures' | 'useContextIsolation' | 'securePreloadScripts' | 'strategySecureDefaults' | 'strategyProcessSeparation' | 'strategyInputValidation'; export interface Options extends SecurityRuleOptions { /** Allow insecure settings in development */ allowInDev?: boolean; /** Safe preload script patterns */ safePreloadPatterns?: string[]; /** Allowed IPC channels */ allowedIpcChannels?: string[]; } type RuleOptions = [Options?]; export declare const noElectronSecurityIssues: TSESLint.RuleModule & { name: string; }; export {};