@nahisaho/musubix-security 2.0.1 → 2.1.0

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 (363) hide show
  1. package/dist/analysis/enhanced-taint-analyzer.d.ts +120 -0
  2. package/dist/analysis/enhanced-taint-analyzer.d.ts.map +1 -0
  3. package/dist/analysis/enhanced-taint-analyzer.js +450 -0
  4. package/dist/analysis/enhanced-taint-analyzer.js.map +1 -0
  5. package/dist/analysis/index.d.ts +1 -0
  6. package/dist/analysis/index.d.ts.map +1 -1
  7. package/dist/analysis/index.js +1 -0
  8. package/dist/analysis/index.js.map +1 -1
  9. package/dist/analysis/interprocedural/call-graph-builder.d.ts +192 -0
  10. package/dist/analysis/interprocedural/call-graph-builder.d.ts.map +1 -0
  11. package/dist/analysis/interprocedural/call-graph-builder.js +510 -0
  12. package/dist/analysis/interprocedural/call-graph-builder.js.map +1 -0
  13. package/dist/analysis/interprocedural/dfg-adapter.d.ts +166 -0
  14. package/dist/analysis/interprocedural/dfg-adapter.d.ts.map +1 -0
  15. package/dist/analysis/interprocedural/dfg-adapter.js +455 -0
  16. package/dist/analysis/interprocedural/dfg-adapter.js.map +1 -0
  17. package/dist/analysis/interprocedural/index.d.ts +9 -0
  18. package/dist/analysis/interprocedural/index.d.ts.map +1 -0
  19. package/dist/analysis/interprocedural/index.js +9 -0
  20. package/dist/analysis/interprocedural/index.js.map +1 -0
  21. package/dist/analysis/interprocedural/taint-propagator.d.ts +250 -0
  22. package/dist/analysis/interprocedural/taint-propagator.d.ts.map +1 -0
  23. package/dist/analysis/interprocedural/taint-propagator.js +435 -0
  24. package/dist/analysis/interprocedural/taint-propagator.js.map +1 -0
  25. package/dist/analysis/sanitizers/command-sanitizers.d.ts +12 -0
  26. package/dist/analysis/sanitizers/command-sanitizers.d.ts.map +1 -0
  27. package/dist/analysis/sanitizers/command-sanitizers.js +123 -0
  28. package/dist/analysis/sanitizers/command-sanitizers.js.map +1 -0
  29. package/dist/analysis/sanitizers/html-sanitizers.d.ts +12 -0
  30. package/dist/analysis/sanitizers/html-sanitizers.d.ts.map +1 -0
  31. package/dist/analysis/sanitizers/html-sanitizers.js +213 -0
  32. package/dist/analysis/sanitizers/html-sanitizers.js.map +1 -0
  33. package/dist/analysis/sanitizers/index.d.ts +35 -0
  34. package/dist/analysis/sanitizers/index.d.ts.map +1 -0
  35. package/dist/analysis/sanitizers/index.js +59 -0
  36. package/dist/analysis/sanitizers/index.js.map +1 -0
  37. package/dist/analysis/sanitizers/path-sanitizers.d.ts +12 -0
  38. package/dist/analysis/sanitizers/path-sanitizers.d.ts.map +1 -0
  39. package/dist/analysis/sanitizers/path-sanitizers.js +163 -0
  40. package/dist/analysis/sanitizers/path-sanitizers.js.map +1 -0
  41. package/dist/analysis/sanitizers/sql-sanitizers.d.ts +12 -0
  42. package/dist/analysis/sanitizers/sql-sanitizers.d.ts.map +1 -0
  43. package/dist/analysis/sanitizers/sql-sanitizers.js +216 -0
  44. package/dist/analysis/sanitizers/sql-sanitizers.js.map +1 -0
  45. package/dist/analysis/sanitizers/types.d.ts +78 -0
  46. package/dist/analysis/sanitizers/types.d.ts.map +1 -0
  47. package/dist/analysis/sanitizers/types.js +7 -0
  48. package/dist/analysis/sanitizers/types.js.map +1 -0
  49. package/dist/analysis/sanitizers/validation-sanitizers.d.ts +12 -0
  50. package/dist/analysis/sanitizers/validation-sanitizers.d.ts.map +1 -0
  51. package/dist/analysis/sanitizers/validation-sanitizers.js +268 -0
  52. package/dist/analysis/sanitizers/validation-sanitizers.js.map +1 -0
  53. package/dist/analysis/sinks/code-eval.d.ts +12 -0
  54. package/dist/analysis/sinks/code-eval.d.ts.map +1 -0
  55. package/dist/analysis/sinks/code-eval.js +231 -0
  56. package/dist/analysis/sinks/code-eval.js.map +1 -0
  57. package/dist/analysis/sinks/command-exec.d.ts +12 -0
  58. package/dist/analysis/sinks/command-exec.d.ts.map +1 -0
  59. package/dist/analysis/sinks/command-exec.js +187 -0
  60. package/dist/analysis/sinks/command-exec.js.map +1 -0
  61. package/dist/analysis/sinks/file-operations.d.ts +12 -0
  62. package/dist/analysis/sinks/file-operations.d.ts.map +1 -0
  63. package/dist/analysis/sinks/file-operations.js +239 -0
  64. package/dist/analysis/sinks/file-operations.js.map +1 -0
  65. package/dist/analysis/sinks/html-output.d.ts +12 -0
  66. package/dist/analysis/sinks/html-output.d.ts.map +1 -0
  67. package/dist/analysis/sinks/html-output.js +256 -0
  68. package/dist/analysis/sinks/html-output.js.map +1 -0
  69. package/dist/analysis/sinks/index.d.ts +30 -0
  70. package/dist/analysis/sinks/index.d.ts.map +1 -0
  71. package/dist/analysis/sinks/index.js +46 -0
  72. package/dist/analysis/sinks/index.js.map +1 -0
  73. package/dist/analysis/sinks/sql-query.d.ts +12 -0
  74. package/dist/analysis/sinks/sql-query.d.ts.map +1 -0
  75. package/dist/analysis/sinks/sql-query.js +209 -0
  76. package/dist/analysis/sinks/sql-query.js.map +1 -0
  77. package/dist/analysis/sinks/types.d.ts +97 -0
  78. package/dist/analysis/sinks/types.d.ts.map +1 -0
  79. package/dist/analysis/sinks/types.js +7 -0
  80. package/dist/analysis/sinks/types.js.map +1 -0
  81. package/dist/analysis/sources/database.d.ts +12 -0
  82. package/dist/analysis/sources/database.d.ts.map +1 -0
  83. package/dist/analysis/sources/database.js +211 -0
  84. package/dist/analysis/sources/database.js.map +1 -0
  85. package/dist/analysis/sources/environment.d.ts +12 -0
  86. package/dist/analysis/sources/environment.d.ts.map +1 -0
  87. package/dist/analysis/sources/environment.js +158 -0
  88. package/dist/analysis/sources/environment.js.map +1 -0
  89. package/dist/analysis/sources/file-system.d.ts +12 -0
  90. package/dist/analysis/sources/file-system.d.ts.map +1 -0
  91. package/dist/analysis/sources/file-system.js +180 -0
  92. package/dist/analysis/sources/file-system.js.map +1 -0
  93. package/dist/analysis/sources/http-request.d.ts +12 -0
  94. package/dist/analysis/sources/http-request.d.ts.map +1 -0
  95. package/dist/analysis/sources/http-request.js +179 -0
  96. package/dist/analysis/sources/http-request.js.map +1 -0
  97. package/dist/analysis/sources/index.d.ts +26 -0
  98. package/dist/analysis/sources/index.d.ts.map +1 -0
  99. package/dist/analysis/sources/index.js +40 -0
  100. package/dist/analysis/sources/index.js.map +1 -0
  101. package/dist/analysis/sources/types.d.ts +93 -0
  102. package/dist/analysis/sources/types.d.ts.map +1 -0
  103. package/dist/analysis/sources/types.js +7 -0
  104. package/dist/analysis/sources/types.js.map +1 -0
  105. package/dist/analysis/sources/user-input.d.ts +12 -0
  106. package/dist/analysis/sources/user-input.d.ts.map +1 -0
  107. package/dist/analysis/sources/user-input.js +261 -0
  108. package/dist/analysis/sources/user-input.js.map +1 -0
  109. package/dist/cve/cpe-matcher.d.ts +183 -0
  110. package/dist/cve/cpe-matcher.d.ts.map +1 -0
  111. package/dist/cve/cpe-matcher.js +396 -0
  112. package/dist/cve/cpe-matcher.js.map +1 -0
  113. package/dist/cve/cve-cache.d.ts +225 -0
  114. package/dist/cve/cve-cache.d.ts.map +1 -0
  115. package/dist/cve/cve-cache.js +452 -0
  116. package/dist/cve/cve-cache.js.map +1 -0
  117. package/dist/cve/cve-cache.test.d.ts +6 -0
  118. package/dist/cve/cve-cache.test.d.ts.map +1 -0
  119. package/dist/cve/cve-cache.test.js +363 -0
  120. package/dist/cve/cve-cache.test.js.map +1 -0
  121. package/dist/cve/dependency-parser.d.ts +204 -0
  122. package/dist/cve/dependency-parser.d.ts.map +1 -0
  123. package/dist/cve/dependency-parser.js +338 -0
  124. package/dist/cve/dependency-parser.js.map +1 -0
  125. package/dist/cve/index.d.ts +20 -0
  126. package/dist/cve/index.d.ts.map +1 -0
  127. package/dist/cve/index.js +13 -0
  128. package/dist/cve/index.js.map +1 -0
  129. package/dist/cve/nvd-client.d.ts +137 -0
  130. package/dist/cve/nvd-client.d.ts.map +1 -0
  131. package/dist/cve/nvd-client.js +333 -0
  132. package/dist/cve/nvd-client.js.map +1 -0
  133. package/dist/cve/rate-limiter.d.ts +194 -0
  134. package/dist/cve/rate-limiter.d.ts.map +1 -0
  135. package/dist/cve/rate-limiter.js +276 -0
  136. package/dist/cve/rate-limiter.js.map +1 -0
  137. package/dist/cve/report-generator.d.ts +145 -0
  138. package/dist/cve/report-generator.d.ts.map +1 -0
  139. package/dist/cve/report-generator.js +377 -0
  140. package/dist/cve/report-generator.js.map +1 -0
  141. package/dist/cve/report-generator.test.d.ts +6 -0
  142. package/dist/cve/report-generator.test.d.ts.map +1 -0
  143. package/dist/cve/report-generator.test.js +275 -0
  144. package/dist/cve/report-generator.test.js.map +1 -0
  145. package/dist/cve/vulnerability-scanner.d.ts +198 -0
  146. package/dist/cve/vulnerability-scanner.d.ts.map +1 -0
  147. package/dist/cve/vulnerability-scanner.js +311 -0
  148. package/dist/cve/vulnerability-scanner.js.map +1 -0
  149. package/dist/cve/vulnerability-scanner.test.d.ts +6 -0
  150. package/dist/cve/vulnerability-scanner.test.d.ts.map +1 -0
  151. package/dist/cve/vulnerability-scanner.test.js +329 -0
  152. package/dist/cve/vulnerability-scanner.test.js.map +1 -0
  153. package/dist/index.d.ts +1 -0
  154. package/dist/index.d.ts.map +1 -1
  155. package/dist/index.js +4 -0
  156. package/dist/index.js.map +1 -1
  157. package/dist/rules/config/config-parser.d.ts +119 -0
  158. package/dist/rules/config/config-parser.d.ts.map +1 -0
  159. package/dist/rules/config/config-parser.js +376 -0
  160. package/dist/rules/config/config-parser.js.map +1 -0
  161. package/dist/rules/config/index.d.ts +8 -0
  162. package/dist/rules/config/index.d.ts.map +1 -0
  163. package/dist/rules/config/index.js +8 -0
  164. package/dist/rules/config/index.js.map +1 -0
  165. package/dist/rules/config/profiles.d.ts +85 -0
  166. package/dist/rules/config/profiles.d.ts.map +1 -0
  167. package/dist/rules/config/profiles.js +226 -0
  168. package/dist/rules/config/profiles.js.map +1 -0
  169. package/dist/rules/cwe/cwe-119-buffer-overflow.d.ts +9 -0
  170. package/dist/rules/cwe/cwe-119-buffer-overflow.d.ts.map +1 -0
  171. package/dist/rules/cwe/cwe-119-buffer-overflow.js +54 -0
  172. package/dist/rules/cwe/cwe-119-buffer-overflow.js.map +1 -0
  173. package/dist/rules/cwe/cwe-125-oob-read.d.ts +20 -0
  174. package/dist/rules/cwe/cwe-125-oob-read.d.ts.map +1 -0
  175. package/dist/rules/cwe/cwe-125-oob-read.js +247 -0
  176. package/dist/rules/cwe/cwe-125-oob-read.js.map +1 -0
  177. package/dist/rules/cwe/cwe-190-integer-overflow.d.ts +9 -0
  178. package/dist/rules/cwe/cwe-190-integer-overflow.d.ts.map +1 -0
  179. package/dist/rules/cwe/cwe-190-integer-overflow.js +55 -0
  180. package/dist/rules/cwe/cwe-190-integer-overflow.js.map +1 -0
  181. package/dist/rules/cwe/cwe-20-input-validation.d.ts +21 -0
  182. package/dist/rules/cwe/cwe-20-input-validation.d.ts.map +1 -0
  183. package/dist/rules/cwe/cwe-20-input-validation.js +342 -0
  184. package/dist/rules/cwe/cwe-20-input-validation.js.map +1 -0
  185. package/dist/rules/cwe/cwe-22-path-traversal.d.ts +20 -0
  186. package/dist/rules/cwe/cwe-22-path-traversal.d.ts.map +1 -0
  187. package/dist/rules/cwe/cwe-22-path-traversal.js +306 -0
  188. package/dist/rules/cwe/cwe-22-path-traversal.js.map +1 -0
  189. package/dist/rules/cwe/cwe-269-improper-privilege.d.ts +9 -0
  190. package/dist/rules/cwe/cwe-269-improper-privilege.d.ts.map +1 -0
  191. package/dist/rules/cwe/cwe-269-improper-privilege.js +58 -0
  192. package/dist/rules/cwe/cwe-269-improper-privilege.js.map +1 -0
  193. package/dist/rules/cwe/cwe-276-default-permissions.d.ts +9 -0
  194. package/dist/rules/cwe/cwe-276-default-permissions.d.ts.map +1 -0
  195. package/dist/rules/cwe/cwe-276-default-permissions.js +54 -0
  196. package/dist/rules/cwe/cwe-276-default-permissions.js.map +1 -0
  197. package/dist/rules/cwe/cwe-287-improper-auth.d.ts +9 -0
  198. package/dist/rules/cwe/cwe-287-improper-auth.d.ts.map +1 -0
  199. package/dist/rules/cwe/cwe-287-improper-auth.js +57 -0
  200. package/dist/rules/cwe/cwe-287-improper-auth.js.map +1 -0
  201. package/dist/rules/cwe/cwe-306-missing-auth-critical.d.ts +9 -0
  202. package/dist/rules/cwe/cwe-306-missing-auth-critical.d.ts.map +1 -0
  203. package/dist/rules/cwe/cwe-306-missing-auth-critical.js +53 -0
  204. package/dist/rules/cwe/cwe-306-missing-auth-critical.js.map +1 -0
  205. package/dist/rules/cwe/cwe-352-csrf.d.ts +9 -0
  206. package/dist/rules/cwe/cwe-352-csrf.d.ts.map +1 -0
  207. package/dist/rules/cwe/cwe-352-csrf.js +51 -0
  208. package/dist/rules/cwe/cwe-352-csrf.js.map +1 -0
  209. package/dist/rules/cwe/cwe-362-race-condition.d.ts +9 -0
  210. package/dist/rules/cwe/cwe-362-race-condition.d.ts.map +1 -0
  211. package/dist/rules/cwe/cwe-362-race-condition.js +55 -0
  212. package/dist/rules/cwe/cwe-362-race-condition.js.map +1 -0
  213. package/dist/rules/cwe/cwe-416-use-after-free.d.ts +23 -0
  214. package/dist/rules/cwe/cwe-416-use-after-free.d.ts.map +1 -0
  215. package/dist/rules/cwe/cwe-416-use-after-free.js +402 -0
  216. package/dist/rules/cwe/cwe-416-use-after-free.js.map +1 -0
  217. package/dist/rules/cwe/cwe-434-file-upload.d.ts +9 -0
  218. package/dist/rules/cwe/cwe-434-file-upload.d.ts.map +1 -0
  219. package/dist/rules/cwe/cwe-434-file-upload.js +55 -0
  220. package/dist/rules/cwe/cwe-434-file-upload.js.map +1 -0
  221. package/dist/rules/cwe/cwe-476-null-deref.d.ts +9 -0
  222. package/dist/rules/cwe/cwe-476-null-deref.d.ts.map +1 -0
  223. package/dist/rules/cwe/cwe-476-null-deref.js +55 -0
  224. package/dist/rules/cwe/cwe-476-null-deref.js.map +1 -0
  225. package/dist/rules/cwe/cwe-502-deserialization.d.ts +9 -0
  226. package/dist/rules/cwe/cwe-502-deserialization.d.ts.map +1 -0
  227. package/dist/rules/cwe/cwe-502-deserialization.js +57 -0
  228. package/dist/rules/cwe/cwe-502-deserialization.js.map +1 -0
  229. package/dist/rules/cwe/cwe-77-command-injection.d.ts +9 -0
  230. package/dist/rules/cwe/cwe-77-command-injection.d.ts.map +1 -0
  231. package/dist/rules/cwe/cwe-77-command-injection.js +55 -0
  232. package/dist/rules/cwe/cwe-77-command-injection.js.map +1 -0
  233. package/dist/rules/cwe/cwe-78-command-injection.d.ts +20 -0
  234. package/dist/rules/cwe/cwe-78-command-injection.d.ts.map +1 -0
  235. package/dist/rules/cwe/cwe-78-command-injection.js +259 -0
  236. package/dist/rules/cwe/cwe-78-command-injection.js.map +1 -0
  237. package/dist/rules/cwe/cwe-787-oob-write.d.ts +21 -0
  238. package/dist/rules/cwe/cwe-787-oob-write.d.ts.map +1 -0
  239. package/dist/rules/cwe/cwe-787-oob-write.js +321 -0
  240. package/dist/rules/cwe/cwe-787-oob-write.js.map +1 -0
  241. package/dist/rules/cwe/cwe-79-xss.d.ts +22 -0
  242. package/dist/rules/cwe/cwe-79-xss.d.ts.map +1 -0
  243. package/dist/rules/cwe/cwe-79-xss.js +386 -0
  244. package/dist/rules/cwe/cwe-79-xss.js.map +1 -0
  245. package/dist/rules/cwe/cwe-798-hardcoded-credentials.d.ts +9 -0
  246. package/dist/rules/cwe/cwe-798-hardcoded-credentials.d.ts.map +1 -0
  247. package/dist/rules/cwe/cwe-798-hardcoded-credentials.js +58 -0
  248. package/dist/rules/cwe/cwe-798-hardcoded-credentials.js.map +1 -0
  249. package/dist/rules/cwe/cwe-862-missing-auth.d.ts +9 -0
  250. package/dist/rules/cwe/cwe-862-missing-auth.d.ts.map +1 -0
  251. package/dist/rules/cwe/cwe-862-missing-auth.js +55 -0
  252. package/dist/rules/cwe/cwe-862-missing-auth.js.map +1 -0
  253. package/dist/rules/cwe/cwe-863-incorrect-auth.d.ts +9 -0
  254. package/dist/rules/cwe/cwe-863-incorrect-auth.d.ts.map +1 -0
  255. package/dist/rules/cwe/cwe-863-incorrect-auth.js +58 -0
  256. package/dist/rules/cwe/cwe-863-incorrect-auth.js.map +1 -0
  257. package/dist/rules/cwe/cwe-89-sql-injection.d.ts +21 -0
  258. package/dist/rules/cwe/cwe-89-sql-injection.d.ts.map +1 -0
  259. package/dist/rules/cwe/cwe-89-sql-injection.js +456 -0
  260. package/dist/rules/cwe/cwe-89-sql-injection.js.map +1 -0
  261. package/dist/rules/cwe/cwe-918-ssrf.d.ts +9 -0
  262. package/dist/rules/cwe/cwe-918-ssrf.d.ts.map +1 -0
  263. package/dist/rules/cwe/cwe-918-ssrf.js +59 -0
  264. package/dist/rules/cwe/cwe-918-ssrf.js.map +1 -0
  265. package/dist/rules/cwe/cwe-94-code-injection.d.ts +9 -0
  266. package/dist/rules/cwe/cwe-94-code-injection.d.ts.map +1 -0
  267. package/dist/rules/cwe/cwe-94-code-injection.js +59 -0
  268. package/dist/rules/cwe/cwe-94-code-injection.js.map +1 -0
  269. package/dist/rules/cwe/index.d.ts +43 -0
  270. package/dist/rules/cwe/index.d.ts.map +1 -0
  271. package/dist/rules/cwe/index.js +99 -0
  272. package/dist/rules/cwe/index.js.map +1 -0
  273. package/dist/rules/engine/index.d.ts +10 -0
  274. package/dist/rules/engine/index.d.ts.map +1 -0
  275. package/dist/rules/engine/index.js +9 -0
  276. package/dist/rules/engine/index.js.map +1 -0
  277. package/dist/rules/engine/rule-context.d.ts +99 -0
  278. package/dist/rules/engine/rule-context.d.ts.map +1 -0
  279. package/dist/rules/engine/rule-context.js +175 -0
  280. package/dist/rules/engine/rule-context.js.map +1 -0
  281. package/dist/rules/engine/rule-engine.d.ts +132 -0
  282. package/dist/rules/engine/rule-engine.d.ts.map +1 -0
  283. package/dist/rules/engine/rule-engine.js +379 -0
  284. package/dist/rules/engine/rule-engine.js.map +1 -0
  285. package/dist/rules/engine/rule-registry.d.ts +133 -0
  286. package/dist/rules/engine/rule-registry.d.ts.map +1 -0
  287. package/dist/rules/engine/rule-registry.js +281 -0
  288. package/dist/rules/engine/rule-registry.js.map +1 -0
  289. package/dist/rules/index.d.ts +14 -0
  290. package/dist/rules/index.d.ts.map +1 -0
  291. package/dist/rules/index.js +16 -0
  292. package/dist/rules/index.js.map +1 -0
  293. package/dist/rules/owasp/a01-broken-access-control.d.ts +19 -0
  294. package/dist/rules/owasp/a01-broken-access-control.d.ts.map +1 -0
  295. package/dist/rules/owasp/a01-broken-access-control.js +295 -0
  296. package/dist/rules/owasp/a01-broken-access-control.js.map +1 -0
  297. package/dist/rules/owasp/a02-cryptographic-failures.d.ts +19 -0
  298. package/dist/rules/owasp/a02-cryptographic-failures.d.ts.map +1 -0
  299. package/dist/rules/owasp/a02-cryptographic-failures.js +327 -0
  300. package/dist/rules/owasp/a02-cryptographic-failures.js.map +1 -0
  301. package/dist/rules/owasp/a03-injection.d.ts +21 -0
  302. package/dist/rules/owasp/a03-injection.d.ts.map +1 -0
  303. package/dist/rules/owasp/a03-injection.js +342 -0
  304. package/dist/rules/owasp/a03-injection.js.map +1 -0
  305. package/dist/rules/owasp/a04-insecure-design.d.ts +19 -0
  306. package/dist/rules/owasp/a04-insecure-design.d.ts.map +1 -0
  307. package/dist/rules/owasp/a04-insecure-design.js +403 -0
  308. package/dist/rules/owasp/a04-insecure-design.js.map +1 -0
  309. package/dist/rules/owasp/a05-security-misconfiguration.d.ts +19 -0
  310. package/dist/rules/owasp/a05-security-misconfiguration.d.ts.map +1 -0
  311. package/dist/rules/owasp/a05-security-misconfiguration.js +371 -0
  312. package/dist/rules/owasp/a05-security-misconfiguration.js.map +1 -0
  313. package/dist/rules/owasp/a06-vulnerable-components.d.ts +18 -0
  314. package/dist/rules/owasp/a06-vulnerable-components.d.ts.map +1 -0
  315. package/dist/rules/owasp/a06-vulnerable-components.js +243 -0
  316. package/dist/rules/owasp/a06-vulnerable-components.js.map +1 -0
  317. package/dist/rules/owasp/a07-auth-failures.d.ts +19 -0
  318. package/dist/rules/owasp/a07-auth-failures.d.ts.map +1 -0
  319. package/dist/rules/owasp/a07-auth-failures.js +300 -0
  320. package/dist/rules/owasp/a07-auth-failures.js.map +1 -0
  321. package/dist/rules/owasp/a08-integrity-failures.d.ts +18 -0
  322. package/dist/rules/owasp/a08-integrity-failures.d.ts.map +1 -0
  323. package/dist/rules/owasp/a08-integrity-failures.js +306 -0
  324. package/dist/rules/owasp/a08-integrity-failures.js.map +1 -0
  325. package/dist/rules/owasp/a09-logging-failures.d.ts +18 -0
  326. package/dist/rules/owasp/a09-logging-failures.d.ts.map +1 -0
  327. package/dist/rules/owasp/a09-logging-failures.js +339 -0
  328. package/dist/rules/owasp/a09-logging-failures.js.map +1 -0
  329. package/dist/rules/owasp/a10-ssrf.d.ts +18 -0
  330. package/dist/rules/owasp/a10-ssrf.d.ts.map +1 -0
  331. package/dist/rules/owasp/a10-ssrf.js +349 -0
  332. package/dist/rules/owasp/a10-ssrf.js.map +1 -0
  333. package/dist/rules/owasp/index.d.ts +20 -0
  334. package/dist/rules/owasp/index.d.ts.map +1 -0
  335. package/dist/rules/owasp/index.js +53 -0
  336. package/dist/rules/owasp/index.js.map +1 -0
  337. package/dist/rules/types.d.ts +277 -0
  338. package/dist/rules/types.d.ts.map +1 -0
  339. package/dist/rules/types.js +34 -0
  340. package/dist/rules/types.js.map +1 -0
  341. package/dist/tests/integration/epic-integration.test.d.ts +7 -0
  342. package/dist/tests/integration/epic-integration.test.d.ts.map +1 -0
  343. package/dist/tests/integration/epic-integration.test.js +390 -0
  344. package/dist/tests/integration/epic-integration.test.js.map +1 -0
  345. package/dist/tests/rules/cwe/cwe-top25-1-13.test.d.ts +2 -0
  346. package/dist/tests/rules/cwe/cwe-top25-1-13.test.d.ts.map +1 -0
  347. package/dist/tests/rules/cwe/cwe-top25-1-13.test.js +154 -0
  348. package/dist/tests/rules/cwe/cwe-top25-1-13.test.js.map +1 -0
  349. package/dist/tests/rules/cwe/cwe-top25-14-25.test.d.ts +2 -0
  350. package/dist/tests/rules/cwe/cwe-top25-14-25.test.d.ts.map +1 -0
  351. package/dist/tests/rules/cwe/cwe-top25-14-25.test.js +121 -0
  352. package/dist/tests/rules/cwe/cwe-top25-14-25.test.js.map +1 -0
  353. package/dist/types/cve.d.ts +278 -0
  354. package/dist/types/cve.d.ts.map +1 -0
  355. package/dist/types/cve.js +7 -0
  356. package/dist/types/cve.js.map +1 -0
  357. package/dist/types/index.d.ts +2 -0
  358. package/dist/types/index.d.ts.map +1 -1
  359. package/dist/types/rule.d.ts +245 -0
  360. package/dist/types/rule.d.ts.map +1 -0
  361. package/dist/types/rule.js +7 -0
  362. package/dist/types/rule.js.map +1 -0
  363. package/package.json +1 -1
