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.
Files changed (418) hide show
  1. package/CHANGELOG.md +5316 -0
  2. package/LICENSE +21 -0
  3. package/README.md +133 -0
  4. package/dist/_internal/ast-utils.d.ts +17 -0
  5. package/dist/_internal/ast-utils.d.ts.map +1 -0
  6. package/dist/_internal/ast-utils.js +93 -0
  7. package/dist/_internal/ast-utils.js.map +1 -0
  8. package/dist/_internal/config-references.d.ts +5 -0
  9. package/dist/_internal/config-references.d.ts.map +1 -0
  10. package/dist/_internal/config-references.js +13 -0
  11. package/dist/_internal/config-references.js.map +1 -0
  12. package/dist/_internal/create-rule.d.ts +9 -0
  13. package/dist/_internal/create-rule.d.ts.map +1 -0
  14. package/dist/_internal/create-rule.js +6 -0
  15. package/dist/_internal/create-rule.js.map +1 -0
  16. package/dist/_internal/domparser.d.ts +19 -0
  17. package/dist/_internal/domparser.d.ts.map +1 -0
  18. package/dist/_internal/domparser.js +45 -0
  19. package/dist/_internal/domparser.js.map +1 -0
  20. package/dist/_internal/electron-web-preferences.d.ts +14 -0
  21. package/dist/_internal/electron-web-preferences.d.ts.map +1 -0
  22. package/dist/_internal/electron-web-preferences.js +63 -0
  23. package/dist/_internal/electron-web-preferences.js.map +1 -0
  24. package/dist/_internal/estree-utils.d.ts +51 -0
  25. package/dist/_internal/estree-utils.d.ts.map +1 -0
  26. package/dist/_internal/estree-utils.js +112 -0
  27. package/dist/_internal/estree-utils.js.map +1 -0
  28. package/dist/_internal/node-tls-config.d.ts +44 -0
  29. package/dist/_internal/node-tls-config.d.ts.map +1 -0
  30. package/dist/_internal/node-tls-config.js +101 -0
  31. package/dist/_internal/node-tls-config.js.map +1 -0
  32. package/dist/_internal/rules-registry.d.ts +10 -0
  33. package/dist/_internal/rules-registry.d.ts.map +1 -0
  34. package/dist/_internal/rules-registry.js +148 -0
  35. package/dist/_internal/rules-registry.js.map +1 -0
  36. package/dist/_internal/script-element.d.ts +7 -0
  37. package/dist/_internal/script-element.d.ts.map +1 -0
  38. package/dist/_internal/script-element.js +46 -0
  39. package/dist/_internal/script-element.js.map +1 -0
  40. package/dist/_internal/worker-code-loading.d.ts +69 -0
  41. package/dist/_internal/worker-code-loading.d.ts.map +1 -0
  42. package/dist/_internal/worker-code-loading.js +134 -0
  43. package/dist/_internal/worker-code-loading.js.map +1 -0
  44. package/dist/plugin.cjs +6036 -0
  45. package/dist/plugin.cjs.map +7 -0
  46. package/dist/plugin.d.cts +11 -0
  47. package/dist/plugin.d.ts +11 -0
  48. package/dist/plugin.d.ts.map +1 -0
  49. package/dist/plugin.js +235 -0
  50. package/dist/plugin.js.map +1 -0
  51. package/dist/rules/no-angular-bypass-sanitizer.d.ts +5 -0
  52. package/dist/rules/no-angular-bypass-sanitizer.d.ts.map +1 -0
  53. package/dist/rules/no-angular-bypass-sanitizer.js +32 -0
  54. package/dist/rules/no-angular-bypass-sanitizer.js.map +1 -0
  55. package/dist/rules/no-angular-bypass-security-trust-html.d.ts +5 -0
  56. package/dist/rules/no-angular-bypass-security-trust-html.d.ts.map +1 -0
  57. package/dist/rules/no-angular-bypass-security-trust-html.js +51 -0
  58. package/dist/rules/no-angular-bypass-security-trust-html.js.map +1 -0
  59. package/dist/rules/no-angular-innerhtml-binding.d.ts +5 -0
  60. package/dist/rules/no-angular-innerhtml-binding.d.ts.map +1 -0
  61. package/dist/rules/no-angular-innerhtml-binding.js +57 -0
  62. package/dist/rules/no-angular-innerhtml-binding.js.map +1 -0
  63. package/dist/rules/no-angular-sanitization-trusted-urls.d.ts +5 -0
  64. package/dist/rules/no-angular-sanitization-trusted-urls.d.ts.map +1 -0
  65. package/dist/rules/no-angular-sanitization-trusted-urls.js +32 -0
  66. package/dist/rules/no-angular-sanitization-trusted-urls.js.map +1 -0
  67. package/dist/rules/no-angularjs-bypass-sce.d.ts +5 -0
  68. package/dist/rules/no-angularjs-bypass-sce.d.ts.map +1 -0
  69. package/dist/rules/no-angularjs-bypass-sce.js +80 -0
  70. package/dist/rules/no-angularjs-bypass-sce.js.map +1 -0
  71. package/dist/rules/no-angularjs-enable-svg.d.ts +5 -0
  72. package/dist/rules/no-angularjs-enable-svg.d.ts.map +1 -0
  73. package/dist/rules/no-angularjs-enable-svg.js +48 -0
  74. package/dist/rules/no-angularjs-enable-svg.js.map +1 -0
  75. package/dist/rules/no-angularjs-ng-bind-html-without-sanitize.d.ts +5 -0
  76. package/dist/rules/no-angularjs-ng-bind-html-without-sanitize.d.ts.map +1 -0
  77. package/dist/rules/no-angularjs-ng-bind-html-without-sanitize.js +64 -0
  78. package/dist/rules/no-angularjs-ng-bind-html-without-sanitize.js.map +1 -0
  79. package/dist/rules/no-angularjs-sanitization-whitelist.d.ts +5 -0
  80. package/dist/rules/no-angularjs-sanitization-whitelist.d.ts.map +1 -0
  81. package/dist/rules/no-angularjs-sanitization-whitelist.js +32 -0
  82. package/dist/rules/no-angularjs-sanitization-whitelist.js.map +1 -0
  83. package/dist/rules/no-angularjs-sce-resource-url-wildcard.d.ts +5 -0
  84. package/dist/rules/no-angularjs-sce-resource-url-wildcard.d.ts.map +1 -0
  85. package/dist/rules/no-angularjs-sce-resource-url-wildcard.js +69 -0
  86. package/dist/rules/no-angularjs-sce-resource-url-wildcard.js.map +1 -0
  87. package/dist/rules/no-child-process-exec.d.ts +5 -0
  88. package/dist/rules/no-child-process-exec.d.ts.map +1 -0
  89. package/dist/rules/no-child-process-exec.js +141 -0
  90. package/dist/rules/no-child-process-exec.js.map +1 -0
  91. package/dist/rules/no-child-process-shell-true.d.ts +5 -0
  92. package/dist/rules/no-child-process-shell-true.d.ts.map +1 -0
  93. package/dist/rules/no-child-process-shell-true.js +89 -0
  94. package/dist/rules/no-child-process-shell-true.js.map +1 -0
  95. package/dist/rules/no-cookies.d.ts +5 -0
  96. package/dist/rules/no-cookies.d.ts.map +1 -0
  97. package/dist/rules/no-cookies.js +38 -0
  98. package/dist/rules/no-cookies.js.map +1 -0
  99. package/dist/rules/no-document-domain.d.ts +5 -0
  100. package/dist/rules/no-document-domain.d.ts.map +1 -0
  101. package/dist/rules/no-document-domain.js +41 -0
  102. package/dist/rules/no-document-domain.js.map +1 -0
  103. package/dist/rules/no-document-execcommand-insert-html.d.ts +5 -0
  104. package/dist/rules/no-document-execcommand-insert-html.d.ts.map +1 -0
  105. package/dist/rules/no-document-execcommand-insert-html.js +57 -0
  106. package/dist/rules/no-document-execcommand-insert-html.js.map +1 -0
  107. package/dist/rules/no-document-parse-html-unsafe.d.ts +5 -0
  108. package/dist/rules/no-document-parse-html-unsafe.d.ts.map +1 -0
  109. package/dist/rules/no-document-parse-html-unsafe.js +67 -0
  110. package/dist/rules/no-document-parse-html-unsafe.js.map +1 -0
  111. package/dist/rules/no-document-write.d.ts +5 -0
  112. package/dist/rules/no-document-write.d.ts.map +1 -0
  113. package/dist/rules/no-document-write.js +40 -0
  114. package/dist/rules/no-document-write.js.map +1 -0
  115. package/dist/rules/no-domparser-html-without-sanitization.d.ts +5 -0
  116. package/dist/rules/no-domparser-html-without-sanitization.d.ts.map +1 -0
  117. package/dist/rules/no-domparser-html-without-sanitization.js +56 -0
  118. package/dist/rules/no-domparser-html-without-sanitization.js.map +1 -0
  119. package/dist/rules/no-domparser-svg-without-sanitization.d.ts +5 -0
  120. package/dist/rules/no-domparser-svg-without-sanitization.d.ts.map +1 -0
  121. package/dist/rules/no-domparser-svg-without-sanitization.js +56 -0
  122. package/dist/rules/no-domparser-svg-without-sanitization.js.map +1 -0
  123. package/dist/rules/no-dynamic-import-unsafe-url.d.ts +5 -0
  124. package/dist/rules/no-dynamic-import-unsafe-url.d.ts.map +1 -0
  125. package/dist/rules/no-dynamic-import-unsafe-url.js +47 -0
  126. package/dist/rules/no-dynamic-import-unsafe-url.js.map +1 -0
  127. package/dist/rules/no-electron-allow-running-insecure-content.d.ts +5 -0
  128. package/dist/rules/no-electron-allow-running-insecure-content.d.ts.map +1 -0
  129. package/dist/rules/no-electron-allow-running-insecure-content.js +30 -0
  130. package/dist/rules/no-electron-allow-running-insecure-content.js.map +1 -0
  131. package/dist/rules/no-electron-dangerous-blink-features.d.ts +5 -0
  132. package/dist/rules/no-electron-dangerous-blink-features.d.ts.map +1 -0
  133. package/dist/rules/no-electron-dangerous-blink-features.js +89 -0
  134. package/dist/rules/no-electron-dangerous-blink-features.js.map +1 -0
  135. package/dist/rules/no-electron-disable-context-isolation.d.ts +5 -0
  136. package/dist/rules/no-electron-disable-context-isolation.d.ts.map +1 -0
  137. package/dist/rules/no-electron-disable-context-isolation.js +30 -0
  138. package/dist/rules/no-electron-disable-context-isolation.js.map +1 -0
  139. package/dist/rules/no-electron-disable-sandbox.d.ts +5 -0
  140. package/dist/rules/no-electron-disable-sandbox.d.ts.map +1 -0
  141. package/dist/rules/no-electron-disable-sandbox.js +30 -0
  142. package/dist/rules/no-electron-disable-sandbox.js.map +1 -0
  143. package/dist/rules/no-electron-disable-web-security.d.ts +5 -0
  144. package/dist/rules/no-electron-disable-web-security.d.ts.map +1 -0
  145. package/dist/rules/no-electron-disable-web-security.js +30 -0
  146. package/dist/rules/no-electron-disable-web-security.js.map +1 -0
  147. package/dist/rules/no-electron-enable-remote-module.d.ts +5 -0
  148. package/dist/rules/no-electron-enable-remote-module.d.ts.map +1 -0
  149. package/dist/rules/no-electron-enable-remote-module.js +30 -0
  150. package/dist/rules/no-electron-enable-remote-module.js.map +1 -0
  151. package/dist/rules/no-electron-enable-webview-tag.d.ts +5 -0
  152. package/dist/rules/no-electron-enable-webview-tag.d.ts.map +1 -0
  153. package/dist/rules/no-electron-enable-webview-tag.js +30 -0
  154. package/dist/rules/no-electron-enable-webview-tag.js.map +1 -0
  155. package/dist/rules/no-electron-experimental-features.d.ts +5 -0
  156. package/dist/rules/no-electron-experimental-features.d.ts.map +1 -0
  157. package/dist/rules/no-electron-experimental-features.js +30 -0
  158. package/dist/rules/no-electron-experimental-features.js.map +1 -0
  159. package/dist/rules/no-electron-expose-raw-ipc-renderer.d.ts +5 -0
  160. package/dist/rules/no-electron-expose-raw-ipc-renderer.d.ts.map +1 -0
  161. package/dist/rules/no-electron-expose-raw-ipc-renderer.js +108 -0
  162. package/dist/rules/no-electron-expose-raw-ipc-renderer.js.map +1 -0
  163. package/dist/rules/no-electron-insecure-certificate-error-handler.d.ts +5 -0
  164. package/dist/rules/no-electron-insecure-certificate-error-handler.d.ts.map +1 -0
  165. package/dist/rules/no-electron-insecure-certificate-error-handler.js +91 -0
  166. package/dist/rules/no-electron-insecure-certificate-error-handler.js.map +1 -0
  167. package/dist/rules/no-electron-insecure-certificate-verify-proc.d.ts +5 -0
  168. package/dist/rules/no-electron-insecure-certificate-verify-proc.d.ts.map +1 -0
  169. package/dist/rules/no-electron-insecure-certificate-verify-proc.js +75 -0
  170. package/dist/rules/no-electron-insecure-certificate-verify-proc.js.map +1 -0
  171. package/dist/rules/no-electron-insecure-permission-request-handler.d.ts +5 -0
  172. package/dist/rules/no-electron-insecure-permission-request-handler.d.ts.map +1 -0
  173. package/dist/rules/no-electron-insecure-permission-request-handler.js +75 -0
  174. package/dist/rules/no-electron-insecure-permission-request-handler.js.map +1 -0
  175. package/dist/rules/no-electron-node-integration.d.ts +5 -0
  176. package/dist/rules/no-electron-node-integration.d.ts.map +1 -0
  177. package/dist/rules/no-electron-node-integration.js +52 -0
  178. package/dist/rules/no-electron-node-integration.js.map +1 -0
  179. package/dist/rules/no-electron-permission-check-handler-allow-all.d.ts +5 -0
  180. package/dist/rules/no-electron-permission-check-handler-allow-all.d.ts.map +1 -0
  181. package/dist/rules/no-electron-permission-check-handler-allow-all.js +63 -0
  182. package/dist/rules/no-electron-permission-check-handler-allow-all.js.map +1 -0
  183. package/dist/rules/no-electron-unchecked-ipc-sender.d.ts +5 -0
  184. package/dist/rules/no-electron-unchecked-ipc-sender.d.ts.map +1 -0
  185. package/dist/rules/no-electron-unchecked-ipc-sender.js +90 -0
  186. package/dist/rules/no-electron-unchecked-ipc-sender.js.map +1 -0
  187. package/dist/rules/no-electron-unrestricted-navigation.d.ts +5 -0
  188. package/dist/rules/no-electron-unrestricted-navigation.d.ts.map +1 -0
  189. package/dist/rules/no-electron-unrestricted-navigation.js +100 -0
  190. package/dist/rules/no-electron-unrestricted-navigation.js.map +1 -0
  191. package/dist/rules/no-electron-untrusted-open-external.d.ts +5 -0
  192. package/dist/rules/no-electron-untrusted-open-external.d.ts.map +1 -0
  193. package/dist/rules/no-electron-untrusted-open-external.js +92 -0
  194. package/dist/rules/no-electron-untrusted-open-external.js.map +1 -0
  195. package/dist/rules/no-electron-webview-allowpopups.d.ts +5 -0
  196. package/dist/rules/no-electron-webview-allowpopups.d.ts.map +1 -0
  197. package/dist/rules/no-electron-webview-allowpopups.js +85 -0
  198. package/dist/rules/no-electron-webview-allowpopups.js.map +1 -0
  199. package/dist/rules/no-electron-webview-insecure-webpreferences.d.ts +5 -0
  200. package/dist/rules/no-electron-webview-insecure-webpreferences.d.ts.map +1 -0
  201. package/dist/rules/no-electron-webview-insecure-webpreferences.js +88 -0
  202. package/dist/rules/no-electron-webview-insecure-webpreferences.js.map +1 -0
  203. package/dist/rules/no-electron-webview-node-integration.d.ts +5 -0
  204. package/dist/rules/no-electron-webview-node-integration.d.ts.map +1 -0
  205. package/dist/rules/no-electron-webview-node-integration.js +107 -0
  206. package/dist/rules/no-electron-webview-node-integration.js.map +1 -0
  207. package/dist/rules/no-html-method.d.ts +5 -0
  208. package/dist/rules/no-html-method.d.ts.map +1 -0
  209. package/dist/rules/no-html-method.js +42 -0
  210. package/dist/rules/no-html-method.js.map +1 -0
  211. package/dist/rules/no-http-request-to-insecure-protocol.d.ts +5 -0
  212. package/dist/rules/no-http-request-to-insecure-protocol.d.ts.map +1 -0
  213. package/dist/rules/no-http-request-to-insecure-protocol.js +94 -0
  214. package/dist/rules/no-http-request-to-insecure-protocol.js.map +1 -0
  215. package/dist/rules/no-iframe-srcdoc.d.ts +5 -0
  216. package/dist/rules/no-iframe-srcdoc.d.ts.map +1 -0
  217. package/dist/rules/no-iframe-srcdoc.js +144 -0
  218. package/dist/rules/no-iframe-srcdoc.js.map +1 -0
  219. package/dist/rules/no-inner-html.d.ts +5 -0
  220. package/dist/rules/no-inner-html.d.ts.map +1 -0
  221. package/dist/rules/no-inner-html.js +67 -0
  222. package/dist/rules/no-inner-html.js.map +1 -0
  223. package/dist/rules/no-insecure-random.d.ts +5 -0
  224. package/dist/rules/no-insecure-random.d.ts.map +1 -0
  225. package/dist/rules/no-insecure-random.js +95 -0
  226. package/dist/rules/no-insecure-random.js.map +1 -0
  227. package/dist/rules/no-insecure-tls-agent-options.d.ts +5 -0
  228. package/dist/rules/no-insecure-tls-agent-options.d.ts.map +1 -0
  229. package/dist/rules/no-insecure-tls-agent-options.js +73 -0
  230. package/dist/rules/no-insecure-tls-agent-options.js.map +1 -0
  231. package/dist/rules/no-insecure-url.d.ts +12 -0
  232. package/dist/rules/no-insecure-url.d.ts.map +1 -0
  233. package/dist/rules/no-insecure-url.js +142 -0
  234. package/dist/rules/no-insecure-url.js.map +1 -0
  235. package/dist/rules/no-location-javascript-url.d.ts +5 -0
  236. package/dist/rules/no-location-javascript-url.d.ts.map +1 -0
  237. package/dist/rules/no-location-javascript-url.js +98 -0
  238. package/dist/rules/no-location-javascript-url.js.map +1 -0
  239. package/dist/rules/no-message-event-without-origin-check.d.ts +5 -0
  240. package/dist/rules/no-message-event-without-origin-check.d.ts.map +1 -0
  241. package/dist/rules/no-message-event-without-origin-check.js +183 -0
  242. package/dist/rules/no-message-event-without-origin-check.js.map +1 -0
  243. package/dist/rules/no-msapp-exec-unsafe.d.ts +5 -0
  244. package/dist/rules/no-msapp-exec-unsafe.d.ts.map +1 -0
  245. package/dist/rules/no-msapp-exec-unsafe.js +32 -0
  246. package/dist/rules/no-msapp-exec-unsafe.js.map +1 -0
  247. package/dist/rules/no-node-tls-check-server-identity-bypass.d.ts +5 -0
  248. package/dist/rules/no-node-tls-check-server-identity-bypass.d.ts.map +1 -0
  249. package/dist/rules/no-node-tls-check-server-identity-bypass.js +95 -0
  250. package/dist/rules/no-node-tls-check-server-identity-bypass.js.map +1 -0
  251. package/dist/rules/no-node-tls-legacy-protocol.d.ts +5 -0
  252. package/dist/rules/no-node-tls-legacy-protocol.d.ts.map +1 -0
  253. package/dist/rules/no-node-tls-legacy-protocol.js +106 -0
  254. package/dist/rules/no-node-tls-legacy-protocol.js.map +1 -0
  255. package/dist/rules/no-node-tls-reject-unauthorized-zero.d.ts +5 -0
  256. package/dist/rules/no-node-tls-reject-unauthorized-zero.d.ts.map +1 -0
  257. package/dist/rules/no-node-tls-reject-unauthorized-zero.js +93 -0
  258. package/dist/rules/no-node-tls-reject-unauthorized-zero.js.map +1 -0
  259. package/dist/rules/no-node-tls-security-level-zero.d.ts +5 -0
  260. package/dist/rules/no-node-tls-security-level-zero.d.ts.map +1 -0
  261. package/dist/rules/no-node-tls-security-level-zero.js +80 -0
  262. package/dist/rules/no-node-tls-security-level-zero.js.map +1 -0
  263. package/dist/rules/no-node-vm-run-in-context.d.ts +5 -0
  264. package/dist/rules/no-node-vm-run-in-context.d.ts.map +1 -0
  265. package/dist/rules/no-node-vm-run-in-context.js +186 -0
  266. package/dist/rules/no-node-vm-run-in-context.js.map +1 -0
  267. package/dist/rules/no-node-vm-source-text-module.d.ts +5 -0
  268. package/dist/rules/no-node-vm-source-text-module.d.ts.map +1 -0
  269. package/dist/rules/no-node-vm-source-text-module.js +126 -0
  270. package/dist/rules/no-node-vm-source-text-module.js.map +1 -0
  271. package/dist/rules/no-node-worker-threads-eval.d.ts +5 -0
  272. package/dist/rules/no-node-worker-threads-eval.d.ts.map +1 -0
  273. package/dist/rules/no-node-worker-threads-eval.js +151 -0
  274. package/dist/rules/no-node-worker-threads-eval.js.map +1 -0
  275. package/dist/rules/no-nonnull-assertion-on-security-input.d.ts +5 -0
  276. package/dist/rules/no-nonnull-assertion-on-security-input.d.ts.map +1 -0
  277. package/dist/rules/no-nonnull-assertion-on-security-input.js +48 -0
  278. package/dist/rules/no-nonnull-assertion-on-security-input.js.map +1 -0
  279. package/dist/rules/no-postmessage-star-origin.d.ts +5 -0
  280. package/dist/rules/no-postmessage-star-origin.d.ts.map +1 -0
  281. package/dist/rules/no-postmessage-star-origin.js +58 -0
  282. package/dist/rules/no-postmessage-star-origin.js.map +1 -0
  283. package/dist/rules/no-postmessage-without-origin-allowlist.d.ts +5 -0
  284. package/dist/rules/no-postmessage-without-origin-allowlist.d.ts.map +1 -0
  285. package/dist/rules/no-postmessage-without-origin-allowlist.js +80 -0
  286. package/dist/rules/no-postmessage-without-origin-allowlist.js.map +1 -0
  287. package/dist/rules/no-range-create-contextual-fragment.d.ts +5 -0
  288. package/dist/rules/no-range-create-contextual-fragment.d.ts.map +1 -0
  289. package/dist/rules/no-range-create-contextual-fragment.js +64 -0
  290. package/dist/rules/no-range-create-contextual-fragment.js.map +1 -0
  291. package/dist/rules/no-script-src-data-url.d.ts +5 -0
  292. package/dist/rules/no-script-src-data-url.d.ts.map +1 -0
  293. package/dist/rules/no-script-src-data-url.js +108 -0
  294. package/dist/rules/no-script-src-data-url.js.map +1 -0
  295. package/dist/rules/no-script-text.d.ts +5 -0
  296. package/dist/rules/no-script-text.d.ts.map +1 -0
  297. package/dist/rules/no-script-text.js +52 -0
  298. package/dist/rules/no-script-text.js.map +1 -0
  299. package/dist/rules/no-service-worker-unsafe-script-url.d.ts +5 -0
  300. package/dist/rules/no-service-worker-unsafe-script-url.d.ts.map +1 -0
  301. package/dist/rules/no-service-worker-unsafe-script-url.js +52 -0
  302. package/dist/rules/no-service-worker-unsafe-script-url.js.map +1 -0
  303. package/dist/rules/no-set-html-unsafe.d.ts +5 -0
  304. package/dist/rules/no-set-html-unsafe.d.ts.map +1 -0
  305. package/dist/rules/no-set-html-unsafe.js +48 -0
  306. package/dist/rules/no-set-html-unsafe.js.map +1 -0
  307. package/dist/rules/no-trusted-types-policy-pass-through.d.ts +5 -0
  308. package/dist/rules/no-trusted-types-policy-pass-through.d.ts.map +1 -0
  309. package/dist/rules/no-trusted-types-policy-pass-through.js +115 -0
  310. package/dist/rules/no-trusted-types-policy-pass-through.js.map +1 -0
  311. package/dist/rules/no-unsafe-alloc.d.ts +5 -0
  312. package/dist/rules/no-unsafe-alloc.d.ts.map +1 -0
  313. package/dist/rules/no-unsafe-alloc.js +51 -0
  314. package/dist/rules/no-unsafe-alloc.js.map +1 -0
  315. package/dist/rules/no-unsafe-cast-to-trusted-types.d.ts +5 -0
  316. package/dist/rules/no-unsafe-cast-to-trusted-types.d.ts.map +1 -0
  317. package/dist/rules/no-unsafe-cast-to-trusted-types.js +89 -0
  318. package/dist/rules/no-unsafe-cast-to-trusted-types.js.map +1 -0
  319. package/dist/rules/no-window-open-without-noopener.d.ts +5 -0
  320. package/dist/rules/no-window-open-without-noopener.d.ts.map +1 -0
  321. package/dist/rules/no-window-open-without-noopener.js +84 -0
  322. package/dist/rules/no-window-open-without-noopener.js.map +1 -0
  323. package/dist/rules/no-winjs-html-unsafe.d.ts +5 -0
  324. package/dist/rules/no-winjs-html-unsafe.d.ts.map +1 -0
  325. package/dist/rules/no-winjs-html-unsafe.js +32 -0
  326. package/dist/rules/no-winjs-html-unsafe.js.map +1 -0
  327. package/dist/rules/no-worker-blob-url.d.ts +5 -0
  328. package/dist/rules/no-worker-blob-url.d.ts.map +1 -0
  329. package/dist/rules/no-worker-blob-url.js +64 -0
  330. package/dist/rules/no-worker-blob-url.js.map +1 -0
  331. package/dist/rules/no-worker-data-url.d.ts +5 -0
  332. package/dist/rules/no-worker-data-url.d.ts.map +1 -0
  333. package/dist/rules/no-worker-data-url.js +67 -0
  334. package/dist/rules/no-worker-data-url.js.map +1 -0
  335. package/docs/rules/getting-started.md +70 -0
  336. package/docs/rules/no-angular-bypass-sanitizer.md +69 -0
  337. package/docs/rules/no-angular-bypass-security-trust-html.md +59 -0
  338. package/docs/rules/no-angular-innerhtml-binding.md +59 -0
  339. package/docs/rules/no-angular-sanitization-trusted-urls.md +64 -0
  340. package/docs/rules/no-angularjs-bypass-sce.md +64 -0
  341. package/docs/rules/no-angularjs-enable-svg.md +59 -0
  342. package/docs/rules/no-angularjs-ng-bind-html-without-sanitize.md +59 -0
  343. package/docs/rules/no-angularjs-sanitization-whitelist.md +63 -0
  344. package/docs/rules/no-angularjs-sce-resource-url-wildcard.md +62 -0
  345. package/docs/rules/no-child-process-exec.md +101 -0
  346. package/docs/rules/no-child-process-shell-true.md +59 -0
  347. package/docs/rules/no-cookies.md +61 -0
  348. package/docs/rules/no-document-domain.md +59 -0
  349. package/docs/rules/no-document-execcommand-insert-html.md +69 -0
  350. package/docs/rules/no-document-parse-html-unsafe.md +72 -0
  351. package/docs/rules/no-document-write.md +64 -0
  352. package/docs/rules/no-domparser-html-without-sanitization.md +59 -0
  353. package/docs/rules/no-domparser-svg-without-sanitization.md +71 -0
  354. package/docs/rules/no-dynamic-import-unsafe-url.md +81 -0
  355. package/docs/rules/no-electron-allow-running-insecure-content.md +69 -0
  356. package/docs/rules/no-electron-dangerous-blink-features.md +77 -0
  357. package/docs/rules/no-electron-disable-context-isolation.md +69 -0
  358. package/docs/rules/no-electron-disable-sandbox.md +69 -0
  359. package/docs/rules/no-electron-disable-web-security.md +69 -0
  360. package/docs/rules/no-electron-enable-remote-module.md +69 -0
  361. package/docs/rules/no-electron-enable-webview-tag.md +77 -0
  362. package/docs/rules/no-electron-experimental-features.md +77 -0
  363. package/docs/rules/no-electron-expose-raw-ipc-renderer.md +79 -0
  364. package/docs/rules/no-electron-insecure-certificate-error-handler.md +72 -0
  365. package/docs/rules/no-electron-insecure-certificate-verify-proc.md +63 -0
  366. package/docs/rules/no-electron-insecure-permission-request-handler.md +67 -0
  367. package/docs/rules/no-electron-node-integration.md +70 -0
  368. package/docs/rules/no-electron-permission-check-handler-allow-all.md +66 -0
  369. package/docs/rules/no-electron-unchecked-ipc-sender.md +62 -0
  370. package/docs/rules/no-electron-unrestricted-navigation.md +64 -0
  371. package/docs/rules/no-electron-untrusted-open-external.md +65 -0
  372. package/docs/rules/no-electron-webview-allowpopups.md +59 -0
  373. package/docs/rules/no-electron-webview-insecure-webpreferences.md +84 -0
  374. package/docs/rules/no-electron-webview-node-integration.md +59 -0
  375. package/docs/rules/no-html-method.md +58 -0
  376. package/docs/rules/no-http-request-to-insecure-protocol.md +59 -0
  377. package/docs/rules/no-iframe-srcdoc.md +76 -0
  378. package/docs/rules/no-inner-html.md +65 -0
  379. package/docs/rules/no-insecure-random.md +66 -0
  380. package/docs/rules/no-insecure-tls-agent-options.md +59 -0
  381. package/docs/rules/no-insecure-url.md +72 -0
  382. package/docs/rules/no-location-javascript-url.md +59 -0
  383. package/docs/rules/no-message-event-without-origin-check.md +82 -0
  384. package/docs/rules/no-msapp-exec-unsafe.md +59 -0
  385. package/docs/rules/no-node-tls-check-server-identity-bypass.md +88 -0
  386. package/docs/rules/no-node-tls-legacy-protocol.md +80 -0
  387. package/docs/rules/no-node-tls-reject-unauthorized-zero.md +61 -0
  388. package/docs/rules/no-node-tls-security-level-zero.md +77 -0
  389. package/docs/rules/no-node-vm-run-in-context.md +89 -0
  390. package/docs/rules/no-node-vm-source-text-module.md +79 -0
  391. package/docs/rules/no-node-worker-threads-eval.md +82 -0
  392. package/docs/rules/no-nonnull-assertion-on-security-input.md +59 -0
  393. package/docs/rules/no-postmessage-star-origin.md +59 -0
  394. package/docs/rules/no-postmessage-without-origin-allowlist.md +59 -0
  395. package/docs/rules/no-range-create-contextual-fragment.md +64 -0
  396. package/docs/rules/no-script-src-data-url.md +83 -0
  397. package/docs/rules/no-script-text.md +80 -0
  398. package/docs/rules/no-service-worker-unsafe-script-url.md +85 -0
  399. package/docs/rules/no-set-html-unsafe.md +64 -0
  400. package/docs/rules/no-trusted-types-policy-pass-through.md +68 -0
  401. package/docs/rules/no-unsafe-alloc.md +62 -0
  402. package/docs/rules/no-unsafe-cast-to-trusted-types.md +59 -0
  403. package/docs/rules/no-window-open-without-noopener.md +63 -0
  404. package/docs/rules/no-winjs-html-unsafe.md +60 -0
  405. package/docs/rules/no-worker-blob-url.md +86 -0
  406. package/docs/rules/no-worker-data-url.md +85 -0
  407. package/docs/rules/overview.md +111 -0
  408. package/docs/rules/presets/angular.md +35 -0
  409. package/docs/rules/presets/angularjs.md +36 -0
  410. package/docs/rules/presets/common.md +59 -0
  411. package/docs/rules/presets/electron.md +51 -0
  412. package/docs/rules/presets/index.md +26 -0
  413. package/docs/rules/presets/node.md +43 -0
  414. package/docs/rules/presets/react.md +33 -0
  415. package/docs/rules/presets/recommended.md +104 -0
  416. package/docs/rules/presets/required.md +99 -0
  417. package/docs/rules/presets/typescript.md +34 -0
  418. package/package.json +583 -0
