eslint-plugin-sdl-2 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5316 -0
- package/LICENSE +21 -0
- package/README.md +133 -0
- package/dist/_internal/ast-utils.d.ts +17 -0
- package/dist/_internal/ast-utils.d.ts.map +1 -0
- package/dist/_internal/ast-utils.js +93 -0
- package/dist/_internal/ast-utils.js.map +1 -0
- package/dist/_internal/config-references.d.ts +5 -0
- package/dist/_internal/config-references.d.ts.map +1 -0
- package/dist/_internal/config-references.js +13 -0
- package/dist/_internal/config-references.js.map +1 -0
- package/dist/_internal/create-rule.d.ts +9 -0
- package/dist/_internal/create-rule.d.ts.map +1 -0
- package/dist/_internal/create-rule.js +6 -0
- package/dist/_internal/create-rule.js.map +1 -0
- package/dist/_internal/domparser.d.ts +19 -0
- package/dist/_internal/domparser.d.ts.map +1 -0
- package/dist/_internal/domparser.js +45 -0
- package/dist/_internal/domparser.js.map +1 -0
- package/dist/_internal/electron-web-preferences.d.ts +14 -0
- package/dist/_internal/electron-web-preferences.d.ts.map +1 -0
- package/dist/_internal/electron-web-preferences.js +63 -0
- package/dist/_internal/electron-web-preferences.js.map +1 -0
- package/dist/_internal/estree-utils.d.ts +51 -0
- package/dist/_internal/estree-utils.d.ts.map +1 -0
- package/dist/_internal/estree-utils.js +112 -0
- package/dist/_internal/estree-utils.js.map +1 -0
- package/dist/_internal/node-tls-config.d.ts +44 -0
- package/dist/_internal/node-tls-config.d.ts.map +1 -0
- package/dist/_internal/node-tls-config.js +101 -0
- package/dist/_internal/node-tls-config.js.map +1 -0
- package/dist/_internal/rules-registry.d.ts +10 -0
- package/dist/_internal/rules-registry.d.ts.map +1 -0
- package/dist/_internal/rules-registry.js +148 -0
- package/dist/_internal/rules-registry.js.map +1 -0
- package/dist/_internal/script-element.d.ts +7 -0
- package/dist/_internal/script-element.d.ts.map +1 -0
- package/dist/_internal/script-element.js +46 -0
- package/dist/_internal/script-element.js.map +1 -0
- package/dist/_internal/worker-code-loading.d.ts +69 -0
- package/dist/_internal/worker-code-loading.d.ts.map +1 -0
- package/dist/_internal/worker-code-loading.js +134 -0
- package/dist/_internal/worker-code-loading.js.map +1 -0
- package/dist/plugin.cjs +6036 -0
- package/dist/plugin.cjs.map +7 -0
- package/dist/plugin.d.cts +11 -0
- package/dist/plugin.d.ts +11 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +235 -0
- package/dist/plugin.js.map +1 -0
- package/dist/rules/no-angular-bypass-sanitizer.d.ts +5 -0
- package/dist/rules/no-angular-bypass-sanitizer.d.ts.map +1 -0
- package/dist/rules/no-angular-bypass-sanitizer.js +32 -0
- package/dist/rules/no-angular-bypass-sanitizer.js.map +1 -0
- package/dist/rules/no-angular-bypass-security-trust-html.d.ts +5 -0
- package/dist/rules/no-angular-bypass-security-trust-html.d.ts.map +1 -0
- package/dist/rules/no-angular-bypass-security-trust-html.js +51 -0
- package/dist/rules/no-angular-bypass-security-trust-html.js.map +1 -0
- package/dist/rules/no-angular-innerhtml-binding.d.ts +5 -0
- package/dist/rules/no-angular-innerhtml-binding.d.ts.map +1 -0
- package/dist/rules/no-angular-innerhtml-binding.js +57 -0
- package/dist/rules/no-angular-innerhtml-binding.js.map +1 -0
- package/dist/rules/no-angular-sanitization-trusted-urls.d.ts +5 -0
- package/dist/rules/no-angular-sanitization-trusted-urls.d.ts.map +1 -0
- package/dist/rules/no-angular-sanitization-trusted-urls.js +32 -0
- package/dist/rules/no-angular-sanitization-trusted-urls.js.map +1 -0
- package/dist/rules/no-angularjs-bypass-sce.d.ts +5 -0
- package/dist/rules/no-angularjs-bypass-sce.d.ts.map +1 -0
- package/dist/rules/no-angularjs-bypass-sce.js +80 -0
- package/dist/rules/no-angularjs-bypass-sce.js.map +1 -0
- package/dist/rules/no-angularjs-enable-svg.d.ts +5 -0
- package/dist/rules/no-angularjs-enable-svg.d.ts.map +1 -0
- package/dist/rules/no-angularjs-enable-svg.js +48 -0
- package/dist/rules/no-angularjs-enable-svg.js.map +1 -0
- package/dist/rules/no-angularjs-ng-bind-html-without-sanitize.d.ts +5 -0
- package/dist/rules/no-angularjs-ng-bind-html-without-sanitize.d.ts.map +1 -0
- package/dist/rules/no-angularjs-ng-bind-html-without-sanitize.js +64 -0
- package/dist/rules/no-angularjs-ng-bind-html-without-sanitize.js.map +1 -0
- package/dist/rules/no-angularjs-sanitization-whitelist.d.ts +5 -0
- package/dist/rules/no-angularjs-sanitization-whitelist.d.ts.map +1 -0
- package/dist/rules/no-angularjs-sanitization-whitelist.js +32 -0
- package/dist/rules/no-angularjs-sanitization-whitelist.js.map +1 -0
- package/dist/rules/no-angularjs-sce-resource-url-wildcard.d.ts +5 -0
- package/dist/rules/no-angularjs-sce-resource-url-wildcard.d.ts.map +1 -0
- package/dist/rules/no-angularjs-sce-resource-url-wildcard.js +69 -0
- package/dist/rules/no-angularjs-sce-resource-url-wildcard.js.map +1 -0
- package/dist/rules/no-child-process-exec.d.ts +5 -0
- package/dist/rules/no-child-process-exec.d.ts.map +1 -0
- package/dist/rules/no-child-process-exec.js +141 -0
- package/dist/rules/no-child-process-exec.js.map +1 -0
- package/dist/rules/no-child-process-shell-true.d.ts +5 -0
- package/dist/rules/no-child-process-shell-true.d.ts.map +1 -0
- package/dist/rules/no-child-process-shell-true.js +89 -0
- package/dist/rules/no-child-process-shell-true.js.map +1 -0
- package/dist/rules/no-cookies.d.ts +5 -0
- package/dist/rules/no-cookies.d.ts.map +1 -0
- package/dist/rules/no-cookies.js +38 -0
- package/dist/rules/no-cookies.js.map +1 -0
- package/dist/rules/no-document-domain.d.ts +5 -0
- package/dist/rules/no-document-domain.d.ts.map +1 -0
- package/dist/rules/no-document-domain.js +41 -0
- package/dist/rules/no-document-domain.js.map +1 -0
- package/dist/rules/no-document-execcommand-insert-html.d.ts +5 -0
- package/dist/rules/no-document-execcommand-insert-html.d.ts.map +1 -0
- package/dist/rules/no-document-execcommand-insert-html.js +57 -0
- package/dist/rules/no-document-execcommand-insert-html.js.map +1 -0
- package/dist/rules/no-document-parse-html-unsafe.d.ts +5 -0
- package/dist/rules/no-document-parse-html-unsafe.d.ts.map +1 -0
- package/dist/rules/no-document-parse-html-unsafe.js +67 -0
- package/dist/rules/no-document-parse-html-unsafe.js.map +1 -0
- package/dist/rules/no-document-write.d.ts +5 -0
- package/dist/rules/no-document-write.d.ts.map +1 -0
- package/dist/rules/no-document-write.js +40 -0
- package/dist/rules/no-document-write.js.map +1 -0
- package/dist/rules/no-domparser-html-without-sanitization.d.ts +5 -0
- package/dist/rules/no-domparser-html-without-sanitization.d.ts.map +1 -0
- package/dist/rules/no-domparser-html-without-sanitization.js +56 -0
- package/dist/rules/no-domparser-html-without-sanitization.js.map +1 -0
- package/dist/rules/no-domparser-svg-without-sanitization.d.ts +5 -0
- package/dist/rules/no-domparser-svg-without-sanitization.d.ts.map +1 -0
- package/dist/rules/no-domparser-svg-without-sanitization.js +56 -0
- package/dist/rules/no-domparser-svg-without-sanitization.js.map +1 -0
- package/dist/rules/no-dynamic-import-unsafe-url.d.ts +5 -0
- package/dist/rules/no-dynamic-import-unsafe-url.d.ts.map +1 -0
- package/dist/rules/no-dynamic-import-unsafe-url.js +47 -0
- package/dist/rules/no-dynamic-import-unsafe-url.js.map +1 -0
- package/dist/rules/no-electron-allow-running-insecure-content.d.ts +5 -0
- package/dist/rules/no-electron-allow-running-insecure-content.d.ts.map +1 -0
- package/dist/rules/no-electron-allow-running-insecure-content.js +30 -0
- package/dist/rules/no-electron-allow-running-insecure-content.js.map +1 -0
- package/dist/rules/no-electron-dangerous-blink-features.d.ts +5 -0
- package/dist/rules/no-electron-dangerous-blink-features.d.ts.map +1 -0
- package/dist/rules/no-electron-dangerous-blink-features.js +89 -0
- package/dist/rules/no-electron-dangerous-blink-features.js.map +1 -0
- package/dist/rules/no-electron-disable-context-isolation.d.ts +5 -0
- package/dist/rules/no-electron-disable-context-isolation.d.ts.map +1 -0
- package/dist/rules/no-electron-disable-context-isolation.js +30 -0
- package/dist/rules/no-electron-disable-context-isolation.js.map +1 -0
- package/dist/rules/no-electron-disable-sandbox.d.ts +5 -0
- package/dist/rules/no-electron-disable-sandbox.d.ts.map +1 -0
- package/dist/rules/no-electron-disable-sandbox.js +30 -0
- package/dist/rules/no-electron-disable-sandbox.js.map +1 -0
- package/dist/rules/no-electron-disable-web-security.d.ts +5 -0
- package/dist/rules/no-electron-disable-web-security.d.ts.map +1 -0
- package/dist/rules/no-electron-disable-web-security.js +30 -0
- package/dist/rules/no-electron-disable-web-security.js.map +1 -0
- package/dist/rules/no-electron-enable-remote-module.d.ts +5 -0
- package/dist/rules/no-electron-enable-remote-module.d.ts.map +1 -0
- package/dist/rules/no-electron-enable-remote-module.js +30 -0
- package/dist/rules/no-electron-enable-remote-module.js.map +1 -0
- package/dist/rules/no-electron-enable-webview-tag.d.ts +5 -0
- package/dist/rules/no-electron-enable-webview-tag.d.ts.map +1 -0
- package/dist/rules/no-electron-enable-webview-tag.js +30 -0
- package/dist/rules/no-electron-enable-webview-tag.js.map +1 -0
- package/dist/rules/no-electron-experimental-features.d.ts +5 -0
- package/dist/rules/no-electron-experimental-features.d.ts.map +1 -0
- package/dist/rules/no-electron-experimental-features.js +30 -0
- package/dist/rules/no-electron-experimental-features.js.map +1 -0
- package/dist/rules/no-electron-expose-raw-ipc-renderer.d.ts +5 -0
- package/dist/rules/no-electron-expose-raw-ipc-renderer.d.ts.map +1 -0
- package/dist/rules/no-electron-expose-raw-ipc-renderer.js +108 -0
- package/dist/rules/no-electron-expose-raw-ipc-renderer.js.map +1 -0
- package/dist/rules/no-electron-insecure-certificate-error-handler.d.ts +5 -0
- package/dist/rules/no-electron-insecure-certificate-error-handler.d.ts.map +1 -0
- package/dist/rules/no-electron-insecure-certificate-error-handler.js +91 -0
- package/dist/rules/no-electron-insecure-certificate-error-handler.js.map +1 -0
- package/dist/rules/no-electron-insecure-certificate-verify-proc.d.ts +5 -0
- package/dist/rules/no-electron-insecure-certificate-verify-proc.d.ts.map +1 -0
- package/dist/rules/no-electron-insecure-certificate-verify-proc.js +75 -0
- package/dist/rules/no-electron-insecure-certificate-verify-proc.js.map +1 -0
- package/dist/rules/no-electron-insecure-permission-request-handler.d.ts +5 -0
- package/dist/rules/no-electron-insecure-permission-request-handler.d.ts.map +1 -0
- package/dist/rules/no-electron-insecure-permission-request-handler.js +75 -0
- package/dist/rules/no-electron-insecure-permission-request-handler.js.map +1 -0
- package/dist/rules/no-electron-node-integration.d.ts +5 -0
- package/dist/rules/no-electron-node-integration.d.ts.map +1 -0
- package/dist/rules/no-electron-node-integration.js +52 -0
- package/dist/rules/no-electron-node-integration.js.map +1 -0
- package/dist/rules/no-electron-permission-check-handler-allow-all.d.ts +5 -0
- package/dist/rules/no-electron-permission-check-handler-allow-all.d.ts.map +1 -0
- package/dist/rules/no-electron-permission-check-handler-allow-all.js +63 -0
- package/dist/rules/no-electron-permission-check-handler-allow-all.js.map +1 -0
- package/dist/rules/no-electron-unchecked-ipc-sender.d.ts +5 -0
- package/dist/rules/no-electron-unchecked-ipc-sender.d.ts.map +1 -0
- package/dist/rules/no-electron-unchecked-ipc-sender.js +90 -0
- package/dist/rules/no-electron-unchecked-ipc-sender.js.map +1 -0
- package/dist/rules/no-electron-unrestricted-navigation.d.ts +5 -0
- package/dist/rules/no-electron-unrestricted-navigation.d.ts.map +1 -0
- package/dist/rules/no-electron-unrestricted-navigation.js +100 -0
- package/dist/rules/no-electron-unrestricted-navigation.js.map +1 -0
- package/dist/rules/no-electron-untrusted-open-external.d.ts +5 -0
- package/dist/rules/no-electron-untrusted-open-external.d.ts.map +1 -0
- package/dist/rules/no-electron-untrusted-open-external.js +92 -0
- package/dist/rules/no-electron-untrusted-open-external.js.map +1 -0
- package/dist/rules/no-electron-webview-allowpopups.d.ts +5 -0
- package/dist/rules/no-electron-webview-allowpopups.d.ts.map +1 -0
- package/dist/rules/no-electron-webview-allowpopups.js +85 -0
- package/dist/rules/no-electron-webview-allowpopups.js.map +1 -0
- package/dist/rules/no-electron-webview-insecure-webpreferences.d.ts +5 -0
- package/dist/rules/no-electron-webview-insecure-webpreferences.d.ts.map +1 -0
- package/dist/rules/no-electron-webview-insecure-webpreferences.js +88 -0
- package/dist/rules/no-electron-webview-insecure-webpreferences.js.map +1 -0
- package/dist/rules/no-electron-webview-node-integration.d.ts +5 -0
- package/dist/rules/no-electron-webview-node-integration.d.ts.map +1 -0
- package/dist/rules/no-electron-webview-node-integration.js +107 -0
- package/dist/rules/no-electron-webview-node-integration.js.map +1 -0
- package/dist/rules/no-html-method.d.ts +5 -0
- package/dist/rules/no-html-method.d.ts.map +1 -0
- package/dist/rules/no-html-method.js +42 -0
- package/dist/rules/no-html-method.js.map +1 -0
- package/dist/rules/no-http-request-to-insecure-protocol.d.ts +5 -0
- package/dist/rules/no-http-request-to-insecure-protocol.d.ts.map +1 -0
- package/dist/rules/no-http-request-to-insecure-protocol.js +94 -0
- package/dist/rules/no-http-request-to-insecure-protocol.js.map +1 -0
- package/dist/rules/no-iframe-srcdoc.d.ts +5 -0
- package/dist/rules/no-iframe-srcdoc.d.ts.map +1 -0
- package/dist/rules/no-iframe-srcdoc.js +144 -0
- package/dist/rules/no-iframe-srcdoc.js.map +1 -0
- package/dist/rules/no-inner-html.d.ts +5 -0
- package/dist/rules/no-inner-html.d.ts.map +1 -0
- package/dist/rules/no-inner-html.js +67 -0
- package/dist/rules/no-inner-html.js.map +1 -0
- package/dist/rules/no-insecure-random.d.ts +5 -0
- package/dist/rules/no-insecure-random.d.ts.map +1 -0
- package/dist/rules/no-insecure-random.js +95 -0
- package/dist/rules/no-insecure-random.js.map +1 -0
- package/dist/rules/no-insecure-tls-agent-options.d.ts +5 -0
- package/dist/rules/no-insecure-tls-agent-options.d.ts.map +1 -0
- package/dist/rules/no-insecure-tls-agent-options.js +73 -0
- package/dist/rules/no-insecure-tls-agent-options.js.map +1 -0
- package/dist/rules/no-insecure-url.d.ts +12 -0
- package/dist/rules/no-insecure-url.d.ts.map +1 -0
- package/dist/rules/no-insecure-url.js +142 -0
- package/dist/rules/no-insecure-url.js.map +1 -0
- package/dist/rules/no-location-javascript-url.d.ts +5 -0
- package/dist/rules/no-location-javascript-url.d.ts.map +1 -0
- package/dist/rules/no-location-javascript-url.js +98 -0
- package/dist/rules/no-location-javascript-url.js.map +1 -0
- package/dist/rules/no-message-event-without-origin-check.d.ts +5 -0
- package/dist/rules/no-message-event-without-origin-check.d.ts.map +1 -0
- package/dist/rules/no-message-event-without-origin-check.js +183 -0
- package/dist/rules/no-message-event-without-origin-check.js.map +1 -0
- package/dist/rules/no-msapp-exec-unsafe.d.ts +5 -0
- package/dist/rules/no-msapp-exec-unsafe.d.ts.map +1 -0
- package/dist/rules/no-msapp-exec-unsafe.js +32 -0
- package/dist/rules/no-msapp-exec-unsafe.js.map +1 -0
- package/dist/rules/no-node-tls-check-server-identity-bypass.d.ts +5 -0
- package/dist/rules/no-node-tls-check-server-identity-bypass.d.ts.map +1 -0
- package/dist/rules/no-node-tls-check-server-identity-bypass.js +95 -0
- package/dist/rules/no-node-tls-check-server-identity-bypass.js.map +1 -0
- package/dist/rules/no-node-tls-legacy-protocol.d.ts +5 -0
- package/dist/rules/no-node-tls-legacy-protocol.d.ts.map +1 -0
- package/dist/rules/no-node-tls-legacy-protocol.js +106 -0
- package/dist/rules/no-node-tls-legacy-protocol.js.map +1 -0
- package/dist/rules/no-node-tls-reject-unauthorized-zero.d.ts +5 -0
- package/dist/rules/no-node-tls-reject-unauthorized-zero.d.ts.map +1 -0
- package/dist/rules/no-node-tls-reject-unauthorized-zero.js +93 -0
- package/dist/rules/no-node-tls-reject-unauthorized-zero.js.map +1 -0
- package/dist/rules/no-node-tls-security-level-zero.d.ts +5 -0
- package/dist/rules/no-node-tls-security-level-zero.d.ts.map +1 -0
- package/dist/rules/no-node-tls-security-level-zero.js +80 -0
- package/dist/rules/no-node-tls-security-level-zero.js.map +1 -0
- package/dist/rules/no-node-vm-run-in-context.d.ts +5 -0
- package/dist/rules/no-node-vm-run-in-context.d.ts.map +1 -0
- package/dist/rules/no-node-vm-run-in-context.js +186 -0
- package/dist/rules/no-node-vm-run-in-context.js.map +1 -0
- package/dist/rules/no-node-vm-source-text-module.d.ts +5 -0
- package/dist/rules/no-node-vm-source-text-module.d.ts.map +1 -0
- package/dist/rules/no-node-vm-source-text-module.js +126 -0
- package/dist/rules/no-node-vm-source-text-module.js.map +1 -0
- package/dist/rules/no-node-worker-threads-eval.d.ts +5 -0
- package/dist/rules/no-node-worker-threads-eval.d.ts.map +1 -0
- package/dist/rules/no-node-worker-threads-eval.js +151 -0
- package/dist/rules/no-node-worker-threads-eval.js.map +1 -0
- package/dist/rules/no-nonnull-assertion-on-security-input.d.ts +5 -0
- package/dist/rules/no-nonnull-assertion-on-security-input.d.ts.map +1 -0
- package/dist/rules/no-nonnull-assertion-on-security-input.js +48 -0
- package/dist/rules/no-nonnull-assertion-on-security-input.js.map +1 -0
- package/dist/rules/no-postmessage-star-origin.d.ts +5 -0
- package/dist/rules/no-postmessage-star-origin.d.ts.map +1 -0
- package/dist/rules/no-postmessage-star-origin.js +58 -0
- package/dist/rules/no-postmessage-star-origin.js.map +1 -0
- package/dist/rules/no-postmessage-without-origin-allowlist.d.ts +5 -0
- package/dist/rules/no-postmessage-without-origin-allowlist.d.ts.map +1 -0
- package/dist/rules/no-postmessage-without-origin-allowlist.js +80 -0
- package/dist/rules/no-postmessage-without-origin-allowlist.js.map +1 -0
- package/dist/rules/no-range-create-contextual-fragment.d.ts +5 -0
- package/dist/rules/no-range-create-contextual-fragment.d.ts.map +1 -0
- package/dist/rules/no-range-create-contextual-fragment.js +64 -0
- package/dist/rules/no-range-create-contextual-fragment.js.map +1 -0
- package/dist/rules/no-script-src-data-url.d.ts +5 -0
- package/dist/rules/no-script-src-data-url.d.ts.map +1 -0
- package/dist/rules/no-script-src-data-url.js +108 -0
- package/dist/rules/no-script-src-data-url.js.map +1 -0
- package/dist/rules/no-script-text.d.ts +5 -0
- package/dist/rules/no-script-text.d.ts.map +1 -0
- package/dist/rules/no-script-text.js +52 -0
- package/dist/rules/no-script-text.js.map +1 -0
- package/dist/rules/no-service-worker-unsafe-script-url.d.ts +5 -0
- package/dist/rules/no-service-worker-unsafe-script-url.d.ts.map +1 -0
- package/dist/rules/no-service-worker-unsafe-script-url.js +52 -0
- package/dist/rules/no-service-worker-unsafe-script-url.js.map +1 -0
- package/dist/rules/no-set-html-unsafe.d.ts +5 -0
- package/dist/rules/no-set-html-unsafe.d.ts.map +1 -0
- package/dist/rules/no-set-html-unsafe.js +48 -0
- package/dist/rules/no-set-html-unsafe.js.map +1 -0
- package/dist/rules/no-trusted-types-policy-pass-through.d.ts +5 -0
- package/dist/rules/no-trusted-types-policy-pass-through.d.ts.map +1 -0
- package/dist/rules/no-trusted-types-policy-pass-through.js +115 -0
- package/dist/rules/no-trusted-types-policy-pass-through.js.map +1 -0
- package/dist/rules/no-unsafe-alloc.d.ts +5 -0
- package/dist/rules/no-unsafe-alloc.d.ts.map +1 -0
- package/dist/rules/no-unsafe-alloc.js +51 -0
- package/dist/rules/no-unsafe-alloc.js.map +1 -0
- package/dist/rules/no-unsafe-cast-to-trusted-types.d.ts +5 -0
- package/dist/rules/no-unsafe-cast-to-trusted-types.d.ts.map +1 -0
- package/dist/rules/no-unsafe-cast-to-trusted-types.js +89 -0
- package/dist/rules/no-unsafe-cast-to-trusted-types.js.map +1 -0
- package/dist/rules/no-window-open-without-noopener.d.ts +5 -0
- package/dist/rules/no-window-open-without-noopener.d.ts.map +1 -0
- package/dist/rules/no-window-open-without-noopener.js +84 -0
- package/dist/rules/no-window-open-without-noopener.js.map +1 -0
- package/dist/rules/no-winjs-html-unsafe.d.ts +5 -0
- package/dist/rules/no-winjs-html-unsafe.d.ts.map +1 -0
- package/dist/rules/no-winjs-html-unsafe.js +32 -0
- package/dist/rules/no-winjs-html-unsafe.js.map +1 -0
- package/dist/rules/no-worker-blob-url.d.ts +5 -0
- package/dist/rules/no-worker-blob-url.d.ts.map +1 -0
- package/dist/rules/no-worker-blob-url.js +64 -0
- package/dist/rules/no-worker-blob-url.js.map +1 -0
- package/dist/rules/no-worker-data-url.d.ts +5 -0
- package/dist/rules/no-worker-data-url.d.ts.map +1 -0
- package/dist/rules/no-worker-data-url.js +67 -0
- package/dist/rules/no-worker-data-url.js.map +1 -0
- package/docs/rules/getting-started.md +70 -0
- package/docs/rules/no-angular-bypass-sanitizer.md +69 -0
- package/docs/rules/no-angular-bypass-security-trust-html.md +59 -0
- package/docs/rules/no-angular-innerhtml-binding.md +59 -0
- package/docs/rules/no-angular-sanitization-trusted-urls.md +64 -0
- package/docs/rules/no-angularjs-bypass-sce.md +64 -0
- package/docs/rules/no-angularjs-enable-svg.md +59 -0
- package/docs/rules/no-angularjs-ng-bind-html-without-sanitize.md +59 -0
- package/docs/rules/no-angularjs-sanitization-whitelist.md +63 -0
- package/docs/rules/no-angularjs-sce-resource-url-wildcard.md +62 -0
- package/docs/rules/no-child-process-exec.md +101 -0
- package/docs/rules/no-child-process-shell-true.md +59 -0
- package/docs/rules/no-cookies.md +61 -0
- package/docs/rules/no-document-domain.md +59 -0
- package/docs/rules/no-document-execcommand-insert-html.md +69 -0
- package/docs/rules/no-document-parse-html-unsafe.md +72 -0
- package/docs/rules/no-document-write.md +64 -0
- package/docs/rules/no-domparser-html-without-sanitization.md +59 -0
- package/docs/rules/no-domparser-svg-without-sanitization.md +71 -0
- package/docs/rules/no-dynamic-import-unsafe-url.md +81 -0
- package/docs/rules/no-electron-allow-running-insecure-content.md +69 -0
- package/docs/rules/no-electron-dangerous-blink-features.md +77 -0
- package/docs/rules/no-electron-disable-context-isolation.md +69 -0
- package/docs/rules/no-electron-disable-sandbox.md +69 -0
- package/docs/rules/no-electron-disable-web-security.md +69 -0
- package/docs/rules/no-electron-enable-remote-module.md +69 -0
- package/docs/rules/no-electron-enable-webview-tag.md +77 -0
- package/docs/rules/no-electron-experimental-features.md +77 -0
- package/docs/rules/no-electron-expose-raw-ipc-renderer.md +79 -0
- package/docs/rules/no-electron-insecure-certificate-error-handler.md +72 -0
- package/docs/rules/no-electron-insecure-certificate-verify-proc.md +63 -0
- package/docs/rules/no-electron-insecure-permission-request-handler.md +67 -0
- package/docs/rules/no-electron-node-integration.md +70 -0
- package/docs/rules/no-electron-permission-check-handler-allow-all.md +66 -0
- package/docs/rules/no-electron-unchecked-ipc-sender.md +62 -0
- package/docs/rules/no-electron-unrestricted-navigation.md +64 -0
- package/docs/rules/no-electron-untrusted-open-external.md +65 -0
- package/docs/rules/no-electron-webview-allowpopups.md +59 -0
- package/docs/rules/no-electron-webview-insecure-webpreferences.md +84 -0
- package/docs/rules/no-electron-webview-node-integration.md +59 -0
- package/docs/rules/no-html-method.md +58 -0
- package/docs/rules/no-http-request-to-insecure-protocol.md +59 -0
- package/docs/rules/no-iframe-srcdoc.md +76 -0
- package/docs/rules/no-inner-html.md +65 -0
- package/docs/rules/no-insecure-random.md +66 -0
- package/docs/rules/no-insecure-tls-agent-options.md +59 -0
- package/docs/rules/no-insecure-url.md +72 -0
- package/docs/rules/no-location-javascript-url.md +59 -0
- package/docs/rules/no-message-event-without-origin-check.md +82 -0
- package/docs/rules/no-msapp-exec-unsafe.md +59 -0
- package/docs/rules/no-node-tls-check-server-identity-bypass.md +88 -0
- package/docs/rules/no-node-tls-legacy-protocol.md +80 -0
- package/docs/rules/no-node-tls-reject-unauthorized-zero.md +61 -0
- package/docs/rules/no-node-tls-security-level-zero.md +77 -0
- package/docs/rules/no-node-vm-run-in-context.md +89 -0
- package/docs/rules/no-node-vm-source-text-module.md +79 -0
- package/docs/rules/no-node-worker-threads-eval.md +82 -0
- package/docs/rules/no-nonnull-assertion-on-security-input.md +59 -0
- package/docs/rules/no-postmessage-star-origin.md +59 -0
- package/docs/rules/no-postmessage-without-origin-allowlist.md +59 -0
- package/docs/rules/no-range-create-contextual-fragment.md +64 -0
- package/docs/rules/no-script-src-data-url.md +83 -0
- package/docs/rules/no-script-text.md +80 -0
- package/docs/rules/no-service-worker-unsafe-script-url.md +85 -0
- package/docs/rules/no-set-html-unsafe.md +64 -0
- package/docs/rules/no-trusted-types-policy-pass-through.md +68 -0
- package/docs/rules/no-unsafe-alloc.md +62 -0
- package/docs/rules/no-unsafe-cast-to-trusted-types.md +59 -0
- package/docs/rules/no-window-open-without-noopener.md +63 -0
- package/docs/rules/no-winjs-html-unsafe.md +60 -0
- package/docs/rules/no-worker-blob-url.md +86 -0
- package/docs/rules/no-worker-data-url.md +85 -0
- package/docs/rules/overview.md +111 -0
- package/docs/rules/presets/angular.md +35 -0
- package/docs/rules/presets/angularjs.md +36 -0
- package/docs/rules/presets/common.md +59 -0
- package/docs/rules/presets/electron.md +51 -0
- package/docs/rules/presets/index.md +26 -0
- package/docs/rules/presets/node.md +43 -0
- package/docs/rules/presets/react.md +33 -0
- package/docs/rules/presets/recommended.md +104 -0
- package/docs/rules/presets/required.md +99 -0
- package/docs/rules/presets/typescript.md +34 -0
- package/package.json +583 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# no-electron-insecure-certificate-error-handler
|
|
2
|
+
|
|
3
|
+
Disallow Electron `certificate-error` handlers that explicitly trust invalid certificates.
|
|
4
|
+
|
|
5
|
+
## Targeted pattern scope
|
|
6
|
+
|
|
7
|
+
This rule targets `.on("certificate-error", handler)` registrations where the
|
|
8
|
+
handler callback is called with `true`.
|
|
9
|
+
|
|
10
|
+
## What this rule reports
|
|
11
|
+
|
|
12
|
+
This rule reports `certificate-error` handlers that invoke the callback with
|
|
13
|
+
`true`, which accepts invalid certificates.
|
|
14
|
+
|
|
15
|
+
## Why this rule exists
|
|
16
|
+
|
|
17
|
+
The `certificate-error` event should be handled conservatively. Calling the
|
|
18
|
+
callback with `true` bypasses certificate validation and can enable active
|
|
19
|
+
man-in-the-middle interception.
|
|
20
|
+
|
|
21
|
+
## ❌ Incorrect
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
app.on(
|
|
25
|
+
"certificate-error",
|
|
26
|
+
(_event, _webContents, _url, _error, _certificate, callback) => {
|
|
27
|
+
callback(true);
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## ✅ Correct
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
app.on(
|
|
36
|
+
"certificate-error",
|
|
37
|
+
(_event, _webContents, _url, _error, _certificate, callback) => {
|
|
38
|
+
callback(false);
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## ESLint flat config example
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
import sdl from "eslint-plugin-sdl-2";
|
|
47
|
+
|
|
48
|
+
export default [
|
|
49
|
+
{
|
|
50
|
+
plugins: { sdl },
|
|
51
|
+
rules: {
|
|
52
|
+
"sdl/no-electron-insecure-certificate-error-handler": "error",
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
];
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## When not to use it
|
|
59
|
+
|
|
60
|
+
Disable only if your runtime deliberately implements certificate pinning or
|
|
61
|
+
enterprise trust logic outside this callback path and has security sign-off.
|
|
62
|
+
|
|
63
|
+
## Package documentation
|
|
64
|
+
|
|
65
|
+
- [Rule source](../../src/rules/no-electron-insecure-certificate-error-handler.ts)
|
|
66
|
+
|
|
67
|
+
## Further reading
|
|
68
|
+
|
|
69
|
+
> **Rule catalog ID:** R015
|
|
70
|
+
|
|
71
|
+
- [Electron app certificate-error event](https://www.electronjs.org/docs/latest/api/app#event-certificate-error)
|
|
72
|
+
- [Electron security checklist](https://www.electronjs.org/docs/latest/tutorial/security)
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# no-electron-insecure-certificate-verify-proc
|
|
2
|
+
|
|
3
|
+
Disallow Electron certificate verification callbacks that trust invalid certificates.
|
|
4
|
+
|
|
5
|
+
## Targeted pattern scope
|
|
6
|
+
|
|
7
|
+
Electron `session.setCertificateVerifyProc` handlers that trust invalid certificates.
|
|
8
|
+
|
|
9
|
+
## What this rule reports
|
|
10
|
+
|
|
11
|
+
Verify-proc handlers that `callback(0)` or return `0`.
|
|
12
|
+
|
|
13
|
+
## Why this rule exists
|
|
14
|
+
|
|
15
|
+
Overriding certificate checks can silently disable TLS trust guarantees.
|
|
16
|
+
|
|
17
|
+
## ❌ Incorrect
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
session.defaultSession.setCertificateVerifyProc((request, callback) => {
|
|
21
|
+
callback(0);
|
|
22
|
+
});
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## ✅ Correct
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
session.defaultSession.setCertificateVerifyProc((request, callback) => {
|
|
29
|
+
callback(-3);
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## ESLint flat config example
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
import sdl from "eslint-plugin-sdl-2";
|
|
37
|
+
|
|
38
|
+
export default [
|
|
39
|
+
{
|
|
40
|
+
plugins: { sdl },
|
|
41
|
+
|
|
42
|
+
rules: {
|
|
43
|
+
"sdl/no-electron-insecure-certificate-verify-proc": "error",
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## When not to use it
|
|
50
|
+
|
|
51
|
+
Disable only if certificate trust is enforced through a reviewed pinning or enterprise policy outside the callback return value.
|
|
52
|
+
|
|
53
|
+
## Package documentation
|
|
54
|
+
|
|
55
|
+
- [Rule source](../../src/rules/no-electron-insecure-certificate-verify-proc.ts)
|
|
56
|
+
|
|
57
|
+
## Further reading
|
|
58
|
+
|
|
59
|
+
> **Rule catalog ID:** R034
|
|
60
|
+
|
|
61
|
+
- [OWASP Top 10: Injection](https://owasp.org/www-project-top-ten/)
|
|
62
|
+
|
|
63
|
+
- [OWASP Top 10: Security Misconfiguration](https://owasp.org/www-project-top-ten/)
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# no-electron-insecure-permission-request-handler
|
|
2
|
+
|
|
3
|
+
Disallow Electron permission request handlers that blanket-allow permissions.
|
|
4
|
+
|
|
5
|
+
## Targeted pattern scope
|
|
6
|
+
|
|
7
|
+
Electron permission handlers that blanket-allow permission requests.
|
|
8
|
+
|
|
9
|
+
## What this rule reports
|
|
10
|
+
|
|
11
|
+
`setPermissionRequestHandler` callbacks that unconditionally `callback(true)` or return `true`.
|
|
12
|
+
|
|
13
|
+
## Why this rule exists
|
|
14
|
+
|
|
15
|
+
Blindly granting permissions can expose camera, microphone, clipboard, and notification abuse vectors.
|
|
16
|
+
|
|
17
|
+
## ❌ Incorrect
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
session.defaultSession.setPermissionRequestHandler(
|
|
21
|
+
(wc, permission, callback) => {
|
|
22
|
+
callback(true);
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## ✅ Correct
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
session.defaultSession.setPermissionRequestHandler(
|
|
31
|
+
(wc, permission, callback) => {
|
|
32
|
+
callback(permission === "notifications");
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## ESLint flat config example
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
import sdl from "eslint-plugin-sdl-2";
|
|
41
|
+
|
|
42
|
+
export default [
|
|
43
|
+
{
|
|
44
|
+
plugins: { sdl },
|
|
45
|
+
|
|
46
|
+
rules: {
|
|
47
|
+
"sdl/no-electron-insecure-permission-request-handler": "error",
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
];
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## When not to use it
|
|
54
|
+
|
|
55
|
+
Disable only if the runtime has a reviewed permission policy that intentionally allows a constrained set of requests.
|
|
56
|
+
|
|
57
|
+
## Package documentation
|
|
58
|
+
|
|
59
|
+
- [Rule source](../../src/rules/no-electron-insecure-permission-request-handler.ts)
|
|
60
|
+
|
|
61
|
+
## Further reading
|
|
62
|
+
|
|
63
|
+
> **Rule catalog ID:** R035
|
|
64
|
+
|
|
65
|
+
- [OWASP Top 10: Injection](https://owasp.org/www-project-top-ten/)
|
|
66
|
+
|
|
67
|
+
- [OWASP Top 10: Security Misconfiguration](https://owasp.org/www-project-top-ten/)
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# no-electron-node-integration
|
|
2
|
+
|
|
3
|
+
Disallow enabling Electron Node.js integration for renderers with remote content.
|
|
4
|
+
|
|
5
|
+
## Targeted pattern scope
|
|
6
|
+
|
|
7
|
+
This rule targets Electron BrowserWindow and webPreferences configurations that
|
|
8
|
+
enable `nodeIntegration` where remote content is loaded.
|
|
9
|
+
|
|
10
|
+
## What this rule reports
|
|
11
|
+
|
|
12
|
+
This rule reports renderer configurations that combine untrusted content with
|
|
13
|
+
Node.js APIs.
|
|
14
|
+
|
|
15
|
+
## Why this rule exists
|
|
16
|
+
|
|
17
|
+
Enabling Node.js integration for remote content increases remote code execution
|
|
18
|
+
risk in Electron apps.
|
|
19
|
+
|
|
20
|
+
## ❌ Incorrect
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
new BrowserWindow({
|
|
24
|
+
webPreferences: {
|
|
25
|
+
nodeIntegration: true,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## ✅ Correct
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
new BrowserWindow({
|
|
34
|
+
webPreferences: {
|
|
35
|
+
nodeIntegration: false,
|
|
36
|
+
contextIsolation: true,
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## ESLint flat config example
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
import sdl from "eslint-plugin-sdl-2";
|
|
45
|
+
|
|
46
|
+
export default [
|
|
47
|
+
{
|
|
48
|
+
plugins: { sdl },
|
|
49
|
+
rules: {
|
|
50
|
+
"sdl/no-electron-node-integration": "error",
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
];
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## When not to use it
|
|
57
|
+
|
|
58
|
+
Disable only for offline renderers with no untrusted input and compensating
|
|
59
|
+
controls.
|
|
60
|
+
|
|
61
|
+
## Package documentation
|
|
62
|
+
|
|
63
|
+
- [Rule source](../../src/rules/no-electron-node-integration.ts)
|
|
64
|
+
|
|
65
|
+
## Further reading
|
|
66
|
+
|
|
67
|
+
> **Rule catalog ID:** R016
|
|
68
|
+
|
|
69
|
+
- [Electron security checklist](https://www.electronjs.org/docs/latest/tutorial/security)
|
|
70
|
+
- [CodeQL reference: Electron renderer Node integration](https://codeql.github.com/codeql-query-help/javascript/js-enabling-electron-renderer-node-integration/)
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# no-electron-permission-check-handler-allow-all
|
|
2
|
+
|
|
3
|
+
Disallow Electron `setPermissionCheckHandler` callbacks that unconditionally
|
|
4
|
+
return `true`.
|
|
5
|
+
|
|
6
|
+
## Targeted pattern scope
|
|
7
|
+
|
|
8
|
+
This rule targets `setPermissionCheckHandler(...)` callbacks that always return
|
|
9
|
+
`true` for every permission check.
|
|
10
|
+
|
|
11
|
+
## What this rule reports
|
|
12
|
+
|
|
13
|
+
This rule reports inline permission check handlers that resolve to `true`
|
|
14
|
+
without inspecting the request context or permission name.
|
|
15
|
+
|
|
16
|
+
## Why this rule exists
|
|
17
|
+
|
|
18
|
+
Blindly approving every permission check weakens Electron's permission boundary
|
|
19
|
+
and can expose capabilities such as media access, notifications, and clipboard
|
|
20
|
+
operations to content that should not receive them.
|
|
21
|
+
|
|
22
|
+
## ❌ Incorrect
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
session.defaultSession.setPermissionCheckHandler(() => true);
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## ✅ Correct
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
session.defaultSession.setPermissionCheckHandler(
|
|
32
|
+
(_webContents, permission) => permission === "fullscreen"
|
|
33
|
+
);
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## ESLint flat config example
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
import sdl from "eslint-plugin-sdl-2";
|
|
40
|
+
|
|
41
|
+
export default [
|
|
42
|
+
{
|
|
43
|
+
plugins: { sdl },
|
|
44
|
+
|
|
45
|
+
rules: {
|
|
46
|
+
"sdl/no-electron-permission-check-handler-allow-all": "error",
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
];
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## When not to use it
|
|
53
|
+
|
|
54
|
+
Disable only if a reviewed Electron permission policy deliberately allows every
|
|
55
|
+
checked permission in a constrained environment.
|
|
56
|
+
|
|
57
|
+
## Package documentation
|
|
58
|
+
|
|
59
|
+
- [Rule source](../../src/rules/no-electron-permission-check-handler-allow-all.ts)
|
|
60
|
+
|
|
61
|
+
## Further reading
|
|
62
|
+
|
|
63
|
+
> **Rule catalog ID:** R050
|
|
64
|
+
|
|
65
|
+
- [Electron security checklist](https://www.electronjs.org/docs/latest/tutorial/security)
|
|
66
|
+
- [Electron Session API](https://www.electronjs.org/docs/latest/api/session)
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# no-electron-unchecked-ipc-sender
|
|
2
|
+
|
|
3
|
+
Disallow privileged Electron IPC handlers that do not validate the sender.
|
|
4
|
+
|
|
5
|
+
## Targeted pattern scope
|
|
6
|
+
|
|
7
|
+
`ipcMain.on`/`ipcMain.handle` callbacks without sender/frame trust validation.
|
|
8
|
+
|
|
9
|
+
## What this rule reports
|
|
10
|
+
|
|
11
|
+
Privileged IPC handlers that process requests without checking sender origin/frame trust.
|
|
12
|
+
|
|
13
|
+
## Why this rule exists
|
|
14
|
+
|
|
15
|
+
Unvalidated IPC senders can let compromised renderers invoke privileged main-process operations.
|
|
16
|
+
|
|
17
|
+
## ❌ Incorrect
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
ipcMain.handle("read-file", async (event) => readFile("secret.txt"));
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## ✅ Correct
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
ipcMain.handle("read-file", async (event) => {
|
|
27
|
+
if (!event.senderFrame?.url?.startsWith("https://example.com")) return null;
|
|
28
|
+
return "ok";
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## ESLint flat config example
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
import sdl from "eslint-plugin-sdl-2";
|
|
36
|
+
|
|
37
|
+
export default [
|
|
38
|
+
{
|
|
39
|
+
plugins: { sdl },
|
|
40
|
+
|
|
41
|
+
rules: {
|
|
42
|
+
"sdl/no-electron-unchecked-ipc-sender": "error",
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
];
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## When not to use it
|
|
49
|
+
|
|
50
|
+
Disable only if IPC sender trust is enforced by a reviewed abstraction that this rule cannot currently observe.
|
|
51
|
+
|
|
52
|
+
## Package documentation
|
|
53
|
+
|
|
54
|
+
- [Rule source](../../src/rules/no-electron-unchecked-ipc-sender.ts)
|
|
55
|
+
|
|
56
|
+
## Further reading
|
|
57
|
+
|
|
58
|
+
> **Rule catalog ID:** R036
|
|
59
|
+
|
|
60
|
+
- [OWASP Top 10: Injection](https://owasp.org/www-project-top-ten/)
|
|
61
|
+
|
|
62
|
+
- [OWASP Top 10: Security Misconfiguration](https://owasp.org/www-project-top-ten/)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# no-electron-unrestricted-navigation
|
|
2
|
+
|
|
3
|
+
Disallow Electron navigation handlers that allow unrestricted navigation or window creation.
|
|
4
|
+
|
|
5
|
+
## Targeted pattern scope
|
|
6
|
+
|
|
7
|
+
Electron navigation/open handlers that allow unrestricted navigation behavior.
|
|
8
|
+
|
|
9
|
+
## What this rule reports
|
|
10
|
+
|
|
11
|
+
`setWindowOpenHandler` returning allow, or `will-navigate` handlers that do not block by default.
|
|
12
|
+
|
|
13
|
+
## Why this rule exists
|
|
14
|
+
|
|
15
|
+
Unrestricted navigation can enable tabnabbing, phishing surfaces, and privilege-boundary bypasses.
|
|
16
|
+
|
|
17
|
+
## ❌ Incorrect
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
contents.setWindowOpenHandler(() => ({ action: "allow" }));
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## ✅ Correct
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
contents.on("will-navigate", (event, url) => {
|
|
27
|
+
event.preventDefault();
|
|
28
|
+
if (url === "https://example.com") {
|
|
29
|
+
/* reviewed allowlist path */
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## ESLint flat config example
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
import sdl from "eslint-plugin-sdl-2";
|
|
38
|
+
|
|
39
|
+
export default [
|
|
40
|
+
{
|
|
41
|
+
plugins: { sdl },
|
|
42
|
+
|
|
43
|
+
rules: {
|
|
44
|
+
"sdl/no-electron-unrestricted-navigation": "error",
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
];
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## When not to use it
|
|
51
|
+
|
|
52
|
+
Disable only if navigation and window-opening are governed by a reviewed allowlist abstraction outside the immediate handler.
|
|
53
|
+
|
|
54
|
+
## Package documentation
|
|
55
|
+
|
|
56
|
+
- [Rule source](../../src/rules/no-electron-unrestricted-navigation.ts)
|
|
57
|
+
|
|
58
|
+
## Further reading
|
|
59
|
+
|
|
60
|
+
> **Rule catalog ID:** R037
|
|
61
|
+
|
|
62
|
+
- [OWASP Top 10: Injection](https://owasp.org/www-project-top-ten/)
|
|
63
|
+
|
|
64
|
+
- [OWASP Top 10: Security Misconfiguration](https://owasp.org/www-project-top-ten/)
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# no-electron-untrusted-open-external
|
|
2
|
+
|
|
3
|
+
Disallow untrusted or unsafe protocols in Electron `shell.openExternal(...)` calls.
|
|
4
|
+
|
|
5
|
+
## Targeted pattern scope
|
|
6
|
+
|
|
7
|
+
This rule targets direct `shell.openExternal(...)` and
|
|
8
|
+
`electron.shell.openExternal(...)` call sites.
|
|
9
|
+
|
|
10
|
+
## What this rule reports
|
|
11
|
+
|
|
12
|
+
This rule reports `shell.openExternal(...)` calls when the URL argument is
|
|
13
|
+
non-literal, dynamically constructed, or uses a protocol other than `https:` or
|
|
14
|
+
`mailto:`.
|
|
15
|
+
|
|
16
|
+
## Why this rule exists
|
|
17
|
+
|
|
18
|
+
`openExternal` launches external handlers and browsers. Passing untrusted or
|
|
19
|
+
unexpected URLs can create phishing or command-surface abuse paths.
|
|
20
|
+
|
|
21
|
+
## ❌ Incorrect
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
shell.openExternal("http://example.com");
|
|
25
|
+
shell.openExternal(userProvidedUrl);
|
|
26
|
+
shell.openExternal(`https://${host}`);
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## ✅ Correct
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
shell.openExternal("https://example.com/docs");
|
|
33
|
+
shell.openExternal("mailto:security@example.com");
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## ESLint flat config example
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
import sdl from "eslint-plugin-sdl-2";
|
|
40
|
+
|
|
41
|
+
export default [
|
|
42
|
+
{
|
|
43
|
+
plugins: { sdl },
|
|
44
|
+
rules: {
|
|
45
|
+
"sdl/no-electron-untrusted-open-external": "error",
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## When not to use it
|
|
52
|
+
|
|
53
|
+
Disable if your project uses a centralized URL-validation helper and dynamic
|
|
54
|
+
values are already strictly validated before `openExternal`.
|
|
55
|
+
|
|
56
|
+
## Package documentation
|
|
57
|
+
|
|
58
|
+
- [Rule source](../../src/rules/no-electron-untrusted-open-external.ts)
|
|
59
|
+
|
|
60
|
+
## Further reading
|
|
61
|
+
|
|
62
|
+
> **Rule catalog ID:** R017
|
|
63
|
+
|
|
64
|
+
- [Electron shell.openExternal](https://www.electronjs.org/docs/latest/api/shell#shellopenexternalurl-options)
|
|
65
|
+
- [Electron security checklist](https://www.electronjs.org/docs/latest/tutorial/security)
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# no-electron-webview-allowpopups
|
|
2
|
+
|
|
3
|
+
Disallow enabling `allowpopups` on Electron `<webview>` elements.
|
|
4
|
+
|
|
5
|
+
## Targeted pattern scope
|
|
6
|
+
|
|
7
|
+
Electron `<webview>` usage with `allowpopups` enabled.
|
|
8
|
+
|
|
9
|
+
## What this rule reports
|
|
10
|
+
|
|
11
|
+
JSX `<webview>` attributes that enable `allowpopups`.
|
|
12
|
+
|
|
13
|
+
## Why this rule exists
|
|
14
|
+
|
|
15
|
+
Allowing popups from embedded untrusted content expands attack surface and abuse channels.
|
|
16
|
+
|
|
17
|
+
## ❌ Incorrect
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
const view = <webview allowpopups src="https://example.com" />;
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## ✅ Correct
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
const view = <webview src="https://example.com" />;
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## ESLint flat config example
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import sdl from "eslint-plugin-sdl-2";
|
|
33
|
+
|
|
34
|
+
export default [
|
|
35
|
+
{
|
|
36
|
+
plugins: { sdl },
|
|
37
|
+
|
|
38
|
+
rules: {
|
|
39
|
+
"sdl/no-electron-webview-allowpopups": "error",
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## When not to use it
|
|
46
|
+
|
|
47
|
+
Disable only if the embedded content is fully trusted and popup behavior is part of a reviewed application design.
|
|
48
|
+
|
|
49
|
+
## Package documentation
|
|
50
|
+
|
|
51
|
+
- [Rule source](../../src/rules/no-electron-webview-allowpopups.ts)
|
|
52
|
+
|
|
53
|
+
## Further reading
|
|
54
|
+
|
|
55
|
+
> **Rule catalog ID:** R038
|
|
56
|
+
|
|
57
|
+
- [OWASP Top 10: Injection](https://owasp.org/www-project-top-ten/)
|
|
58
|
+
|
|
59
|
+
- [OWASP Top 10: Security Misconfiguration](https://owasp.org/www-project-top-ten/)
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# no-electron-webview-insecure-webpreferences
|
|
2
|
+
|
|
3
|
+
Disallow unsafe Electron `<webview>` `webpreferences` string flags.
|
|
4
|
+
|
|
5
|
+
## Targeted pattern scope
|
|
6
|
+
|
|
7
|
+
This rule targets static `<webview webpreferences="..." />` attributes that
|
|
8
|
+
enable insecure flags such as:
|
|
9
|
+
|
|
10
|
+
- `allowRunningInsecureContent=yes`
|
|
11
|
+
- `contextIsolation=no`
|
|
12
|
+
- `experimentalFeatures=yes`
|
|
13
|
+
- `sandbox=no`
|
|
14
|
+
- `webSecurity=no`
|
|
15
|
+
|
|
16
|
+
## What this rule reports
|
|
17
|
+
|
|
18
|
+
This rule reports static `webpreferences` strings on Electron `webview`
|
|
19
|
+
elements when they contain unsafe hardening overrides.
|
|
20
|
+
|
|
21
|
+
## Why this rule exists
|
|
22
|
+
|
|
23
|
+
Electron `webview` attributes often hide security-critical renderer settings
|
|
24
|
+
inside string flags. Those strings can quietly disable isolation or enable risky
|
|
25
|
+
behavior that should stay off for untrusted content.
|
|
26
|
+
|
|
27
|
+
## ❌ Incorrect
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
const view = (
|
|
31
|
+
<webview
|
|
32
|
+
src="https://example.com"
|
|
33
|
+
webpreferences="webSecurity=no, contextIsolation=no"
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## ✅ Correct
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
const view = (
|
|
42
|
+
<webview
|
|
43
|
+
src="https://example.com"
|
|
44
|
+
webpreferences="sandbox=yes, contextIsolation=yes, webSecurity=yes"
|
|
45
|
+
/>
|
|
46
|
+
);
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Behavior and migration notes
|
|
50
|
+
|
|
51
|
+
This rule currently reports only static string values. Dynamic `webpreferences`
|
|
52
|
+
expressions are ignored to avoid false positives.
|
|
53
|
+
|
|
54
|
+
## ESLint flat config example
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
import sdl from "eslint-plugin-sdl-2";
|
|
58
|
+
|
|
59
|
+
export default [
|
|
60
|
+
{
|
|
61
|
+
plugins: { sdl },
|
|
62
|
+
|
|
63
|
+
rules: {
|
|
64
|
+
"sdl/no-electron-webview-insecure-webpreferences": "error",
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
];
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## When not to use it
|
|
71
|
+
|
|
72
|
+
Disable only if reviewed `webview` content requires these flags and the host
|
|
73
|
+
application enforces compensating controls elsewhere.
|
|
74
|
+
|
|
75
|
+
## Package documentation
|
|
76
|
+
|
|
77
|
+
- [Rule source](../../src/rules/no-electron-webview-insecure-webpreferences.ts)
|
|
78
|
+
|
|
79
|
+
## Further reading
|
|
80
|
+
|
|
81
|
+
> **Rule catalog ID:** R051
|
|
82
|
+
|
|
83
|
+
- [Electron `<webview>` tag](https://www.electronjs.org/docs/latest/api/webview-tag)
|
|
84
|
+
- [Electron security checklist](https://www.electronjs.org/docs/latest/tutorial/security)
|