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,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Getting Started
|
|
3
|
+
description: Enable eslint-plugin-sdl-2 quickly in Flat Config.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Getting Started
|
|
7
|
+
|
|
8
|
+
Install the plugin:
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install --save-dev eslint-plugin-sdl-2
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Enable one preset in your Flat Config:
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import sdl from "eslint-plugin-sdl-2";
|
|
18
|
+
|
|
19
|
+
export default [...sdl.configs.recommended];
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Layering presets
|
|
23
|
+
|
|
24
|
+
`recommended` already includes:
|
|
25
|
+
|
|
26
|
+
- browser/security baseline (`common`)
|
|
27
|
+
- framework/runtime overlays (`angular`, `angularjs`, `electron`, `node`)
|
|
28
|
+
- TypeScript parser integration (`typescript`)
|
|
29
|
+
|
|
30
|
+
## Alternative: manual scoped setup
|
|
31
|
+
|
|
32
|
+
If you prefer to apply plugin rules inside your own file-scoped config object, spread the preset rules manually.
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
import sdl from "eslint-plugin-sdl-2";
|
|
36
|
+
|
|
37
|
+
export default [
|
|
38
|
+
...sdl.configs.typescript,
|
|
39
|
+
{
|
|
40
|
+
files: ["**/*.{ts,tsx,mts,cts}"],
|
|
41
|
+
plugins: {
|
|
42
|
+
sdl,
|
|
43
|
+
},
|
|
44
|
+
rules: {
|
|
45
|
+
"sdl/no-insecure-random": "error",
|
|
46
|
+
"sdl/no-insecure-url": "error",
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
];
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Use this pattern only when you need strict per-glob control. In most projects,
|
|
53
|
+
prefer `...sdl.configs.<preset>` directly.
|
|
54
|
+
|
|
55
|
+
## Recommended rollout
|
|
56
|
+
|
|
57
|
+
1. Start with `...sdl.configs.recommended`.
|
|
58
|
+
2. Fix violations in small batches.
|
|
59
|
+
3. Add framework/runtime presets (`angular`, `react`, `electron`, etc.) as
|
|
60
|
+
needed.
|
|
61
|
+
4. Keep `typescript` enabled for TS projects.
|
|
62
|
+
|
|
63
|
+
## Need a narrower subset?
|
|
64
|
+
|
|
65
|
+
- Use `...sdl.configs.common` for browser-centric checks.
|
|
66
|
+
- Use `...sdl.configs.node` for Node-specific checks.
|
|
67
|
+
- Use `...sdl.configs.angular` / `...sdl.configs.angularjs` for framework
|
|
68
|
+
overlays.
|
|
69
|
+
|
|
70
|
+
See [Presets](./presets/index.md) for full examples and rules per preset.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# no-angular-bypass-sanitizer
|
|
2
|
+
|
|
3
|
+
Disallow Angular `DomSanitizer` bypass APIs that trust unvalidated content.
|
|
4
|
+
|
|
5
|
+
## Targeted pattern scope
|
|
6
|
+
|
|
7
|
+
This rule targets direct calls to Angular sanitizer bypass APIs such as:
|
|
8
|
+
|
|
9
|
+
- `bypassSecurityTrustHtml(...)`
|
|
10
|
+
- `bypassSecurityTrustScript(...)`
|
|
11
|
+
- related `bypassSecurityTrust*` methods.
|
|
12
|
+
|
|
13
|
+
## What this rule reports
|
|
14
|
+
|
|
15
|
+
This rule reports code paths that mark untrusted input as safe using
|
|
16
|
+
`DomSanitizer` bypass helpers.
|
|
17
|
+
|
|
18
|
+
## Why this rule exists
|
|
19
|
+
|
|
20
|
+
Bypassing Angular sanitization can convert attacker-controlled input into
|
|
21
|
+
trusted content and increase XSS risk.
|
|
22
|
+
|
|
23
|
+
## ❌ Incorrect
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
const trusted = sanitizer.bypassSecurityTrustHtml(userSuppliedHtml);
|
|
27
|
+
elementRef.nativeElement.innerHTML = trusted;
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## ✅ Correct
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
const sanitizedHtml = sanitizer.sanitize(
|
|
34
|
+
SecurityContext.HTML,
|
|
35
|
+
userSuppliedHtml
|
|
36
|
+
);
|
|
37
|
+
elementRef.nativeElement.textContent = sanitizedHtml ?? "";
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## ESLint flat config example
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
import sdl from "eslint-plugin-sdl-2";
|
|
44
|
+
|
|
45
|
+
export default [
|
|
46
|
+
{
|
|
47
|
+
plugins: { sdl },
|
|
48
|
+
rules: {
|
|
49
|
+
"sdl/no-angular-bypass-sanitizer": "error",
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
];
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## When not to use it
|
|
56
|
+
|
|
57
|
+
Disable this rule only when a reviewed framework integration requires a trusted
|
|
58
|
+
type flow and the source is strictly controlled.
|
|
59
|
+
|
|
60
|
+
## Package documentation
|
|
61
|
+
|
|
62
|
+
- [Rule source](../../src/rules/no-angular-bypass-sanitizer.ts)
|
|
63
|
+
|
|
64
|
+
## Further reading
|
|
65
|
+
|
|
66
|
+
> **Rule catalog ID:** R001
|
|
67
|
+
|
|
68
|
+
- [Angular `DomSanitizer` security guidance](https://angular.io/api/platform-browser/DomSanitizer#security-risk)
|
|
69
|
+
- [Angular security guide](https://angular.io/guide/security)
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# no-angular-bypass-security-trust-html
|
|
2
|
+
|
|
3
|
+
Disallow Angular `bypassSecurityTrustHtml` usage that marks unvalidated HTML as trusted.
|
|
4
|
+
|
|
5
|
+
## Targeted pattern scope
|
|
6
|
+
|
|
7
|
+
Angular DomSanitizer bypass APIs for HTML trust.
|
|
8
|
+
|
|
9
|
+
## What this rule reports
|
|
10
|
+
|
|
11
|
+
Calls to `bypassSecurityTrustHtml(...)`.
|
|
12
|
+
|
|
13
|
+
## Why this rule exists
|
|
14
|
+
|
|
15
|
+
Bypassing Angular sanitization for HTML can introduce XSS if values are not strictly validated.
|
|
16
|
+
|
|
17
|
+
## ❌ Incorrect
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
const trusted = sanitizer.bypassSecurityTrustHtml(userHtml);
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## ✅ Correct
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
const trusted = sanitizer.sanitize(SecurityContext.HTML, userHtml);
|
|
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-angular-bypass-security-trust-html": "error",
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## When not to use it
|
|
46
|
+
|
|
47
|
+
Disable only if a reviewed framework boundary must return trusted HTML and the source is strictly validated before trust conversion.
|
|
48
|
+
|
|
49
|
+
## Package documentation
|
|
50
|
+
|
|
51
|
+
- [Rule source](../../src/rules/no-angular-bypass-security-trust-html.ts)
|
|
52
|
+
|
|
53
|
+
## Further reading
|
|
54
|
+
|
|
55
|
+
> **Rule catalog ID:** R028
|
|
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,59 @@
|
|
|
1
|
+
# no-angular-innerhtml-binding
|
|
2
|
+
|
|
3
|
+
Disallow Angular `[innerHTML]` bindings for raw HTML without a reviewed sanitization strategy.
|
|
4
|
+
|
|
5
|
+
## Targeted pattern scope
|
|
6
|
+
|
|
7
|
+
Angular template bindings that write raw HTML using `[innerHTML]`.
|
|
8
|
+
|
|
9
|
+
## What this rule reports
|
|
10
|
+
|
|
11
|
+
Template fragments containing `[innerHTML]=...` bindings.
|
|
12
|
+
|
|
13
|
+
## Why this rule exists
|
|
14
|
+
|
|
15
|
+
Raw HTML bindings are high-risk unless source content is tightly sanitized and policy-reviewed.
|
|
16
|
+
|
|
17
|
+
## ❌ Incorrect
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
const template = `<div [innerHTML]="userHtml"></div>`;
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## ✅ Correct
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
const template = `<div>{{ safeText }}</div>`;
|
|
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-angular-innerhtml-binding": "error",
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## When not to use it
|
|
46
|
+
|
|
47
|
+
Disable only when your application has a documented, reviewed sanitization policy for the HTML source being bound.
|
|
48
|
+
|
|
49
|
+
## Package documentation
|
|
50
|
+
|
|
51
|
+
- [Rule source](../../src/rules/no-angular-innerhtml-binding.ts)
|
|
52
|
+
|
|
53
|
+
## Further reading
|
|
54
|
+
|
|
55
|
+
> **Rule catalog ID:** R029
|
|
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,64 @@
|
|
|
1
|
+
# no-angular-sanitization-trusted-urls
|
|
2
|
+
|
|
3
|
+
Disallow AngularJS trusted URL list mutations that weaken sanitizer defaults.
|
|
4
|
+
|
|
5
|
+
## Targeted pattern scope
|
|
6
|
+
|
|
7
|
+
This rule targets calls that mutate AngularJS trusted URL list settings:
|
|
8
|
+
|
|
9
|
+
- `$compileProvider.aHrefSanitizationTrustedUrlList(...)`
|
|
10
|
+
- `$compileProvider.imgSrcSanitizationTrustedUrlList(...)`.
|
|
11
|
+
|
|
12
|
+
## What this rule reports
|
|
13
|
+
|
|
14
|
+
This rule reports direct calls that broaden which URL patterns AngularJS treats
|
|
15
|
+
as trusted for links and image sources.
|
|
16
|
+
|
|
17
|
+
## Why this rule exists
|
|
18
|
+
|
|
19
|
+
Relaxing trusted URL lists can enable unsafe protocols or domains and increase
|
|
20
|
+
XSS and data exfiltration risk.
|
|
21
|
+
|
|
22
|
+
## ❌ Incorrect
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
$compileProvider.aHrefSanitizationTrustedUrlList(/.*/);
|
|
26
|
+
$compileProvider.imgSrcSanitizationTrustedUrlList(/.*/);
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## ✅ Correct
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
// Keep framework defaults unless a narrow, reviewed allow-list is required.
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## ESLint flat config example
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
import sdl from "eslint-plugin-sdl-2";
|
|
39
|
+
|
|
40
|
+
export default [
|
|
41
|
+
{
|
|
42
|
+
plugins: { sdl },
|
|
43
|
+
rules: {
|
|
44
|
+
"sdl/no-angular-sanitization-trusted-urls": "error",
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
];
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## When not to use it
|
|
51
|
+
|
|
52
|
+
Disable only for legacy AngularJS deployments where URL list updates are
|
|
53
|
+
strictly reviewed and monitored.
|
|
54
|
+
|
|
55
|
+
## Package documentation
|
|
56
|
+
|
|
57
|
+
- [Rule source](../../src/rules/no-angular-sanitization-trusted-urls.ts)
|
|
58
|
+
|
|
59
|
+
## Further reading
|
|
60
|
+
|
|
61
|
+
> **Rule catalog ID:** R002
|
|
62
|
+
|
|
63
|
+
- [AngularJS `$compileProvider` API](https://docs.angularjs.org/api/ng/provider/%24compileProvider)
|
|
64
|
+
- [AngularJS security guide](https://docs.angularjs.org/guide/security)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# no-angularjs-bypass-sce
|
|
2
|
+
|
|
3
|
+
Disallow AngularJS Strict Contextual Escaping (SCE) bypass operations.
|
|
4
|
+
|
|
5
|
+
## Targeted pattern scope
|
|
6
|
+
|
|
7
|
+
This rule targets APIs that disable or bypass SCE, including:
|
|
8
|
+
|
|
9
|
+
- `$sceProvider.enabled(false)`
|
|
10
|
+
- `$sceDelegate.trustAs(...)`
|
|
11
|
+
- `$sce.trustAs(...)` and shorthand variants such as `trustAsHtml(...)`.
|
|
12
|
+
|
|
13
|
+
## What this rule reports
|
|
14
|
+
|
|
15
|
+
This rule reports SCE bypass usage that marks values as trusted without
|
|
16
|
+
framework sanitization.
|
|
17
|
+
|
|
18
|
+
## Why this rule exists
|
|
19
|
+
|
|
20
|
+
SCE is a core AngularJS defense against unsafe DOM and script sinks. Bypassing
|
|
21
|
+
it expands XSS attack surface.
|
|
22
|
+
|
|
23
|
+
## ❌ Incorrect
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
$sceProvider.enabled(false);
|
|
27
|
+
const trusted = $sce.trustAsHtml(userSuppliedHtml);
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## ✅ Correct
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
// Keep SCE enabled and render untrusted data through AngularJS bindings.
|
|
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-angularjs-bypass-sce": "error",
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## When not to use it
|
|
52
|
+
|
|
53
|
+
Disable only in tightly controlled migration paths where bypass calls are
|
|
54
|
+
isolated and reviewed.
|
|
55
|
+
|
|
56
|
+
## Package documentation
|
|
57
|
+
|
|
58
|
+
- [Rule source](../../src/rules/no-angularjs-bypass-sce.ts)
|
|
59
|
+
|
|
60
|
+
## Further reading
|
|
61
|
+
|
|
62
|
+
> **Rule catalog ID:** R003
|
|
63
|
+
|
|
64
|
+
- [AngularJS `$sce` strict contextual escaping](https://docs.angularjs.org/api/ng/service/%24sce#strict-contextual-escaping)
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# no-angularjs-enable-svg
|
|
2
|
+
|
|
3
|
+
Disallow enabling AngularJS sanitizer SVG support without strict review.
|
|
4
|
+
|
|
5
|
+
## Targeted pattern scope
|
|
6
|
+
|
|
7
|
+
This rule targets `$sanitizeProvider.enableSvg(true)` calls.
|
|
8
|
+
|
|
9
|
+
## What this rule reports
|
|
10
|
+
|
|
11
|
+
This rule reports code that enables SVG support in AngularJS sanitization
|
|
12
|
+
configuration.
|
|
13
|
+
|
|
14
|
+
## Why this rule exists
|
|
15
|
+
|
|
16
|
+
SVG content can introduce scriptable surfaces and raise injection risk when
|
|
17
|
+
enabled in sanitizers.
|
|
18
|
+
|
|
19
|
+
## ❌ Incorrect
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
$sanitizeProvider.enableSvg(true);
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## ✅ Correct
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
$sanitizeProvider.enableSvg(false);
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## ESLint flat config example
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
import sdl from "eslint-plugin-sdl-2";
|
|
35
|
+
|
|
36
|
+
export default [
|
|
37
|
+
{
|
|
38
|
+
plugins: { sdl },
|
|
39
|
+
rules: {
|
|
40
|
+
"sdl/no-angularjs-enable-svg": "error",
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
];
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## When not to use it
|
|
47
|
+
|
|
48
|
+
Disable only when SVG rendering is mandatory and guarded by a reviewed
|
|
49
|
+
sanitization strategy.
|
|
50
|
+
|
|
51
|
+
## Package documentation
|
|
52
|
+
|
|
53
|
+
- [Rule source](../../src/rules/no-angularjs-enable-svg.ts)
|
|
54
|
+
|
|
55
|
+
## Further reading
|
|
56
|
+
|
|
57
|
+
> **Rule catalog ID:** R004
|
|
58
|
+
|
|
59
|
+
- [AngularJS `$sanitizeProvider.enableSvg` docs](https://docs.angularjs.org/api/ngSanitize/provider/%24sanitizeProvider#enableSvg)
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# no-angularjs-ng-bind-html-without-sanitize
|
|
2
|
+
|
|
3
|
+
Disallow AngularJS `ng-bind-html` usage when sanitization is not explicit.
|
|
4
|
+
|
|
5
|
+
## Targeted pattern scope
|
|
6
|
+
|
|
7
|
+
AngularJS templates using `ng-bind-html` without explicit sanitize context.
|
|
8
|
+
|
|
9
|
+
## What this rule reports
|
|
10
|
+
|
|
11
|
+
`ng-bind-html` usage in template strings that do not indicate sanitize support.
|
|
12
|
+
|
|
13
|
+
## Why this rule exists
|
|
14
|
+
|
|
15
|
+
Unsafe HTML binding in AngularJS can lead to reflected or stored XSS.
|
|
16
|
+
|
|
17
|
+
## ❌ Incorrect
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
const template = `<div ng-bind-html="unsafeHtml"></div>`;
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## ✅ Correct
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
const template = `<div ng-bind-html="trustedHtml" ngSanitize></div>`;
|
|
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-angularjs-ng-bind-html-without-sanitize": "error",
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## When not to use it
|
|
46
|
+
|
|
47
|
+
Disable only if the project has explicit AngularJS sanitization controls and a reviewed HTML trust pipeline.
|
|
48
|
+
|
|
49
|
+
## Package documentation
|
|
50
|
+
|
|
51
|
+
- [Rule source](../../src/rules/no-angularjs-ng-bind-html-without-sanitize.ts)
|
|
52
|
+
|
|
53
|
+
## Further reading
|
|
54
|
+
|
|
55
|
+
> **Rule catalog ID:** R030
|
|
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,63 @@
|
|
|
1
|
+
# no-angularjs-sanitization-whitelist
|
|
2
|
+
|
|
3
|
+
Disallow AngularJS sanitization whitelist mutations that expand trusted inputs.
|
|
4
|
+
|
|
5
|
+
## Targeted pattern scope
|
|
6
|
+
|
|
7
|
+
This rule targets writes and calls that configure:
|
|
8
|
+
|
|
9
|
+
- `$compileProvider.aHrefSanitizationWhitelist(...)`
|
|
10
|
+
- `$compileProvider.imgSrcSanitizationWhitelist(...)`.
|
|
11
|
+
|
|
12
|
+
## What this rule reports
|
|
13
|
+
|
|
14
|
+
This rule reports allow-list mutations that broaden URL patterns accepted by
|
|
15
|
+
the AngularJS sanitizer.
|
|
16
|
+
|
|
17
|
+
## Why this rule exists
|
|
18
|
+
|
|
19
|
+
Overly broad sanitizer allow-lists can permit unsafe protocols or payloads and
|
|
20
|
+
increase XSS risk.
|
|
21
|
+
|
|
22
|
+
## ❌ Incorrect
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
$compileProvider.aHrefSanitizationWhitelist(/.*/);
|
|
26
|
+
$compileProvider.imgSrcSanitizationWhitelist(/.*/);
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## ✅ Correct
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
// Keep default AngularJS sanitizer allow-lists.
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## ESLint flat config example
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
import sdl from "eslint-plugin-sdl-2";
|
|
39
|
+
|
|
40
|
+
export default [
|
|
41
|
+
{
|
|
42
|
+
plugins: { sdl },
|
|
43
|
+
rules: {
|
|
44
|
+
"sdl/no-angularjs-sanitization-whitelist": "error",
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
];
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## When not to use it
|
|
51
|
+
|
|
52
|
+
Disable only when a migration requires temporary allow-list expansion that is
|
|
53
|
+
strictly bounded and reviewed.
|
|
54
|
+
|
|
55
|
+
## Package documentation
|
|
56
|
+
|
|
57
|
+
- [Rule source](../../src/rules/no-angularjs-sanitization-whitelist.ts)
|
|
58
|
+
|
|
59
|
+
## Further reading
|
|
60
|
+
|
|
61
|
+
> **Rule catalog ID:** R005
|
|
62
|
+
|
|
63
|
+
- [AngularJS `$compileProvider` API](https://docs.angularjs.org/api/ng/provider/%24compileProvider)
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# no-angularjs-sce-resource-url-wildcard
|
|
2
|
+
|
|
3
|
+
Disallow wildcard AngularJS SCE resource URL whitelist entries.
|
|
4
|
+
|
|
5
|
+
## Targeted pattern scope
|
|
6
|
+
|
|
7
|
+
AngularJS SCE whitelist configurations using wildcard entries.
|
|
8
|
+
|
|
9
|
+
## What this rule reports
|
|
10
|
+
|
|
11
|
+
`resourceUrlWhitelist([...])` entries that contain wildcard values.
|
|
12
|
+
|
|
13
|
+
## Why this rule exists
|
|
14
|
+
|
|
15
|
+
Wildcard resource URL allowlists can over-trust unreviewed remote origins.
|
|
16
|
+
|
|
17
|
+
## ❌ Incorrect
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
$sceDelegateProvider.resourceUrlWhitelist(["self", "*"]);
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## ✅ Correct
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
$sceDelegateProvider.resourceUrlWhitelist([
|
|
27
|
+
"self",
|
|
28
|
+
"https://cdn.example.com/app",
|
|
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-angularjs-sce-resource-url-wildcard": "error",
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
];
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## When not to use it
|
|
49
|
+
|
|
50
|
+
Disable only if wildcard resource URLs are part of a reviewed legacy exception with strong compensating controls.
|
|
51
|
+
|
|
52
|
+
## Package documentation
|
|
53
|
+
|
|
54
|
+
- [Rule source](../../src/rules/no-angularjs-sce-resource-url-wildcard.ts)
|
|
55
|
+
|
|
56
|
+
## Further reading
|
|
57
|
+
|
|
58
|
+
> **Rule catalog ID:** R031
|
|
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/)
|