@@ -0,0 +1,59 @@
1
+ # no-msapp-exec-unsafe
2
+
3
+ Disallow `MSApp.execUnsafeLocalFunction` calls that bypass script safety checks.
4
+
5
+ ## Targeted pattern scope
6
+
7
+ This rule targets `MSApp.execUnsafeLocalFunction(...)` usage.
8
+
9
+ ## What this rule reports
10
+
11
+ This rule reports direct calls to unsafe local function execution wrappers.
12
+
13
+ ## Why this rule exists
14
+
15
+ This API bypasses platform script injection protections and can allow unsafe DOM
16
+ or script execution.
17
+
18
+ ## ❌ Incorrect
19
+
20
+ ```ts
21
+ MSApp.execUnsafeLocalFunction(() => {
22
+ element.innerHTML = userSuppliedHtml;
23
+ });
24
+ ```
25
+
26
+ ## ✅ Correct
27
+
28
+ ```ts
29
+ element.textContent = userSuppliedHtml;
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
+ rules: {
41
+ "sdl/no-msapp-exec-unsafe": "error",
42
+ },
43
+ },
44
+ ];
45
+ ```
46
+
47
+ ## When not to use it
48
+
49
+ Disable only for legacy Windows Store app code that is isolated and audited.
50
+
51
+ ## Package documentation
52
+
53
+ - [Rule source](../../src/rules/no-msapp-exec-unsafe.ts)
54
+
55
+ ## Further reading
56
+
57
+ > **Rule catalog ID:** R022
58
+
59
+ - [Microsoft documentation: `MSApp.execUnsafeLocalFunction`](https://learn.microsoft.com/en-us/previous-versions/windows/apps/hh780593\(v=win.10\))
@@ -0,0 +1,88 @@
1
+ # no-node-tls-check-server-identity-bypass
2
+
3
+ Disallow Node.js `checkServerIdentity` overrides that always accept the peer hostname.
4
+
5
+ ## Targeted pattern scope
6
+
7
+ This rule targets Node.js TLS/HTTPS/http2 option objects, plus assignments to
8
+ `tls.checkServerIdentity`, when the configured callback always succeeds by:
9
+
10
+ - using an empty function body
11
+ - returning `undefined`
12
+ - returning `null`
13
+ - returning `void ...`
14
+
15
+ ## What this rule reports
16
+
17
+ This rule reports `checkServerIdentity` implementations that suppress hostname
18
+ verification instead of delegating to `tls.checkServerIdentity(...)` or a
19
+ reviewed stronger verification path.
20
+
21
+ ## Why this rule exists
22
+
23
+ Overriding `checkServerIdentity` is a security-sensitive escape hatch. A
24
+ callback that always returns success disables hostname validation and can allow
25
+ connections to certificates that do not match the expected server identity.
26
+
27
+ ## ❌ Incorrect
28
+
29
+ ```ts
30
+ import https from "node:https";
31
+ import tls from "node:tls";
32
+
33
+ https.request({
34
+ checkServerIdentity() {},
35
+ });
36
+
37
+ tls.checkServerIdentity = () => undefined;
38
+ ```
39
+
40
+ ## ✅ Correct
41
+
42
+ ```ts
43
+ import https from "node:https";
44
+ import tls from "node:tls";
45
+
46
+ https.request({
47
+ checkServerIdentity(hostname, cert) {
48
+ return tls.checkServerIdentity(hostname, cert);
49
+ },
50
+ });
51
+ ```
52
+
53
+ ## Behavior and migration notes
54
+
55
+ This rule intentionally reports only specific unsafe callback shapes. More
56
+ complex certificate pinning or hostname validation logic is not analyzed.
57
+
58
+ ## ESLint flat config example
59
+
60
+ ```ts
61
+ import sdl from "eslint-plugin-sdl-2";
62
+
63
+ export default [
64
+ {
65
+ plugins: { sdl },
66
+ rules: {
67
+ "sdl/no-node-tls-check-server-identity-bypass": "error",
68
+ },
69
+ },
70
+ ];
71
+ ```
72
+
73
+ ## When not to use it
74
+
75
+ Disable this rule only if your codebase has a reviewed custom
76
+ `checkServerIdentity` implementation and this rule's narrow syntactic heuristic
77
+ still flags that approved pattern.
78
+
79
+ ## Package documentation
80
+
81
+ - [Rule source](../../src/rules/no-node-tls-check-server-identity-bypass.ts)
82
+
83
+ ## Further reading
84
+
85
+ > **Rule catalog ID:** R061
86
+
87
+ - [Node.js TLS documentation: `checkServerIdentity`](https://nodejs.org/api/tls.html#tlscheckserveridentityhostname-cert)
88
+ - [OWASP Transport Layer Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Transport_Layer_Security_Cheat_Sheet.html)
@@ -0,0 +1,80 @@
1
+ # no-node-tls-legacy-protocol
2
+
3
+ Disallow legacy TLS protocol selection in Node.js TLS and HTTPS configuration.
4
+
5
+ ## Targeted pattern scope
6
+
7
+ This rule targets Node.js TLS and HTTPS option objects, plus assignments to
8
+ `tls.DEFAULT_MIN_VERSION` or `tls.DEFAULT_MAX_VERSION`, when they select legacy
9
+ protocols such as `TLSv1`, `TLSv1.0`, `TLSv1.1`, or legacy
10
+ `secureProtocol` values like `TLSv1_method`.
11
+
12
+ ## What this rule reports
13
+
14
+ This rule reports legacy protocol selection through:
15
+
16
+ - `minVersion`
17
+ - `maxVersion`
18
+ - `secureProtocol`
19
+ - `tls.DEFAULT_MIN_VERSION`
20
+ - `tls.DEFAULT_MAX_VERSION`
21
+
22
+ ## Why this rule exists
23
+
24
+ Allowing TLS 1.0 or TLS 1.1 weakens transport security and can re-enable
25
+ obsolete protocol negotiation for outbound or inbound connections. Modern Node
26
+ code should require TLS 1.2 or newer.
27
+
28
+ ## ❌ Incorrect
29
+
30
+ ```ts
31
+ import tls from "node:tls";
32
+ import https from "node:https";
33
+
34
+ tls.createSecureContext({ minVersion: "TLSv1.1" });
35
+ new https.Agent({ secureProtocol: "TLSv1_method" });
36
+ tls.DEFAULT_MIN_VERSION = "TLSv1";
37
+ ```
38
+
39
+ ## ✅ Correct
40
+
41
+ ```ts
42
+ import tls from "node:tls";
43
+ import https from "node:https";
44
+
45
+ tls.createSecureContext({ minVersion: "TLSv1.2" });
46
+ new https.Agent({ secureProtocol: "TLSv1_2_method" });
47
+ tls.DEFAULT_MIN_VERSION = "TLSv1.2";
48
+ ```
49
+
50
+ ## ESLint flat config example
51
+
52
+ ```ts
53
+ import sdl from "eslint-plugin-sdl-2";
54
+
55
+ export default [
56
+ {
57
+ plugins: { sdl },
58
+ rules: {
59
+ "sdl/no-node-tls-legacy-protocol": "error",
60
+ },
61
+ },
62
+ ];
63
+ ```
64
+
65
+ ## When not to use it
66
+
67
+ Disable this rule only if you intentionally maintain legacy interoperability
68
+ with endpoints that cannot support TLS 1.2 or newer, and that compatibility
69
+ decision is documented and explicitly accepted as risk.
70
+
71
+ ## Package documentation
72
+
73
+ - [Rule source](../../src/rules/no-node-tls-legacy-protocol.ts)
74
+
75
+ ## Further reading
76
+
77
+ > **Rule catalog ID:** R058
78
+
79
+ - [Node.js TLS documentation](https://nodejs.org/api/tls.html)
80
+ - [OWASP Transport Layer Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Transport_Layer_Security_Cheat_Sheet.html)
@@ -0,0 +1,61 @@
1
+ # no-node-tls-reject-unauthorized-zero
2
+
3
+ Disallow `process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"` in Node.js code.
4
+
5
+ ## Targeted pattern scope
6
+
7
+ This rule targets assignment expressions that set
8
+ `process.env.NODE_TLS_REJECT_UNAUTHORIZED` to `0` or `"0"`.
9
+
10
+ ## What this rule reports
11
+
12
+ This rule reports assignments that disable TLS certificate verification through
13
+ `NODE_TLS_REJECT_UNAUTHORIZED`.
14
+
15
+ ## Why this rule exists
16
+
17
+ Disabling certificate validation removes server identity verification and
18
+ introduces man-in-the-middle risk for outbound TLS connections.
19
+
20
+ ## ❌ Incorrect
21
+
22
+ ```ts
23
+ process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
24
+ ```
25
+
26
+ ## ✅ Correct
27
+
28
+ ```ts
29
+ process.env.NODE_TLS_REJECT_UNAUTHORIZED = "1";
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
+ rules: {
41
+ "sdl/no-node-tls-reject-unauthorized-zero": "error",
42
+ },
43
+ },
44
+ ];
45
+ ```
46
+
47
+ ## When not to use it
48
+
49
+ Disable only in tightly controlled local debugging contexts where no production
50
+ or shared environment can inherit the override.
51
+
52
+ ## Package documentation
53
+
54
+ - [Rule source](../../src/rules/no-node-tls-reject-unauthorized-zero.ts)
55
+
56
+ ## Further reading
57
+
58
+ > **Rule catalog ID:** R023
59
+
60
+ - [Node.js environment variables](https://nodejs.org/api/cli.html#environment-variables)
61
+ - [OWASP Transport Layer Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Transport_Layer_Security_Cheat_Sheet.html)
@@ -0,0 +1,77 @@
1
+ # no-node-tls-security-level-zero
2
+
3
+ Disallow lowering Node.js TLS cipher security to OpenSSL security level `0`.
4
+
5
+ ## Targeted pattern scope
6
+
7
+ This rule targets Node.js TLS and HTTPS option objects, plus assignments to
8
+ `tls.DEFAULT_CIPHERS`, when the configured cipher string explicitly lowers the
9
+ OpenSSL security level to `@SECLEVEL=0`.
10
+
11
+ ## What this rule reports
12
+
13
+ This rule reports TLS cipher configuration through:
14
+
15
+ - `ciphers`
16
+ - `tls.DEFAULT_CIPHERS`
17
+
18
+ when the configured string contains `@SECLEVEL=0`.
19
+
20
+ ## Why this rule exists
21
+
22
+ Lowering the OpenSSL security level to `0` weakens the TLS handshake policy and
23
+ can re-enable deprecated or unsafe cipher negotiation behavior. Node's default
24
+ TLS cipher policy is safer than explicitly downgrading to security level `0`.
25
+
26
+ ## ❌ Incorrect
27
+
28
+ ```ts
29
+ import https from "node:https";
30
+ import tls from "node:tls";
31
+
32
+ tls.createSecureContext({ ciphers: "DEFAULT@SECLEVEL=0" });
33
+ new https.Agent({ ciphers: "DEFAULT:@SECLEVEL=0" });
34
+ tls.DEFAULT_CIPHERS = "DEFAULT@SECLEVEL=0";
35
+ ```
36
+
37
+ ## ✅ Correct
38
+
39
+ ```ts
40
+ import https from "node:https";
41
+ import tls from "node:tls";
42
+
43
+ tls.createSecureContext({ ciphers: "DEFAULT" });
44
+ new https.Agent({ ciphers: "DEFAULT" });
45
+ tls.DEFAULT_CIPHERS = "DEFAULT";
46
+ ```
47
+
48
+ ## ESLint flat config example
49
+
50
+ ```ts
51
+ import sdl from "eslint-plugin-sdl-2";
52
+
53
+ export default [
54
+ {
55
+ plugins: { sdl },
56
+ rules: {
57
+ "sdl/no-node-tls-security-level-zero": "error",
58
+ },
59
+ },
60
+ ];
61
+ ```
62
+
63
+ ## When not to use it
64
+
65
+ Disable this rule only if you intentionally accept the risk of lowering OpenSSL
66
+ security policy for a documented legacy interoperability requirement.
67
+
68
+ ## Package documentation
69
+
70
+ - [Rule source](../../src/rules/no-node-tls-security-level-zero.ts)
71
+
72
+ ## Further reading
73
+
74
+ > **Rule catalog ID:** R059
75
+
76
+ - [Node.js TLS documentation](https://nodejs.org/api/tls.html)
77
+ - [OWASP Transport Layer Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Transport_Layer_Security_Cheat_Sheet.html)
@@ -0,0 +1,89 @@
1
+ ---
2
+ title: no-node-vm-run-in-context
3
+ ---
4
+
5
+ # no-node-vm-run-in-context
6
+
7
+ Disallow `node:vm` dynamic code execution APIs that are commonly mistaken for a security sandbox.
8
+
9
+ ## Targeted pattern scope
10
+
11
+ This rule targets `node:vm` and `vm` imports or `require(...)` bindings when
12
+ code is executed through:
13
+
14
+ - `runInNewContext(...)`
15
+ - `runInContext(...)`
16
+ - `runInThisContext(...)`
17
+ - `compileFunction(...)`
18
+ - `new Script(...)`
19
+
20
+ ## What this rule reports
21
+
22
+ This rule reports direct use of the `vm` module's code-execution APIs because
23
+ those APIs compile or execute JavaScript source text.
24
+
25
+ ## Why this rule exists
26
+
27
+ Node's own documentation warns that the `vm` module is not a security
28
+ mechanism. Teams sometimes treat it like a safe sandbox for untrusted code, but
29
+ that assumption is fragile and can lead to code execution or sandbox-escape
30
+ exposure.
31
+
32
+ ## ❌ Incorrect
33
+
34
+ ```ts
35
+ import vm from "node:vm";
36
+
37
+ vm.runInNewContext(userCode, sandbox);
38
+ ```
39
+
40
+ ```ts
41
+ const { Script } = require("vm");
42
+
43
+ new Script(untrustedSource);
44
+ ```
45
+
46
+ ## ✅ Correct
47
+
48
+ ```ts
49
+ import vm from "node:vm";
50
+
51
+ vm.measureMemory();
52
+ ```
53
+
54
+ ## Behavior and migration notes
55
+
56
+ This rule intentionally focuses on the `vm` module's code-execution entry
57
+ points. It does not attempt to determine whether a specific source string is
58
+ trusted.
59
+
60
+ ## ESLint flat config example
61
+
62
+ ```ts
63
+ import sdl from "eslint-plugin-sdl-2";
64
+
65
+ export default [
66
+ {
67
+ plugins: { sdl },
68
+ rules: {
69
+ "sdl/no-node-vm-run-in-context": "error",
70
+ },
71
+ },
72
+ ];
73
+ ```
74
+
75
+ ## When not to use it
76
+
77
+ Disable this rule only if your project has a reviewed and documented reason to
78
+ use `node:vm` code-execution APIs and that risk is accepted explicitly.
79
+
80
+ ## Package documentation
81
+
82
+ - [Rule source](../../src/rules/no-node-vm-run-in-context.ts)
83
+
84
+ ## Further reading
85
+
86
+ > **Rule catalog ID:** R064
87
+
88
+ - [Node.js documentation: `node:vm`](https://nodejs.org/api/vm.html)
89
+ - [Node.js documentation note: The `node:vm` module is not a security mechanism](https://nodejs.org/api/vm.html)
@@ -0,0 +1,79 @@
1
+ ---
2
+ title: no-node-vm-source-text-module
3
+ ---
4
+
5
+ # no-node-vm-source-text-module
6
+
7
+ Disallow `node:vm` `SourceTextModule` constructors that compile JavaScript source strings into executable modules.
8
+
9
+ ## Targeted pattern scope
10
+
11
+ This rule targets `SourceTextModule` constructors imported from `node:vm` or
12
+ `vm`.
13
+
14
+ The rule covers:
15
+
16
+ - named imports like `import { SourceTextModule } from "node:vm"`
17
+ - namespace/default bindings like `vm.SourceTextModule`
18
+ - CommonJS `require(...)` destructuring and namespace access
19
+
20
+ ## What this rule reports
21
+
22
+ This rule reports `new SourceTextModule(...)` for the Node `vm` module.
23
+
24
+ ## Why this rule exists
25
+
26
+ `SourceTextModule` compiles JavaScript module source from a string. Like other
27
+ `node:vm` code-loading APIs, it is easy to mistake this for a security boundary
28
+ when it is really an executable code sink that deserves explicit SDL review.
29
+
30
+ ## ❌ Incorrect
31
+
32
+ ```ts
33
+ import { SourceTextModule } from "node:vm";
34
+
35
+ new SourceTextModule(userSuppliedModuleCode);
36
+ ```
37
+
38
+ ## ✅ Correct
39
+
40
+ ```ts
41
+ await import(new URL("./module.js", import.meta.url).href);
42
+ ```
43
+
44
+ ## Behavior and migration notes
45
+
46
+ This rule intentionally focuses on `SourceTextModule` construction through the
47
+ Node `vm` module. It does not attempt to determine whether a specific source
48
+ string is trusted.
49
+
50
+ ## ESLint flat config example
51
+
52
+ ```ts
53
+ import sdl from "eslint-plugin-sdl-2";
54
+
55
+ export default [
56
+ {
57
+ plugins: { sdl },
58
+ rules: {
59
+ "sdl/no-node-vm-source-text-module": "error",
60
+ },
61
+ },
62
+ ];
63
+ ```
64
+
65
+ ## When not to use it
66
+
67
+ Disable this rule only if your project intentionally relies on `SourceTextModule`
68
+ and that design has been reviewed and approved.
69
+
70
+ ## Package documentation
71
+
72
+ - [Rule source](../../src/rules/no-node-vm-source-text-module.ts)
73
+
74
+ ## Further reading
75
+
76
+ > **Rule catalog ID:** R071
77
+
78
+ - [Node.js: `vm.SourceTextModule`](https://nodejs.org/api/vm.html)
79
+ - [CWE-94: Improper Control of Generation of Code](https://cwe.mitre.org/data/definitions/94.html)
@@ -0,0 +1,82 @@
1
+ ---
2
+ title: no-node-worker-threads-eval
3
+ ---
4
+
5
+ # no-node-worker-threads-eval
6
+
7
+ Disallow `node:worker_threads` `Worker` options that enable `eval: true` string execution.
8
+
9
+ ## Targeted pattern scope
10
+
11
+ This rule targets `Worker` constructors imported from `node:worker_threads` or
12
+ `worker_threads` when the options object contains `eval: true`.
13
+
14
+ The rule covers:
15
+
16
+ - named imports like `import { Worker } from "node:worker_threads"`
17
+ - namespace/default bindings like `workerThreads.Worker`
18
+ - CommonJS `require(...)` destructuring and namespace access
19
+
20
+ ## What this rule reports
21
+
22
+ This rule reports `new Worker(..., { eval: true })` for Node worker threads.
23
+
24
+ ## Why this rule exists
25
+
26
+ `eval: true` changes the first `Worker` argument from a reviewed script path to
27
+ an executable code string. That makes worker startup behave more like `eval()`
28
+ or `new Function(...)`, which is harder to review safely and can blur trust
29
+ boundaries around code execution.
30
+
31
+ ## ❌ Incorrect
32
+
33
+ ```ts
34
+ import { Worker } from "node:worker_threads";
35
+
36
+ new Worker(userSuppliedCode, { eval: true });
37
+ ```
38
+
39
+ ## ✅ Correct
40
+
41
+ ```ts
42
+ import { Worker } from "node:worker_threads";
43
+
44
+ new Worker(new URL("./worker.js", import.meta.url));
45
+ ```
46
+
47
+ ## Behavior and migration notes
48
+
49
+ This rule intentionally focuses on inline options objects with `eval: true` for
50
+ worker-thread constructors imported from the Node worker threads module.
51
+ Indirect options variables are out of scope.
52
+
53
+ ## ESLint flat config example
54
+
55
+ ```ts
56
+ import sdl from "eslint-plugin-sdl-2";
57
+
58
+ export default [
59
+ {
60
+ plugins: { sdl },
61
+ rules: {
62
+ "sdl/no-node-worker-threads-eval": "error",
63
+ },
64
+ },
65
+ ];
66
+ ```
67
+
68
+ ## When not to use it
69
+
70
+ Disable this rule only if your project intentionally relies on string-backed
71
+ worker-thread execution and that design has been reviewed and approved.
72
+
73
+ ## Package documentation
74
+
75
+ - [Rule source](../../src/rules/no-node-worker-threads-eval.ts)
76
+
77
+ ## Further reading
78
+
79
+ > **Rule catalog ID:** R068
80
+
81
+ - [Node.js: `worker_threads` `Worker` constructor](https://nodejs.org/api/worker_threads.html)
82
+ - [CWE-94: Improper Control of Generation of Code](https://cwe.mitre.org/data/definitions/94.html)
@@ -0,0 +1,59 @@
1
+ # no-nonnull-assertion-on-security-input
2
+
3
+ Disallow TypeScript non-null assertions on likely security-sensitive input values.
4
+
5
+ ## Targeted pattern scope
6
+
7
+ TypeScript non-null assertions on security-sensitive input values.
8
+
9
+ ## What this rule reports
10
+
11
+ TS non-null assertions on identifiers/properties with security-sensitive names.
12
+
13
+ ## Why this rule exists
14
+
15
+ Non-null assertions can hide validation gaps and bypass defensive checks on attacker-controlled input.
16
+
17
+ ## ❌ Incorrect
18
+
19
+ ```ts
20
+ const safe = userInput!;
21
+ ```
22
+
23
+ ## ✅ Correct
24
+
25
+ ```ts
26
+ const safe = validateInput(userInput);
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-nonnull-assertion-on-security-input": "error",
40
+ },
41
+ },
42
+ ];
43
+ ```
44
+
45
+ ## When not to use it
46
+
47
+ Disable only if the value has already been validated by a reviewed guard that this rule cannot statically recognize.
48
+
49
+ ## Package documentation
50
+
51
+ - [Rule source](../../src/rules/no-nonnull-assertion-on-security-input.ts)
52
+
53
+ ## Further reading
54
+
55
+ > **Rule catalog ID:** R043
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/)