@@ -0,0 +1,342 @@
1
+ /**
2
+ * @fileoverview OWASP A03:2021 - Injection Rule
3
+ * @module @nahisaho/musubix-security/rules/owasp/a03-injection
4
+ * @trace TSK-RULE-003
5
+ *
6
+ * Detects:
7
+ * - SQL Injection
8
+ * - NoSQL Injection
9
+ * - Command Injection
10
+ * - Code Injection (eval)
11
+ * - Template Injection
12
+ *
13
+ * Uses taint analysis when available for improved accuracy.
14
+ */
15
+ /**
16
+ * OWASP A03 - Injection
17
+ */
18
+ export const owaspA03Injection = {
19
+ id: 'owasp-a03-injection',
20
+ name: 'OWASP A03:2021 - Injection',
21
+ description: 'Detects injection vulnerabilities including SQL, NoSQL, command, and code injection',
22
+ defaultSeverity: 'critical',
23
+ detectionMethod: 'combined',
24
+ tags: ['owasp', 'injection', 'sql', 'nosql', 'command', 'security'],
25
+ owasp: ['A03:2021'],
26
+ cwe: ['77', '78', '79', '89', '90', '91', '94', '95', '96', '917'],
27
+ references: [
28
+ { title: 'OWASP A03:2021 - Injection', url: 'https://owasp.org/Top10/A03_2021-Injection/' },
29
+ { title: 'CWE-89: SQL Injection', url: 'https://cwe.mitre.org/data/definitions/89.html' },
30
+ ],
31
+ async analyze(context) {
32
+ const findings = [];
33
+ const sourceFile = context.sourceFile;
34
+ if (!sourceFile)
35
+ return findings;
36
+ // Use taint analysis if available
37
+ if (context.taintResults && context.taintResults.flows.length > 0) {
38
+ analyzeTaintFlows(context, findings);
39
+ }
40
+ // Pattern-based detection
41
+ checkSQLInjection(context, findings);
42
+ checkNoSQLInjection(context, findings);
43
+ checkCommandInjection(context, findings);
44
+ checkCodeInjection(context, findings);
45
+ checkTemplateInjection(context, findings);
46
+ return findings;
47
+ },
48
+ };
49
+ /**
50
+ * Check for SQL injection vulnerabilities
51
+ */
52
+ function checkSQLInjection(context, findings) {
53
+ const sourceCode = context.sourceCode;
54
+ const lines = sourceCode.split('\n');
55
+ const sqlPatterns = [
56
+ // String concatenation in SQL
57
+ { pattern: /['"`]SELECT\s+.*\+\s*(?:req\.|params\.|query\.|body\.)/gi, type: 'SQL query with string concatenation' },
58
+ { pattern: /['"`]INSERT\s+INTO\s+.*\+\s*(?:req\.|params\.|query\.|body\.)/gi, type: 'SQL insert with string concatenation' },
59
+ { pattern: /['"`]UPDATE\s+.*SET\s+.*\+\s*(?:req\.|params\.|query\.|body\.)/gi, type: 'SQL update with string concatenation' },
60
+ { pattern: /['"`]DELETE\s+FROM\s+.*\+\s*(?:req\.|params\.|query\.|body\.)/gi, type: 'SQL delete with string concatenation' },
61
+ // Template literals in SQL
62
+ { pattern: /`SELECT\s+[^`]*\$\{[^}]*(?:req\.|params\.|query\.|body\.)/gi, type: 'SQL with template literal injection' },
63
+ // Raw query with user input
64
+ { pattern: /(?:query|execute|raw)\s*\(\s*['"`][^'"`]*\+/gi, type: 'Raw query with concatenation' },
65
+ ];
66
+ for (let lineNum = 0; lineNum < lines.length; lineNum++) {
67
+ const line = lines[lineNum];
68
+ for (const { pattern, type } of sqlPatterns) {
69
+ pattern.lastIndex = 0;
70
+ if (pattern.test(line)) {
71
+ findings.push({
72
+ id: `owasp-a03-sql-${findings.length + 1}`,
73
+ ruleId: 'owasp-a03-injection',
74
+ severity: 'critical',
75
+ message: `Potential SQL Injection: ${type}`,
76
+ location: {
77
+ file: context.filePath,
78
+ startLine: lineNum + 1,
79
+ endLine: lineNum + 1,
80
+ startColumn: 0,
81
+ endColumn: line.length,
82
+ },
83
+ cwe: ['89'],
84
+ suggestion: {
85
+ description: 'Use parameterized queries',
86
+ example: `// Use parameterized query:
87
+ // PostgreSQL/MySQL: db.query('SELECT * FROM users WHERE id = $1', [userId])
88
+ // ORM: Model.findOne({ where: { id: userId } })`,
89
+ },
90
+ });
91
+ break;
92
+ }
93
+ }
94
+ }
95
+ }
96
+ /**
97
+ * Check for NoSQL injection vulnerabilities
98
+ */
99
+ function checkNoSQLInjection(context, findings) {
100
+ const sourceCode = context.sourceCode;
101
+ const lines = sourceCode.split('\n');
102
+ const nosqlPatterns = [
103
+ // Direct user input in MongoDB queries
104
+ { pattern: /\.\s*find\s*\(\s*\{\s*[^}]*:\s*(?:req\.body|req\.query|req\.params)/gi, type: 'MongoDB find with user input' },
105
+ { pattern: /\.\s*findOne\s*\(\s*\{\s*[^}]*:\s*(?:req\.body|req\.query|req\.params)/gi, type: 'MongoDB findOne with user input' },
106
+ { pattern: /\.\s*updateOne\s*\(\s*\{\s*[^}]*:\s*(?:req\.body|req\.query|req\.params)/gi, type: 'MongoDB updateOne with user input' },
107
+ // $where with user input
108
+ { pattern: /\$where\s*:\s*(?:req\.|params\.|query\.|body\.)/gi, type: 'MongoDB $where with user input' },
109
+ // JSON.parse of user input in query
110
+ { pattern: /JSON\.parse\s*\([^)]*(?:req\.body|req\.query)/gi, type: 'JSON.parse with user input' },
111
+ ];
112
+ for (let lineNum = 0; lineNum < lines.length; lineNum++) {
113
+ const line = lines[lineNum];
114
+ for (const { pattern, type } of nosqlPatterns) {
115
+ pattern.lastIndex = 0;
116
+ if (pattern.test(line)) {
117
+ // Check for sanitization
118
+ const surroundingCode = lines.slice(Math.max(0, lineNum - 3), lineNum + 1).join('\n');
119
+ if (!hasSanitization(surroundingCode)) {
120
+ findings.push({
121
+ id: `owasp-a03-nosql-${findings.length + 1}`,
122
+ ruleId: 'owasp-a03-injection',
123
+ severity: 'high',
124
+ message: `Potential NoSQL Injection: ${type}`,
125
+ location: {
126
+ file: context.filePath,
127
+ startLine: lineNum + 1,
128
+ endLine: lineNum + 1,
129
+ startColumn: 0,
130
+ endColumn: line.length,
131
+ },
132
+ cwe: ['943'],
133
+ suggestion: {
134
+ description: 'Sanitize user input before use in queries',
135
+ example: `// Sanitize input before use:
136
+ const sanitizedInput = mongo.sanitize(userInput);
137
+ // Or use explicit type casting:
138
+ const id = new ObjectId(userId);`,
139
+ },
140
+ });
141
+ }
142
+ break;
143
+ }
144
+ }
145
+ }
146
+ }
147
+ /**
148
+ * Check for command injection vulnerabilities
149
+ */
150
+ function checkCommandInjection(context, findings) {
151
+ const sourceCode = context.sourceCode;
152
+ const lines = sourceCode.split('\n');
153
+ const commandPatterns = [
154
+ // exec with user input (string concatenation)
155
+ { pattern: /exec\s*\(\s*['"`][^'"`]*['"`]\s*\+\s*(?:req\.|params\.|query\.|body\.)/gi, type: 'exec with concatenation' },
156
+ { pattern: /exec\s*\([^)]*\+\s*req\./gi, type: 'exec with request input' },
157
+ // exec with template literal
158
+ { pattern: /exec\s*\(\s*`[^`]*\$\{[^}]*(?:req\.|params\.|query\.|body\.)/gi, type: 'exec with template literal' },
159
+ { pattern: /exec\s*\(\s*`[^`]*\$\{/gi, type: 'exec with template literal variable' },
160
+ // execSync with user input
161
+ { pattern: /execSync\s*\(\s*['"`][^'"`]*['"`]\s*\+\s*(?:req\.|params\.|query\.|body\.)/gi, type: 'execSync with concatenation' },
162
+ { pattern: /execSync\s*\([^)]*\+\s*req\./gi, type: 'execSync with request input' },
163
+ // spawn with shell
164
+ { pattern: /spawn\s*\([^)]*shell\s*:\s*true/gi, type: 'spawn with shell option' },
165
+ // child_process with user input
166
+ { pattern: /child_process\s*\.\s*exec\s*\([^)]*(?:req\.|params\.|query\.|body\.)/gi, type: 'child_process.exec with user input' },
167
+ ];
168
+ for (let lineNum = 0; lineNum < lines.length; lineNum++) {
169
+ const line = lines[lineNum];
170
+ for (const { pattern, type } of commandPatterns) {
171
+ pattern.lastIndex = 0;
172
+ if (pattern.test(line)) {
173
+ findings.push({
174
+ id: `owasp-a03-cmd-${findings.length + 1}`,
175
+ ruleId: 'owasp-a03-injection',
176
+ severity: 'critical',
177
+ message: `Potential Command Injection: ${type}`,
178
+ location: {
179
+ file: context.filePath,
180
+ startLine: lineNum + 1,
181
+ endLine: lineNum + 1,
182
+ startColumn: 0,
183
+ endColumn: line.length,
184
+ },
185
+ cwe: ['78'],
186
+ suggestion: {
187
+ description: 'Use execFile or spawn with argument array',
188
+ example: `// Use execFile with argument array (safer):
189
+ execFile('command', [arg1, arg2], callback);
190
+ // Or use spawn without shell:
191
+ spawn('command', ['arg1', 'arg2']);`,
192
+ },
193
+ });
194
+ break;
195
+ }
196
+ }
197
+ }
198
+ }
199
+ /**
200
+ * Check for code injection vulnerabilities (eval, Function constructor)
201
+ */
202
+ function checkCodeInjection(context, findings) {
203
+ const sourceCode = context.sourceCode;
204
+ const lines = sourceCode.split('\n');
205
+ const codeInjectionPatterns = [
206
+ // eval with any variable
207
+ { pattern: /\beval\s*\(\s*[a-zA-Z_$]/gi, type: 'eval with variable' },
208
+ // Function constructor
209
+ { pattern: /new\s+Function\s*\(/gi, type: 'Function constructor' },
210
+ // setTimeout/setInterval with string
211
+ { pattern: /set(?:Timeout|Interval)\s*\(\s*['"`][^'"`]+['"`]/gi, type: 'setTimeout/setInterval with string' },
212
+ // vm.runInContext with user input
213
+ { pattern: /vm\.runIn(?:Context|NewContext|ThisContext)\s*\([^)]*(?:req\.|params\.|query\.|body\.)/gi, type: 'VM execution with user input' },
214
+ ];
215
+ for (let lineNum = 0; lineNum < lines.length; lineNum++) {
216
+ const line = lines[lineNum];
217
+ for (const { pattern, type } of codeInjectionPatterns) {
218
+ pattern.lastIndex = 0;
219
+ if (pattern.test(line)) {
220
+ findings.push({
221
+ id: `owasp-a03-code-${findings.length + 1}`,
222
+ ruleId: 'owasp-a03-injection',
223
+ severity: 'critical',
224
+ message: `Potential Code Injection: ${type}`,
225
+ location: {
226
+ file: context.filePath,
227
+ startLine: lineNum + 1,
228
+ endLine: lineNum + 1,
229
+ startColumn: 0,
230
+ endColumn: line.length,
231
+ },
232
+ cwe: ['94', '95'],
233
+ suggestion: {
234
+ description: 'Avoid eval and Function constructor',
235
+ example: `// Avoid eval and Function constructor
236
+ // Use JSON.parse for JSON data:
237
+ const data = JSON.parse(jsonString);
238
+ // Use a sandboxed VM for untrusted code execution`,
239
+ },
240
+ });
241
+ break;
242
+ }
243
+ }
244
+ }
245
+ }
246
+ /**
247
+ * Check for template injection vulnerabilities
248
+ */
249
+ function checkTemplateInjection(context, findings) {
250
+ const sourceCode = context.sourceCode;
251
+ const lines = sourceCode.split('\n');
252
+ const templatePatterns = [
253
+ // EJS with unescaped output
254
+ { pattern: /<%[-=]\s*[^%]*(?:req\.|params\.|query\.|body\.)/gi, type: 'EJS template with unescaped user input' },
255
+ // Pug/Jade with unescaped
256
+ { pattern: /!{[^}]*(?:req\.|params\.|query\.|body\.)/gi, type: 'Pug template with unescaped user input' },
257
+ // Handlebars triple braces
258
+ { pattern: /\{\{\{[^}]*(?:req\.|params\.|query\.|body\.)/gi, type: 'Handlebars with unescaped user input' },
259
+ // innerHTML assignment
260
+ { pattern: /\.innerHTML\s*=\s*(?:req\.|params\.|query\.|body\.)/gi, type: 'innerHTML with user input' },
261
+ // document.write
262
+ { pattern: /document\.write\s*\([^)]*(?:req\.|params\.|query\.|body\.)/gi, type: 'document.write with user input' },
263
+ ];
264
+ for (let lineNum = 0; lineNum < lines.length; lineNum++) {
265
+ const line = lines[lineNum];
266
+ for (const { pattern, type } of templatePatterns) {
267
+ pattern.lastIndex = 0;
268
+ if (pattern.test(line)) {
269
+ findings.push({
270
+ id: `owasp-a03-template-${findings.length + 1}`,
271
+ ruleId: 'owasp-a03-injection',
272
+ severity: 'high',
273
+ message: `Potential Template/XSS Injection: ${type}`,
274
+ location: {
275
+ file: context.filePath,
276
+ startLine: lineNum + 1,
277
+ endLine: lineNum + 1,
278
+ startColumn: 0,
279
+ endColumn: line.length,
280
+ },
281
+ cwe: ['79', '917'],
282
+ suggestion: {
283
+ description: 'Use auto-escaping templates and avoid innerHTML',
284
+ example: `// Use auto-escaping templates
285
+ // EJS: use <%= instead of <%-
286
+ // Use textContent instead of innerHTML
287
+ // Apply DOMPurify for HTML content`,
288
+ },
289
+ });
290
+ break;
291
+ }
292
+ }
293
+ }
294
+ }
295
+ /**
296
+ * Analyze taint flows for injection vulnerabilities
297
+ */
298
+ function analyzeTaintFlows(context, findings) {
299
+ if (!context.taintResults)
300
+ return;
301
+ const injectionSinks = ['sql', 'exec', 'eval', 'query', 'command', 'shell'];
302
+ for (const flow of context.taintResults.flows) {
303
+ const sinkCategory = flow.sink.category?.toLowerCase() || '';
304
+ if (injectionSinks.some(sink => sinkCategory.includes(sink))) {
305
+ findings.push({
306
+ id: `owasp-a03-taint-${findings.length + 1}`,
307
+ ruleId: 'owasp-a03-injection',
308
+ severity: 'critical',
309
+ message: `Taint flow detected: user input flows to ${flow.sink.category} sink without sanitization`,
310
+ location: {
311
+ file: context.filePath,
312
+ startLine: flow.sink.location?.startLine ?? 1,
313
+ endLine: flow.sink.location?.endLine ?? 1,
314
+ startColumn: flow.sink.location?.startColumn ?? 0,
315
+ endColumn: flow.sink.location?.endColumn ?? 10,
316
+ },
317
+ suggestion: {
318
+ description: 'Add input validation and sanitization at the source',
319
+ example: '// Add input validation and sanitization at the source',
320
+ },
321
+ });
322
+ }
323
+ }
324
+ }
325
+ /**
326
+ * Check if code contains input sanitization
327
+ */
328
+ function hasSanitization(code) {
329
+ const sanitizationPatterns = [
330
+ /sanitize/i,
331
+ /escape/i,
332
+ /validate/i,
333
+ /parameterized/i,
334
+ /prepared/i,
335
+ /placeholder/i,
336
+ /bindParam/i,
337
+ /ObjectId/i,
338
+ ];
339
+ return sanitizationPatterns.some(p => p.test(code));
340
+ }
341
+ export default owaspA03Injection;
342
+ //# sourceMappingURL=a03-injection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"a03-injection.js","sourceRoot":"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RULE-003
5
+ *
6
+ * Detects:
7
+ * - Missing rate limiting
8
+ * - Missing input validation
9
+ * - Missing output encoding
10
+ * - Insecure defaults
11
+ * - Business logic flaws
12
+ */
13
+ import type { SecurityRule } from '../types.js';
14
+ /**
15
+ * OWASP A04 - Insecure Design
16
+ */
17
+ export declare const owaspA04InsecureDesign: SecurityRule;
18
+ export default owaspA04InsecureDesign;
19
+ //# sourceMappingURL=a04-insecure-design.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"a04-insecure-design.d.ts","sourceRoot":"","sources":["../../../src/rules/owasp/a04-insecure-design.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,YAAY,EAA4B,MAAM,aAAa,CAAC;AAE1E;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,YAuCpC,CAAC;AAwYF,eAAe,sBAAsB,CAAC"}