0sec-cli 0.18.0 → 0.22.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 (329) hide show
  1. package/{0sec.js → 0.js} +90 -82
  2. package/LICENSE +1 -1
  3. package/README.md +62 -46
  4. package/chunks/adapt-loop-7I57LXXR.js +18 -0
  5. package/chunks/{adgraph-JLGA6RYI.js → adgraph-AUDQTBYA.js} +5 -5
  6. package/chunks/agent/skills/frameworks/entra-id.yaml +2 -2
  7. package/chunks/agent/skills/techniques/assumption-mining.yaml +2 -2
  8. package/chunks/agent/skills/techniques/cve-poc-adaptation.yaml +2 -2
  9. package/chunks/agent/skills/techniques/entra-attack-paths.yaml +1 -1
  10. package/chunks/agent/skills/techniques/kernel-weaponization.yaml +1 -1
  11. package/chunks/agent/skills/techniques/llm-prompt-injection.yaml +2 -2
  12. package/chunks/agent/skills/techniques/npm-ecosystem.yaml +1 -1
  13. package/chunks/agent/skills/techniques/poc-verification.yaml +1 -1
  14. package/chunks/agent/skills/techniques/seedless-depth-review.yaml +20 -38
  15. package/chunks/{artifact-scraper-HQ7HLP6V.js → artifact-scraper-PYZ3RU3O.js} +6 -6
  16. package/chunks/{assumption-mining-5SNIVVDN.js → assumption-mining-MFLF43IR.js} +24 -26
  17. package/chunks/{chunk-7DQEV5QI.js → chunk-23DG5YKS.js} +4 -4
  18. package/chunks/{chunk-UR4ELX2Y.js → chunk-2GV4HQKE.js} +340 -703
  19. package/chunks/{chunk-P6WKNFWX.js → chunk-2OQOQ2FZ.js} +8 -8
  20. package/chunks/{chunk-5G3ZXFBW.js → chunk-2WNCI664.js} +3 -3
  21. package/chunks/{chunk-DW5UWPFY.js → chunk-4VGLO2YS.js} +6 -5
  22. package/chunks/{chunk-KLTNTE2Z.js → chunk-5IBCBQEH.js} +13 -14
  23. package/chunks/{chunk-N7BOUYEV.js → chunk-5MWAG3FT.js} +14 -14
  24. package/chunks/{chunk-OEFNRYI2.js → chunk-6GHSR47F.js} +3 -6
  25. package/chunks/chunk-6YNKRUMC.js +4474 -0
  26. package/chunks/{chunk-6L26OBWI.js → chunk-76KSBWOQ.js} +255 -35
  27. package/chunks/chunk-7DEHG7YT.js +2143 -0
  28. package/chunks/{chunk-AD7WXDH6.js → chunk-7UFUALR2.js} +288 -22
  29. package/chunks/{chunk-53G27VPS.js → chunk-AZ7L3HFD.js} +7 -2
  30. package/chunks/{chunk-TSK2AG6J.js → chunk-CAYANSH6.js} +173 -1757
  31. package/chunks/{chunk-SAFFWQW4.js → chunk-DKSCN2AB.js} +7 -7
  32. package/chunks/{chunk-2JCCA2JL.js → chunk-DM5C5L5D.js} +3 -3
  33. package/chunks/{chunk-RWONANDA.js → chunk-DQTNI3KY.js} +5 -5
  34. package/chunks/{chunk-5JI7L7KV.js → chunk-EGZGZFAH.js} +10036 -12938
  35. package/chunks/{chunk-6LKRLK2R.js → chunk-FHC2B7LN.js} +3 -3
  36. package/chunks/{chunk-MYVT64FN.js → chunk-GHWODZMR.js} +2 -2
  37. package/chunks/{chunk-2RMLOJVB.js → chunk-GVD6SJGH.js} +2 -2
  38. package/chunks/{chunk-SF4KZ4O3.js → chunk-HLFS6WV2.js} +2 -2
  39. package/chunks/chunk-HR2TU42B.js +1228 -0
  40. package/chunks/{chunk-BFRB6HB2.js → chunk-HUNAPTKV.js} +3 -3
  41. package/chunks/chunk-IO7R7WBM.js +114 -0
  42. package/chunks/{chunk-WEBMRWEG.js → chunk-IXT64DV5.js} +656 -1868
  43. package/chunks/{chunk-3MOLBTLS.js → chunk-K2PWUPUI.js} +2 -2
  44. package/chunks/{chunk-WXQ6BJ6A.js → chunk-LCRTAQN2.js} +7 -7
  45. package/chunks/{chunk-SVJEDVYK.js → chunk-LPTRPRZR.js} +5 -5
  46. package/chunks/{chunk-CMKXP5RR.js → chunk-LYUAM3TG.js} +3 -3
  47. package/chunks/{chunk-BVAZO4WA.js → chunk-MICHDTBK.js} +3 -3
  48. package/chunks/{chunk-UCYRA73C.js → chunk-OAYUPGF6.js} +4 -4
  49. package/chunks/{chunk-XM5NLHYU.js → chunk-OWLJYJ5O.js} +14 -14
  50. package/chunks/{chunk-BKZFDZ23.js → chunk-QCUFBVIZ.js} +3 -3
  51. package/chunks/chunk-RE5EZDG2.js +5523 -0
  52. package/chunks/{chunk-ASUR522M.js → chunk-RRD4XXPU.js} +9 -9
  53. package/chunks/{chunk-AHTBZC3E.js → chunk-RSIUX3RW.js} +4 -4
  54. package/chunks/{chunk-BZNEY2ZS.js → chunk-SJBCK2EI.js} +15268 -16053
  55. package/chunks/{chunk-IOL7D5YV.js → chunk-SQCBHFWN.js} +3 -3
  56. package/chunks/chunk-TH2LW437.js +7829 -0
  57. package/chunks/{chunk-WVTBZEQO.js → chunk-TM74SSHC.js} +8 -8
  58. package/chunks/{chunk-U5FLXGHT.js → chunk-TO35Y326.js} +13 -729
  59. package/chunks/chunk-TRH2PJSN.js +547 -0
  60. package/chunks/{chunk-YYRBQVFE.js → chunk-TZFIAMWZ.js} +70 -16
  61. package/chunks/chunk-UELXHK2Y.js +1950 -0
  62. package/chunks/{chunk-RJWOYEOG.js → chunk-UEX7PFSE.js} +5 -5
  63. package/chunks/{chunk-VQG4FT5D.js → chunk-UFHN6RIU.js} +2 -2
  64. package/chunks/{chunk-JQHOLLTD.js → chunk-UU7PQP6N.js} +9 -9
  65. package/chunks/{chunk-BFR2CDV5.js → chunk-UV5QWZGE.js} +283 -153
  66. package/chunks/{chunk-WU6AFRAZ.js → chunk-V36HVTUL.js} +12 -12
  67. package/chunks/{chunk-IR537GON.js → chunk-VCSFCHAJ.js} +2 -2
  68. package/chunks/{chunk-YLMN3N25.js → chunk-VIT5ALXF.js} +3 -3
  69. package/chunks/{chunk-BATRQBOR.js → chunk-VMRRNRMR.js} +41 -41
  70. package/chunks/{chunk-72CISA2D.js → chunk-VNRY6AWF.js} +89 -41
  71. package/chunks/chunk-W6UWZFKL.js +298 -0
  72. package/chunks/{chunk-3KPWWJCI.js → chunk-XFCTUKXR.js} +88 -88
  73. package/chunks/{chunk-GMT2AZKM.js → chunk-YIQSGNAA.js} +897 -130
  74. package/chunks/codex-models-7TLJSY3L.js +17 -0
  75. package/chunks/{commands-TBC2F5CE.js → commands-NEI7L3QA.js} +2836 -1424
  76. package/chunks/corpus-v1.json +2 -2
  77. package/chunks/data/appsec-archetypes.json +2 -2
  78. package/chunks/data/chromium-archetypes.json +1 -1
  79. package/chunks/data/freebsd-archetypes.json +1 -1
  80. package/chunks/data/kernel-archetypes.json +2 -2
  81. package/chunks/db-5AP3JB4W.js +16 -0
  82. package/chunks/{disclose-EKTWSCGW.js → disclose-LDNKAVRH.js} +13 -11
  83. package/chunks/{dist-4YICS2J2.js → dist-3FNZIBB4.js} +394 -404
  84. package/chunks/{dist-4MAW5X6L.js → dist-5YHYNLI3.js} +6 -6
  85. package/chunks/{dist-FMGSR3DW.js → dist-DD4H6HMQ.js} +13 -5
  86. package/chunks/dist-KEULE5IQ.js +21914 -0
  87. package/chunks/dist-XZB53PS5.js +53 -0
  88. package/chunks/eval-runner-43BO2C4T.js +26 -0
  89. package/chunks/example-manifest.json +2 -2
  90. package/chunks/{exploit-agent-45YQOHPJ.js → exploit-agent-N4A5ELBK.js} +4 -4
  91. package/chunks/{exploit-autoclimb-UZGEMGYT.js → exploit-autoclimb-N7P6KIF5.js} +6 -6
  92. package/chunks/{exploit-climb-SG23KB2G.js → exploit-climb-WNEJUB5W.js} +12 -12
  93. package/chunks/fix-Z452M4EC.js +26 -0
  94. package/chunks/{github-issues-MJ6OYOOU.js → github-issues-IGTTWM7V.js} +7 -7
  95. package/chunks/harness-QJJJVSG4.js +22 -0
  96. package/chunks/http-conformance-U5F6GKYG.js +11 -0
  97. package/chunks/http-sender-I5XFFY35.js +10 -0
  98. package/chunks/hunt-scan-K6D2V3PX.js +36 -0
  99. package/chunks/{identity-6ZAIIWOR.js → identity-62SVRW4H.js} +5 -5
  100. package/chunks/{kernel-primitive-7U6CWHXD.js → kernel-primitive-TKUACPKD.js} +6 -6
  101. package/chunks/{kernel-vm-runner-3JAU4O6J.js → kernel-vm-runner-RAAO2PGT.js} +6 -6
  102. package/chunks/memsafety-scan-FCPAXIZE.js +16 -0
  103. package/chunks/{native-loop-RJCJPOUS.js → native-loop-2ZRJENZ3.js} +17 -18
  104. package/chunks/{npm-detectors-KB5Y5ZFX.js → npm-detectors-Z2ZIQCN4.js} +6 -6
  105. package/chunks/npm-dynamic-discovery-5J7FT3XM.js +13 -0
  106. package/chunks/orchestrate-2GWGNTBF.js +58 -0
  107. package/chunks/{pre-recon-cve-66EB6G4M.js → pre-recon-cve-X2K2P5YQ.js} +4 -4
  108. package/chunks/prepare-KYHGFWCJ.js +13 -0
  109. package/chunks/process-N245QIQG.js +12 -0
  110. package/chunks/{run-D56MPDKY.js → run-U3XU4CTC.js} +11507 -13632
  111. package/chunks/{runtime-G7YWIO3B.js → runtime-G75TEWQY.js} +10 -11
  112. package/chunks/runtime-XFWJTBUO.js +12 -0
  113. package/chunks/{scan-stream-FHI2FYZE.js → scan-stream-BMOCPKQX.js} +7 -7
  114. package/chunks/scope-WXI46UHJ.js +21 -0
  115. package/chunks/{session-store-GZ4A4KYT.js → session-store-27L3ZU73.js} +6 -6
  116. package/chunks/source-files-REHOM44I.js +12 -0
  117. package/chunks/{specdrift-WCLH6TTQ.js → specdrift-AFS54WEJ.js} +5 -5
  118. package/chunks/token-KRWP5JYA.js +72 -0
  119. package/chunks/token-util-DWTL33S3.js +8 -0
  120. package/chunks/variant-candidates-YWZORZMK.js +13 -0
  121. package/chunks/{web-recon-prepass-JJGPEOLE.js → web-recon-prepass-YVMFXCIK.js} +9 -9
  122. package/cli-path-traversal-fixture.js +352 -0
  123. package/dashboard/assets/bot-Bg1Tp9_d.js +1 -0
  124. package/dashboard/assets/dist-B_dDCPbu.js +1 -0
  125. package/dashboard/assets/findings-page-mayGhNx6.js +5 -0
  126. package/dashboard/assets/format--susmHX7.js +1 -0
  127. package/dashboard/assets/input-TuVPR3Zl.js +1 -0
  128. package/dashboard/assets/jsx-runtime-MGseXjj5.js +3 -0
  129. package/dashboard/assets/live-page-HWWHX99U.js +1 -0
  130. package/dashboard/assets/meta-tile-ckHo-w7k.js +1 -0
  131. package/dashboard/assets/operations-BxZ0OoXO.js +10 -0
  132. package/dashboard/assets/operations-CMFVrXEe.css +2 -0
  133. package/dashboard/assets/operations-app-D3d35rgo.js +46 -0
  134. package/dashboard/assets/overview-page-W_4IteEr.js +1 -0
  135. package/dashboard/assets/page-header-Bw9AJgBV.js +1 -0
  136. package/dashboard/assets/scans-page-CgzVXHnn.js +1 -0
  137. package/dashboard/assets/siren-KQj8QAnJ.js +1 -0
  138. package/dashboard/assets/table-8EDklulN.js +1 -0
  139. package/dashboard/assets/tabs-CFHPOwg8.js +1 -0
  140. package/dashboard/index.html +4 -5
  141. package/node_modules/node-addon-api/LICENSE.md +9 -0
  142. package/node_modules/node-addon-api/README.md +95 -0
  143. package/node_modules/node-addon-api/common.gypi +21 -0
  144. package/node_modules/node-addon-api/except.gypi +25 -0
  145. package/node_modules/node-addon-api/index.js +14 -0
  146. package/node_modules/node-addon-api/napi-inl.deprecated.h +186 -0
  147. package/node_modules/node-addon-api/napi-inl.h +7250 -0
  148. package/node_modules/node-addon-api/napi.h +3463 -0
  149. package/node_modules/node-addon-api/node_addon_api.gyp +42 -0
  150. package/node_modules/node-addon-api/node_api.gyp +9 -0
  151. package/node_modules/node-addon-api/noexcept.gypi +26 -0
  152. package/node_modules/node-addon-api/nothing.c +0 -0
  153. package/node_modules/node-addon-api/package-support.json +21 -0
  154. package/node_modules/node-addon-api/package.json +481 -0
  155. package/node_modules/node-addon-api/tools/README.md +73 -0
  156. package/node_modules/node-addon-api/tools/check-napi.js +99 -0
  157. package/node_modules/node-addon-api/tools/clang-format.js +71 -0
  158. package/node_modules/node-addon-api/tools/conversion.js +301 -0
  159. package/node_modules/node-gyp-build/LICENSE +21 -0
  160. package/node_modules/node-gyp-build/README.md +58 -0
  161. package/node_modules/node-gyp-build/SECURITY.md +5 -0
  162. package/node_modules/node-gyp-build/bin.js +84 -0
  163. package/node_modules/node-gyp-build/build-test.js +19 -0
  164. package/node_modules/node-gyp-build/index.js +6 -0
  165. package/node_modules/node-gyp-build/node-gyp-build.js +207 -0
  166. package/node_modules/node-gyp-build/optional.js +7 -0
  167. package/node_modules/node-gyp-build/package.json +43 -0
  168. package/node_modules/tree-sitter/LICENSE +21 -0
  169. package/node_modules/tree-sitter/README.md +90 -0
  170. package/node_modules/tree-sitter/binding.gyp +76 -0
  171. package/node_modules/tree-sitter/index.js +895 -0
  172. package/node_modules/tree-sitter/package.json +62 -0
  173. package/node_modules/tree-sitter/prebuilds/darwin-arm64/tree-sitter.node +0 -0
  174. package/node_modules/tree-sitter/prebuilds/darwin-x64/tree-sitter.node +0 -0
  175. package/node_modules/tree-sitter/prebuilds/linux-x64/tree-sitter.node +0 -0
  176. package/node_modules/tree-sitter/prebuilds/win32-x64/tree-sitter.node +0 -0
  177. package/node_modules/tree-sitter/src/addon_data.h +47 -0
  178. package/node_modules/tree-sitter/src/binding.cc +35 -0
  179. package/node_modules/tree-sitter/src/conversions.cc +140 -0
  180. package/node_modules/tree-sitter/src/conversions.h +22 -0
  181. package/node_modules/tree-sitter/src/language.cc +106 -0
  182. package/node_modules/tree-sitter/src/language.h +17 -0
  183. package/node_modules/tree-sitter/src/logger.cc +70 -0
  184. package/node_modules/tree-sitter/src/logger.h +19 -0
  185. package/node_modules/tree-sitter/src/lookaheaditerator.cc +122 -0
  186. package/node_modules/tree-sitter/src/lookaheaditerator.h +33 -0
  187. package/node_modules/tree-sitter/src/node.cc +1056 -0
  188. package/node_modules/tree-sitter/src/node.h +30 -0
  189. package/node_modules/tree-sitter/src/parser.cc +298 -0
  190. package/node_modules/tree-sitter/src/parser.h +35 -0
  191. package/node_modules/tree-sitter/src/query.cc +383 -0
  192. package/node_modules/tree-sitter/src/query.h +39 -0
  193. package/node_modules/tree-sitter/src/tree.cc +307 -0
  194. package/node_modules/tree-sitter/src/tree.h +45 -0
  195. package/node_modules/tree-sitter/src/tree_cursor.cc +213 -0
  196. package/node_modules/tree-sitter/src/tree_cursor.h +52 -0
  197. package/node_modules/tree-sitter/tree-sitter.d.ts +211 -0
  198. package/node_modules/tree-sitter/vendor/tree-sitter/LICENSE +21 -0
  199. package/node_modules/tree-sitter/vendor/tree-sitter/README.md +21 -0
  200. package/node_modules/tree-sitter/vendor/tree-sitter/lib/README.md +6 -0
  201. package/node_modules/tree-sitter/vendor/tree-sitter/lib/include/tree_sitter/api.h +1266 -0
  202. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/alloc.c +48 -0
  203. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/alloc.h +41 -0
  204. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/array.h +290 -0
  205. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/atomic.h +68 -0
  206. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/clock.h +146 -0
  207. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/error_costs.h +11 -0
  208. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/get_changed_ranges.c +501 -0
  209. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/get_changed_ranges.h +36 -0
  210. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/host.h +21 -0
  211. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/language.c +221 -0
  212. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/language.h +299 -0
  213. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/length.h +52 -0
  214. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lexer.c +419 -0
  215. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lexer.h +49 -0
  216. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lib.c +14 -0
  217. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/node.c +774 -0
  218. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/parser.c +2151 -0
  219. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/parser.h +230 -0
  220. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/point.h +62 -0
  221. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/query.c +4134 -0
  222. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/reduce_action.h +34 -0
  223. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/reusable_node.h +95 -0
  224. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/stack.c +899 -0
  225. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/stack.h +133 -0
  226. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/subtree.c +1060 -0
  227. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/subtree.h +382 -0
  228. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree.c +165 -0
  229. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree.h +31 -0
  230. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree_cursor.c +714 -0
  231. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree_cursor.h +48 -0
  232. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/ICU_SHA +1 -0
  233. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/LICENSE +414 -0
  234. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/README.md +29 -0
  235. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/ptypes.h +1 -0
  236. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/umachine.h +448 -0
  237. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/urename.h +1 -0
  238. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf.h +1 -0
  239. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf16.h +733 -0
  240. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf8.h +881 -0
  241. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode.h +50 -0
  242. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/stdlib-symbols.txt +23 -0
  243. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/stdlib.c +109 -0
  244. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/wasm-stdlib.h +1294 -0
  245. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm_store.c +1823 -0
  246. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm_store.h +31 -0
  247. package/node_modules/tree-sitter/vendor/tree-sitter/test/fixtures/grammars/.gitkeep +0 -0
  248. package/node_modules/tree-sitter-c/LICENSE +21 -0
  249. package/node_modules/tree-sitter-c/README.md +18 -0
  250. package/node_modules/tree-sitter-c/binding.gyp +20 -0
  251. package/node_modules/tree-sitter-c/bindings/node/binding.cc +20 -0
  252. package/node_modules/tree-sitter-c/bindings/node/index.d.ts +28 -0
  253. package/node_modules/tree-sitter-c/bindings/node/index.js +7 -0
  254. package/node_modules/tree-sitter-c/grammar.js +1463 -0
  255. package/node_modules/tree-sitter-c/package.json +108 -0
  256. package/node_modules/tree-sitter-c/prebuilds/darwin-arm64/tree-sitter-c.node +0 -0
  257. package/node_modules/tree-sitter-c/prebuilds/darwin-x64/tree-sitter-c.node +0 -0
  258. package/node_modules/tree-sitter-c/prebuilds/linux-x64/tree-sitter-c.node +0 -0
  259. package/node_modules/tree-sitter-c/prebuilds/win32-x64/tree-sitter-c.node +0 -0
  260. package/node_modules/tree-sitter-c/queries/highlights.scm +81 -0
  261. package/node_modules/tree-sitter-c/queries/tags.scm +9 -0
  262. package/node_modules/tree-sitter-c/src/grammar.json +9682 -0
  263. package/node_modules/tree-sitter-c/src/node-types.json +4556 -0
  264. package/node_modules/tree-sitter-c/src/parser.c +113852 -0
  265. package/node_modules/tree-sitter-c/src/tree_sitter/alloc.h +54 -0
  266. package/node_modules/tree-sitter-c/src/tree_sitter/array.h +290 -0
  267. package/node_modules/tree-sitter-c/src/tree_sitter/parser.h +265 -0
  268. package/package.json +20 -13
  269. package/vendor/tree-sitter-0.21.1-node24.json +16 -0
  270. package/vendor/tree-sitter-0.21.1-node24.tgz +0 -0
  271. package/chunks/adapt-loop-SMH6V4PD.js +0 -18
  272. package/chunks/appsec-catalog-CBWHGTEL.js +0 -24
  273. package/chunks/chunk-242TMK6G.js +0 -110
  274. package/chunks/chunk-57ZENEX2.js +0 -169
  275. package/chunks/chunk-ADOLI6DT.js +0 -102
  276. package/chunks/chunk-ATATQACO.js +0 -471
  277. package/chunks/chunk-C2WXWFBB.js +0 -1070
  278. package/chunks/chunk-F3WBKITT.js +0 -687
  279. package/chunks/chunk-H2FFLZNK.js +0 -3
  280. package/chunks/chunk-LP3HHYQU.js +0 -245
  281. package/chunks/chunk-QI233I24.js +0 -333
  282. package/chunks/chunk-RRMJC3ZE.js +0 -105
  283. package/chunks/chunk-Z5FA2XOX.js +0 -2798
  284. package/chunks/cost-ledger-NU63MYZM.js +0 -13
  285. package/chunks/db-KFWOAUUB.js +0 -16
  286. package/chunks/eval-runner-7ZF472KV.js +0 -27
  287. package/chunks/fix-IG7LYXH3.js +0 -12
  288. package/chunks/harness-7ODOLOWU.js +0 -22
  289. package/chunks/http-conformance-DU66MZIU.js +0 -11
  290. package/chunks/http-sender-GWH2IYEA.js +0 -10
  291. package/chunks/hunt-scan-MMKUOETU.js +0 -38
  292. package/chunks/memsafety-scan-J7SECV5W.js +0 -16
  293. package/chunks/npm-dynamic-discovery-AHROOZDB.js +0 -13
  294. package/chunks/orchestrate-OC2VZN2X.js +0 -62
  295. package/chunks/pipeline-BZK5BLJR.js +0 -14
  296. package/chunks/prepare-MYY743TK.js +0 -13
  297. package/chunks/process-LQRCS5OY.js +0 -13
  298. package/chunks/replay-runner-45G3VU7X.js +0 -39
  299. package/chunks/runtime-J7PLXZNM.js +0 -12
  300. package/chunks/scope-BI7BF4ZY.js +0 -18
  301. package/chunks/source-files-PWRQR6LY.js +0 -12
  302. package/chunks/variant-candidates-YERCYMPD.js +0 -13
  303. package/dashboard/assets/0sec-icon-66SreztZ.gif +0 -0
  304. package/dashboard/assets/bot-yILPnRgD.js +0 -1
  305. package/dashboard/assets/chevron-down-BeDJ-Vka.js +0 -1
  306. package/dashboard/assets/circle-alert-BEnMBMT-.js +0 -1
  307. package/dashboard/assets/client-DRYsuOGl.js +0 -9
  308. package/dashboard/assets/copy-Bi5vzoF9.js +0 -1
  309. package/dashboard/assets/desktop-CXTQonNm.js +0 -32
  310. package/dashboard/assets/desktop-NOekk4QS.css +0 -1
  311. package/dashboard/assets/dist-CmX-h7a4.js +0 -1
  312. package/dashboard/assets/dist-DAwYQmf_.js +0 -45
  313. package/dashboard/assets/findings-page-CACW9nw2.js +0 -5
  314. package/dashboard/assets/format-PoISqsES.js +0 -1
  315. package/dashboard/assets/jsx-runtime-C7oxC63R.js +0 -1
  316. package/dashboard/assets/live-page-DrgQqQK5.js +0 -1
  317. package/dashboard/assets/meta-tile-CcskIV_o.js +0 -1
  318. package/dashboard/assets/operations-BKE8T-vY.css +0 -2
  319. package/dashboard/assets/operations-D8nUP5_m.js +0 -4
  320. package/dashboard/assets/operations-app-CQQhG54n.js +0 -2
  321. package/dashboard/assets/overview-page-DTGS8dPo.js +0 -1
  322. package/dashboard/assets/page-header-MFVvEtZW.js +0 -1
  323. package/dashboard/assets/play-Dwo-9xt6.js +0 -1
  324. package/dashboard/assets/scans-page-ChVtq8Us.js +0 -1
  325. package/dashboard/assets/search-CiooTLck.js +0 -1
  326. package/dashboard/assets/siren-CCBwTSuk.js +0 -1
  327. package/dashboard/assets/table-BYS-nIVA.js +0 -1
  328. package/dashboard/assets/tabs-DivxbhQy.js +0 -1
  329. package/dashboard/desktop.html +0 -21
@@ -1,245 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __0secCreateRequire } from "node:module";
3
- const require = __0secCreateRequire(import.meta.url);
4
-
5
- // packages/core/dist/agent/apply-patch.js
6
- import { existsSync, mkdirSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
7
- import { dirname } from "node:path";
8
- var BEGIN = "*** Begin Patch";
9
- var END = "*** End Patch";
10
- function parsePatch(input) {
11
- const text = input.replace(/\r\n/g, "\n");
12
- const lines = text.split("\n");
13
- if (lines.length > 0 && lines[lines.length - 1] === "") {
14
- lines.pop();
15
- }
16
- if (lines.length === 0 || lines[0].trim() !== BEGIN) {
17
- throw new Error(`apply_patch: envelope must start with "${BEGIN}" (got: ${lines[0] ?? "<empty>"})`);
18
- }
19
- if (lines[lines.length - 1].trim() !== END) {
20
- throw new Error(`apply_patch: envelope must end with "${END}"`);
21
- }
22
- const body = lines.slice(1, -1);
23
- const ops = [];
24
- let i = 0;
25
- while (i < body.length) {
26
- const line = body[i];
27
- const trimmed = line.trim();
28
- if (trimmed === "") {
29
- i += 1;
30
- continue;
31
- }
32
- const addMatch = /^\*\*\* Add File: (.+)$/.exec(trimmed);
33
- const replaceMatch = /^\*\*\* Replace File: (.+)$/.exec(trimmed);
34
- const updateMatch = /^\*\*\* Update File: (.+)$/.exec(trimmed);
35
- const deleteMatch = /^\*\*\* Delete File: (.+)$/.exec(trimmed);
36
- if (addMatch || replaceMatch) {
37
- const path = (addMatch?.[1] ?? replaceMatch[1]).trim();
38
- const overwrite = replaceMatch !== null;
39
- i += 1;
40
- const contentLines = [];
41
- while (i < body.length && !isOpHeader(body[i])) {
42
- const ln = body[i];
43
- if (ln.length === 0) {
44
- contentLines.push("");
45
- } else if (ln[0] === "+") {
46
- contentLines.push(ln.slice(1));
47
- } else {
48
- throw new Error(`apply_patch: Add/Replace body lines must start with "+" (got: ${JSON.stringify(ln)})`);
49
- }
50
- i += 1;
51
- }
52
- ops.push({
53
- kind: "add",
54
- path,
55
- contents: contentLines.join("\n"),
56
- overwrite
57
- });
58
- continue;
59
- }
60
- if (deleteMatch) {
61
- ops.push({ kind: "delete", path: deleteMatch[1].trim() });
62
- i += 1;
63
- continue;
64
- }
65
- if (updateMatch) {
66
- const path = updateMatch[1].trim();
67
- i += 1;
68
- const hunks = [];
69
- while (i < body.length && !isOpHeader(body[i])) {
70
- const hunkLine = body[i];
71
- if (!hunkLine.startsWith("@@")) {
72
- throw new Error(`apply_patch: Update File body must begin with "@@ <anchor>" hunk header (got: ${JSON.stringify(hunkLine)})`);
73
- }
74
- const anchor = hunkLine.slice(2).trim();
75
- i += 1;
76
- const hunkBody = [];
77
- while (i < body.length && !isOpHeader(body[i]) && !body[i].startsWith("@@")) {
78
- const ln = body[i];
79
- if (ln === "") {
80
- hunkBody.push({ kind: "context", text: "" });
81
- } else if (ln[0] === " ") {
82
- hunkBody.push({ kind: "context", text: ln.slice(1) });
83
- } else if (ln[0] === "+") {
84
- hunkBody.push({ kind: "add", text: ln.slice(1) });
85
- } else if (ln[0] === "-") {
86
- hunkBody.push({ kind: "del", text: ln.slice(1) });
87
- } else {
88
- throw new Error(`apply_patch: Update hunk body lines must start with " ", "+", or "-" (got: ${JSON.stringify(ln)})`);
89
- }
90
- i += 1;
91
- }
92
- hunks.push({ anchor, body: hunkBody });
93
- }
94
- if (hunks.length === 0) {
95
- throw new Error(`apply_patch: "Update File: ${path}" requires at least one "@@" hunk`);
96
- }
97
- ops.push({ kind: "update", path, hunks });
98
- continue;
99
- }
100
- throw new Error(`apply_patch: unknown directive (got: ${JSON.stringify(trimmed)})`);
101
- }
102
- if (ops.length === 0) {
103
- throw new Error("apply_patch: envelope contains no operations");
104
- }
105
- return ops;
106
- }
107
- function isOpHeader(line) {
108
- return line.startsWith("*** Add File:") || line.startsWith("*** Replace File:") || line.startsWith("*** Update File:") || line.startsWith("*** Delete File:");
109
- }
110
- function applyPatchOps(ops, pathResolver) {
111
- const applied = [];
112
- for (const op of ops) {
113
- const abs = pathResolver(op.path);
114
- if (op.kind === "add") {
115
- if (!op.overwrite && existsSync(abs)) {
116
- throw new Error(`apply_patch: Add File "${op.path}" failed \u2014 file already exists. Use "*** Replace File: ${op.path}" to overwrite.`);
117
- }
118
- mkdirSync(dirname(abs), { recursive: true });
119
- writeFileSync(abs, op.contents, "utf-8");
120
- applied.push({ kind: "add", path: op.path });
121
- continue;
122
- }
123
- if (op.kind === "delete") {
124
- if (!existsSync(abs)) {
125
- throw new Error(`apply_patch: Delete File "${op.path}" failed \u2014 file does not exist`);
126
- }
127
- unlinkSync(abs);
128
- applied.push({ kind: "delete", path: op.path });
129
- continue;
130
- }
131
- if (!existsSync(abs)) {
132
- throw new Error(`apply_patch: Update File "${op.path}" failed \u2014 file does not exist`);
133
- }
134
- const original = readFileSync(abs, "utf-8");
135
- const updated = applyUpdateHunks(original, op.path, op.hunks);
136
- writeFileSync(abs, updated, "utf-8");
137
- applied.push({ kind: "update", path: op.path });
138
- }
139
- return { applied };
140
- }
141
- function applyUpdateHunks(source, logicalPath, hunks) {
142
- const hadTrailingNewline = source.endsWith("\n");
143
- const sourceBody = hadTrailingNewline ? source.slice(0, -1) : source;
144
- let lines = sourceBody.split("\n");
145
- for (const hunk of hunks) {
146
- const anchorIdx = locateAnchor(lines, hunk.anchor, logicalPath);
147
- const { newLines, consumed } = applyOneHunk(lines, anchorIdx, hunk, logicalPath);
148
- lines = [
149
- ...lines.slice(0, anchorIdx),
150
- ...newLines,
151
- ...lines.slice(anchorIdx + consumed)
152
- ];
153
- }
154
- return lines.join("\n") + (hadTrailingNewline ? "\n" : "");
155
- }
156
- function locateAnchor(lines, anchor, logicalPath) {
157
- if (anchor === "") {
158
- return 0;
159
- }
160
- const matches = [];
161
- for (let i = 0; i < lines.length; i++) {
162
- if (lines[i].includes(anchor)) {
163
- matches.push(i);
164
- }
165
- }
166
- if (matches.length === 0) {
167
- throw new Error(`apply_patch: anchor "${anchor}" not found in ${logicalPath}; refine the @@ anchor to a line that exists in the file`);
168
- }
169
- if (matches.length > 1) {
170
- throw new Error(`apply_patch: context "${anchor}" matches ${matches.length} locations in ${logicalPath}; refine the @@ anchor to be unique`);
171
- }
172
- return matches[0];
173
- }
174
- function applyOneHunk(lines, anchorIdx, hunk, logicalPath) {
175
- const newLines = [];
176
- let cursor = anchorIdx;
177
- for (const entry of hunk.body) {
178
- if (entry.kind === "context") {
179
- const observed = lines[cursor];
180
- if (observed === void 0 || observed !== entry.text) {
181
- throw new Error(`apply_patch: context mismatch in ${logicalPath} at line ${cursor + 1}: expected ${JSON.stringify(entry.text)}, got ${JSON.stringify(observed ?? "<eof>")}`);
182
- }
183
- newLines.push(entry.text);
184
- cursor += 1;
185
- continue;
186
- }
187
- if (entry.kind === "del") {
188
- const observed = lines[cursor];
189
- if (observed === void 0 || observed !== entry.text) {
190
- throw new Error(`apply_patch: removed line mismatch in ${logicalPath} at line ${cursor + 1}: expected ${JSON.stringify(entry.text)}, got ${JSON.stringify(observed ?? "<eof>")}`);
191
- }
192
- cursor += 1;
193
- continue;
194
- }
195
- newLines.push(entry.text);
196
- }
197
- return { newLines, consumed: cursor - anchorIdx };
198
- }
199
-
200
- // packages/core/dist/agent/tools/scope-path.js
201
- import { lstatSync, realpathSync } from "node:fs";
202
- import { basename, dirname as dirname2, isAbsolute, resolve, sep } from "node:path";
203
- function pathEntryExists(path) {
204
- try {
205
- lstatSync(path);
206
- return true;
207
- } catch (error) {
208
- if (error.code === "ENOENT")
209
- return false;
210
- throw error;
211
- }
212
- }
213
- function canonicalizePath(path) {
214
- const missingSegments = [];
215
- let existingPath = path;
216
- while (!pathEntryExists(existingPath)) {
217
- const parent = dirname2(existingPath);
218
- if (parent === existingPath) {
219
- throw new Error(`Path does not have an existing parent: ${path}`);
220
- }
221
- missingSegments.unshift(basename(existingPath));
222
- existingPath = parent;
223
- }
224
- return resolve(realpathSync(existingPath), ...missingSegments);
225
- }
226
- function isScopedPath(scopePath, inputPath) {
227
- const root = realpathSync(scopePath);
228
- const logicalCandidate = isAbsolute(inputPath) ? resolve(inputPath) : resolve(root, inputPath);
229
- const candidate = canonicalizePath(logicalCandidate);
230
- return candidate === root || candidate.startsWith(root + sep);
231
- }
232
- function resolveScopedPath(scopePath, inputPath) {
233
- if (!isScopedPath(scopePath, inputPath)) {
234
- throw new Error(`Path escapes the allowed scope: ${inputPath}`);
235
- }
236
- const root = realpathSync(scopePath);
237
- const logicalCandidate = isAbsolute(inputPath) ? resolve(inputPath) : resolve(root, inputPath);
238
- return canonicalizePath(logicalCandidate);
239
- }
240
-
241
- export {
242
- parsePatch,
243
- applyPatchOps,
244
- resolveScopedPath
245
- };
@@ -1,333 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __0secCreateRequire } from "node:module";
3
- const require = __0secCreateRequire(import.meta.url);
4
-
5
- // packages/core/dist/stages/appsec-catalog.js
6
- import { createHash } from "node:crypto";
7
- import { existsSync, lstatSync, readFileSync } from "node:fs";
8
- import { homedir } from "node:os";
9
- import { join, resolve } from "node:path";
10
- import { fileURLToPath } from "node:url";
11
-
12
- // packages/core/dist/stages/data/appsec-archetypes.json
13
- var appsec_archetypes_default = {
14
- provenance: "0sec-authored appsec bug-class registry, 2026-07-21. Mirrors the SCHEMA of kernel-archetypes.json but is a SEPARATE, cross-language application-security pack (domain: appsec), NOT ported from 0verse (0verse's registry is Linux-kernel-only). Grounded in OWASP Top-10 / CWE and in the concrete misses these lenses were built to close: the Swiss engagement's gever OS-command-injection CRITICAL and the sibling-route authz / template-XSS / SSO-trust / resource-exhaustion classes the four generic finder lenses (memory-safety, input-validation, auth-logic, secrets-crypto) under-weighted. Unlike the kernel pack there is NO build/boot/sanitizer lane for these \u2014 every entry is route 'appsec-source-static': a grep/read hit is a hypothesis for the skeptic + multi-lens verify quorum, never an auto-confirmed finding. The load-bearing field for the finder surface is 'challenge_hint' (the cross-language, sink-shape-citing hunt angle), which the loader maps directly onto FinderLens.challengeHint; 'detection_signature' is the human/skeptic-facing grep evidence. 'engine_lens' is null for every entry (no pre-existing engine lens implements these \u2014 this registry IS their implementation).",
15
- archetypes: [
16
- {
17
- id: "os-command-injection",
18
- name: "OS command injection via attacker-influenced process/shell exec",
19
- cwe: "CWE-78",
20
- domain: "appsec",
21
- subsystem: "process / shell execution (any runtime)",
22
- pattern: "Attacker-controlled data (a request param, header, filename, upload name, DB value, config field) is concatenated or interpolated into a command line, a shell string, or a process argument that is then handed to an OS command/shell interpreter. The sink executes with the app's privileges; even when the base command is fixed, an unescaped argument, a shell metacharacter (; | & $() ` > <), or argument-injection (a value beginning with -) subverts it. The tell is DATA (not developer-authored code) reaching an exec sink without an allow-list, tokenized argv, or a proven-safe escaper.",
23
- detection_signature: 'Language-agnostic sink hunt. Node: child_process exec/execSync/spawn/spawnSync/execFile with a shell:true option or a string-built command, template literals inside exec(`...${x}...`). .NET: System.Diagnostics.Process.Start / ProcessStartInfo where FileName is cmd.exe/powershell/bash or Arguments is string-concatenated, UseShellExecute=true. Java: Runtime.getRuntime().exec(String), ProcessBuilder(command) built from concatenation, especially exec("sh", "-c", cmd). Python: subprocess.run/Popen/call with shell=True, os.system, os.popen, commands.getoutput. PHP: system/exec/shell_exec/passthru/proc_open/backticks. Ruby: system/`backticks`/%x/Open3 with interpolation. Perl: system/open with a pipe. Trace the taint from the entry point to the argv/shell string; a fixed argv array with no shell and no attacker-controlled flag is safe.',
24
- challenge_hint: "Hunt OS COMMAND INJECTION only, ACROSS ALL LANGUAGES: attacker-influenced data reaching a process/shell exec sink. Look for \u2014 Node child_process exec/execSync/spawn(..., {shell:true})/execFile and backtick-built commands; .NET Process.Start / ProcessStartInfo.FileName=cmd.exe|powershell with a concatenated Arguments (or UseShellExecute=true); Java Runtime.exec(String) / ProcessBuilder built by string concatenation (esp. sh -c); Python subprocess(..., shell=True) / os.system / os.popen; PHP system/exec/shell_exec/passthru/proc_open/backticks; Ruby system/%x/backticks; any string-built shell command. Cite the exact sink (file:line) and the concrete taint path from the entry point (route param, header, filename, upload, config, DB value) to the command string or argv. A fixed argv array with NO shell and NO attacker-controlled leading-dash flag is safe \u2014 do not flag it. This is the class that missed the gever CRITICAL.",
25
- grounding: [
26
- "CWE-78: Improper Neutralization of Special Elements used in an OS Command",
27
- "OWASP Top 10 A03:2021 Injection",
28
- "0sec Swiss engagement: gever OS-command-injection CRITICAL (missed by the generic input-validation lens)"
29
- ],
30
- confirmable: "Source-static hypothesis. A grep/read hit needs the skeptic + multi-lens verify quorum to confirm the argument is genuinely attacker-reachable and not escaped/tokenized upstream; no build/exec lane proves it in this repo.",
31
- uid: "appsec/os-command-injection",
32
- engine_lens: null,
33
- route: "appsec-source-static"
34
- },
35
- {
36
- id: "method-authz-differential",
37
- name: "Method-level authorization differential (sibling route/handler missing its siblings' authz + IDOR-by-id)",
38
- cwe: "CWE-862",
39
- domain: "appsec",
40
- subsystem: "web routing / controllers / service layer (any framework)",
41
- pattern: "Two or more handlers act on the SAME resource, but one is missing the authorization guard its siblings carry: a controller action without the [Authorize]/policy/role attribute its neighbors have; a service-layer method that mutates or reads an object WITHOUT the ownership/tenant/scope check its Update/Delete siblings enforce; a route that trusts a caller-supplied id and fetches by id alone (IDOR) instead of scoping to the authenticated principal. The vulnerability is the DIFFERENCE between siblings, not the absence of auth everywhere \u2014 the guard exists and is proven necessary on one path and simply omitted on another.",
42
- detection_signature: "Compare sibling handlers on one resource. .NET: an action lacking [Authorize]/[Authorize(Policy=...)]/[Authorize(Roles=...)] present on peer actions in the same controller, or a controller relying on a global filter that a specific action opts out of with [AllowAnonymous]. Spring: a @GetMapping/@PostMapping without the @PreAuthorize/@Secured its siblings have, or a SecurityConfig antMatcher that omits one path. Express/Koa/Fastify: a route registered without the requireAuth/authorize middleware its siblings chain. Rails: a controller action skipped in before_action :authorize, or skip_before_action. Service layer (any language): an Update/Delete method that checks resource.ownerId == currentUser before mutating, next to a sibling (e.g. GetById, Export, a bulk op) that fetches/mutates by id with NO such check. Also flag repository calls keyed only by a request-supplied id with no tenant/owner predicate.",
43
- challenge_hint: "Hunt METHOD-LEVEL AUTHORIZATION DIFFERENTIALS and IDOR only. Find sibling routes/handlers/methods on the SAME resource where ONE lacks the guard its siblings carry: a controller action missing the [Authorize]/@PreAuthorize/policy/role attribute or requireAuth middleware its peers have; a service method that mutates/reads by id WITHOUT the ownership/tenant/scope check its Update/Delete siblings enforce; a repository/query keyed only on a caller-supplied id with no owner/tenant predicate (IDOR-by-id). The signal is the DIFFERENCE between siblings \u2014 prove the guard is present and necessary on one path and genuinely absent or mis-scoped on the reachable one, not merely that an auth keyword appears somewhere in the file. Cite both the guarded sibling and the unguarded reachable handler (file:line each).",
44
- grounding: [
45
- "CWE-862: Missing Authorization",
46
- "CWE-639: Authorization Bypass Through User-Controlled Key (IDOR)",
47
- "OWASP Top 10 A01:2021 Broken Access Control"
48
- ],
49
- confirmable: "Source-static hypothesis. The skeptic must confirm the sibling truly shares the resource, the guard is genuinely absent (not enforced by a global filter/middleware or an earlier check), and the unguarded path is reachable by a lower-privileged principal.",
50
- uid: "appsec/method-authz-differential",
51
- engine_lens: null,
52
- route: "appsec-source-static"
53
- },
54
- {
55
- id: "template-xss-ssti",
56
- name: "Template / HTML-render XSS and server-side template injection (SSTI)",
57
- cwe: "CWE-79",
58
- domain: "appsec",
59
- subsystem: "view / template rendering (client and server frameworks)",
60
- pattern: "User- or controller-supplied input reaches an HTML or template render context WITHOUT context-correct escaping \u2014 either interpolated into markup that the browser parses as HTML/JS (XSS), or concatenated into the TEMPLATE SOURCE itself so the engine evaluates attacker text as template code (SSTI, which can reach RCE). This is DATA crossing into a code/markup context, distinct from a template engine legitimately compiling a developer-authored template (that is by-design and NOT a finding).",
61
- detection_signature: "Client: Angular bypassSecurityTrustHtml/bypassSecurityTrustScript/bypassSecurityTrustResourceUrl and [innerHTML]=userValue; React dangerouslySetInnerHTML={{__html: userValue}}; Vue v-html=userValue; raw DOM innerHTML/outerHTML/insertAdjacentHTML/document.write with tainted data. Server-side templates: Handlebars triple-mustache {{{x}}} / Handlebars.SafeString(userInput); Velocity/Freemarker/Thymeleaf where user input is spliced into the template STRING (not the model) \u2014 e.g. new Template(userStr) or th:utext with tainted data; JSP <%= %> without <c:out>; Jinja2/Django render_template_string(userStr) / Template(userStr); ERB/Liquid built from user input; EJS/Pug/Mustache raw-output helpers fed tainted data; string concatenation building the template passed to a compile()/render() call. Trace user input to the render/interpolation sink and check for a context-correct escaper on the path.",
62
- challenge_hint: "Hunt TEMPLATE/HTML XSS and SERVER-SIDE TEMPLATE INJECTION (SSTI) only. Find user/controller input reaching an HTML or template render without context-correct escaping: Angular bypassSecurityTrustHtml/[innerHTML]; React dangerouslySetInnerHTML; Vue v-html; raw innerHTML/document.write; Handlebars {{{triple}}}/SafeString; Velocity/Freemarker/Thymeleaf(th:utext)/JSP(<%= %>)/Jinja2 render_template_string / Template(userStr) where DATA is spliced into the template SOURCE (SSTI \u2192 possible RCE); EJS/Pug/Mustache raw helpers fed tainted data. Trace the taint from entry point to the render sink and cite the missing/incorrect escaper (file:line). IMPORTANT: a template engine compiling a DEVELOPER-authored template is by-design \u2014 the finding is untrusted DATA reaching the markup/template-code context. Do NOT let the intended-use gate talk you out of hunting this class; hunt it and report the precondition explicitly.",
63
- grounding: [
64
- "CWE-79: Improper Neutralization of Input During Web Page Generation (XSS)",
65
- "CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine (SSTI)",
66
- "OWASP Top 10 A03:2021 Injection"
67
- ],
68
- confirmable: "Source-static hypothesis. The skeptic must confirm the sink renders into a browser/template-code context, the escaper is absent or context-wrong, and the input is genuinely untrusted DATA rather than a developer-authored template (the intended-use gate distinguishes these).",
69
- uid: "appsec/template-xss-ssti",
70
- engine_lens: null,
71
- route: "appsec-source-static"
72
- },
73
- {
74
- id: "sso-trust",
75
- name: "SSO / identity-federation trust flaw (SAML / OIDC / JWT assertion validation)",
76
- cwe: "CWE-347",
77
- domain: "appsec",
78
- subsystem: "authentication / identity federation (SAML, OIDC, OAuth2, JWT)",
79
- pattern: "A relying party accepts a federated identity assertion without fully verifying its authenticity, integrity, or provenance: an unverified or forged SAML assertion/response signature, XML signature wrapping (XSW) where the signed element and the consumed element differ, the IdP\u2194RP allowlist (issuer / audience / entityID / redirect_uri) not enforced SERVER-SIDE, RelayState/redirect_uri reflected or validated with a loose prefix/substring match, or a JWT accepted with alg:none, an unverified signature, or algorithm-confusion (RS256 verified as HS256 with the public key as the HMAC secret). The trust boundary is the assertion \u2014 any gap lets an attacker mint or replay an identity.",
80
- detection_signature: "SAML: assertion consumed before/without signature validation, validateSignature disabled or wrapped in try/catch that continues, response parsed with an XML lib vulnerable to XSW, Assertion vs Response signature scope not pinned, audience/issuer/NotOnOrAfter/InResponseTo unchecked. OIDC/OAuth2: id_token accepted without verifying iss/aud/exp/nonce, redirect_uri matched by startsWith/contains instead of exact registered value, state/PKCE absent, IdP discovery/JWKS fetched over an attacker-influenceable URL. JWT: jwt.decode without verify, algorithms allowing 'none', a verify call that trusts the token's own alg header, or an HMAC verify keyed with a public key. Look for the MISSING or bypassable check on the assertion path, not just the presence of a SAML/OIDC library.",
81
- challenge_hint: "Hunt SSO / IDENTITY-FEDERATION TRUST flaws only (SAML, OIDC, OAuth2, JWT). Find where a relying party trusts a federated assertion without full server-side verification: unverified/forged SAML signature or signature-validation that continues on failure; XML signature wrapping (signed element \u2260 consumed element); issuer/audience/entityID or redirect_uri allowlist NOT enforced server-side (or matched by startsWith/substring); RelayState/redirect_uri reflection; missing state/nonce/PKCE; JWT with alg:none, unverified signature, or RS256\u2194HS256 algorithm-confusion (public key used as HMAC secret). Prove the specific check on the assertion path is absent or bypassable and cite it (file:line) \u2014 the mere presence of a SAML/OIDC/JWT library is not the finding.",
82
- grounding: [
83
- "CWE-347: Improper Verification of Cryptographic Signature",
84
- "CWE-287: Improper Authentication",
85
- "CWE-290: Authentication Bypass by Spoofing",
86
- "OWASP Top 10 A07:2021 Identification and Authentication Failures"
87
- ],
88
- confirmable: "Source-static hypothesis. The skeptic must confirm the assertion is consumed on a path where the specific verification (signature, issuer/audience, redirect_uri exact-match, JWT alg pinning) is genuinely missing or bypassable and reachable by an unauthenticated attacker.",
89
- uid: "appsec/sso-trust",
90
- engine_lens: null,
91
- route: "appsec-source-static"
92
- },
93
- {
94
- id: "resource-exhaustion-dos",
95
- name: "Resource-exhaustion / algorithmic DoS from attacker-controlled loop, sleep, or allocation",
96
- cwe: "CWE-400",
97
- domain: "appsec",
98
- subsystem: "request handling / parsing / scheduling (any runtime)",
99
- pattern: "An attacker-controlled value drives an unbounded loop, sleep/delay, allocation, decompression, fan-out, or backtracking, with no cap, timeout, or ratio check \u2014 letting a single cheap request consume disproportionate CPU, memory, threads, or time. Includes a header/param fed into a sleep (Retry-After \u2192 Thread.sleep), a decompression ratio / zip-bomb (inflate without a size/ratio limit), catastrophic-backtracking regex (ReDoS) on user input, an unbounded fan-out (N sub-requests from a user-supplied N), and mass-assignment / unbounded collection sizing driven by request data.",
100
- detection_signature: "A loop bound, sleep duration, allocation size, or recursion depth read from request data without a clamp: Thread.sleep/setTimeout/time.sleep/Task.Delay whose argument is a parsed header/param (e.g. Retry-After); GZIP/Zip/Inflater/gunzip/zlib reading into an unbounded buffer with no maxSize/ratio guard; new byte[n]/Array(n)/malloc(n)/list * n where n is attacker-supplied; regexes with nested quantifiers ((a+)+, (.*)*, (\\d+)+) matched against user input; a for/while whose iteration count is a request field; JSON/XML/YAML parsed with no depth/size limit; a paginated/batch endpoint taking a user-supplied count/limit with no server cap; ORM/mass-assignment binding an entire request body to a model. Trace the attacker-controlled magnitude to the unbounded consumer.",
101
- challenge_hint: "Hunt RESOURCE-EXHAUSTION / ALGORITHMIC DoS only: an attacker-controlled value driving an unbounded loop, sleep, allocation, decompression, fan-out, or regex backtracking with no cap/timeout/ratio. Look for \u2014 a header/param fed into Thread.sleep/setTimeout/time.sleep/Task.Delay (e.g. Retry-After \u2192 sleep); decompression without a size/ratio limit (zip-bomb, Inflater/gunzip/zlib into an unbounded buffer); ReDoS (nested quantifiers on user input); new byte[n]/Array(n)/malloc(n) with attacker-supplied n; a loop whose count is a request field; JSON/XML/YAML parsed with no depth/size limit; an endpoint honoring a user-supplied count/limit with no server cap; mass-assignment binding a whole request body. Cite the attacker-controlled magnitude and the unbounded consumer (file:line) and show there is no clamp on the path.",
102
- grounding: [
103
- "CWE-400: Uncontrolled Resource Consumption",
104
- "CWE-1333: Inefficient Regular Expression Complexity (ReDoS)",
105
- "CWE-409: Improper Handling of Highly Compressed Data (Data Amplification / zip-bomb)",
106
- "OWASP Top 10 A04:2021 Insecure Design / A05:2021 Security Misconfiguration"
107
- ],
108
- confirmable: "Source-static hypothesis. The skeptic must confirm the magnitude is genuinely attacker-controlled, the consumer is genuinely unbounded on the reachable path, and the impact is disproportionate (a single request \u2192 outsized CPU/memory/time), not a trivially bounded operation.",
109
- uid: "appsec/resource-exhaustion-dos",
110
- engine_lens: null,
111
- route: "appsec-source-static"
112
- }
113
- ]
114
- };
115
-
116
- // packages/core/dist/stages/appsec-catalog.js
117
- function mapRawAppsecArchetypes(raw) {
118
- return raw.map((a) => ({
119
- uid: a.uid,
120
- versionDigest: appsecArchetypeDigest(a),
121
- id: a.id,
122
- name: a.name,
123
- cwe: a.cwe,
124
- domain: a.domain,
125
- subsystem: a.subsystem,
126
- pattern: a.pattern,
127
- detectionSignature: a.detection_signature,
128
- challengeHint: a.challenge_hint,
129
- grounding: [...a.grounding],
130
- confirmableNote: a.confirmable,
131
- engineLens: a.engine_lens,
132
- route: a.route,
133
- ...a.source ? { source: a.source } : {},
134
- ...a.validated_at ? { validatedAt: a.validated_at } : {},
135
- ...a.miss_refs ? { missRefs: [...a.miss_refs] } : {}
136
- }));
137
- }
138
- var _cache = null;
139
- function appsecArchetypesPath() {
140
- return fileURLToPath(new URL("./data/appsec-archetypes.json", import.meta.url));
141
- }
142
- function appsecUserArchetypesPath(homeDir = homedir()) {
143
- return join(homeDir, ".0sec", "lenses", "appsec-archetypes.json");
144
- }
145
- function activeAppsecLensRegistryPath() {
146
- const configured = process.env["0SEC_APPSEC_LENS_REGISTRY"]?.trim();
147
- return configured ? resolve(configured) : appsecUserArchetypesPath();
148
- }
149
- function canonicalJson(value) {
150
- if (value === null || typeof value !== "object")
151
- return JSON.stringify(value);
152
- if (Array.isArray(value))
153
- return `[${value.map(canonicalJson).join(",")}]`;
154
- const record = value;
155
- return `{${Object.keys(record).sort().map((key) => `${JSON.stringify(key)}:${canonicalJson(record[key])}`).join(",")}}`;
156
- }
157
- function digest(value) {
158
- return `sha256:${createHash("sha256").update(canonicalJson(value)).digest("hex")}`;
159
- }
160
- function appsecArchetypeDigest(archetype) {
161
- return digest(archetype);
162
- }
163
- function appsecLensLedgerEntryDigest(entry) {
164
- return digest(entry);
165
- }
166
- function readAppsecArchetypes() {
167
- try {
168
- return JSON.parse(readFileSync(appsecArchetypesPath(), "utf8"));
169
- } catch (error) {
170
- if (error.code !== "ENOENT")
171
- throw error;
172
- return appsec_archetypes_default;
173
- }
174
- }
175
- function loadAppsecArchetypes() {
176
- if (_cache)
177
- return _cache;
178
- const raw = readAppsecArchetypes();
179
- _cache = mapRawAppsecArchetypes(raw.archetypes);
180
- return _cache;
181
- }
182
- function appsecArchetypeToFinderLens(a) {
183
- return { id: a.id, challengeHint: a.challengeHint, ...a.versionDigest ? { versionDigest: a.versionDigest } : {} };
184
- }
185
- var RUNTIME_LENSES_FLAG = "0SEC_RUNTIME_LENSES_ENABLED";
186
- var RUNTIME_LENSES_ENV = "0SEC_RUNTIME_LENSES";
187
- var SHA256_DIGEST = /^sha256:[a-f0-9]{64}$/;
188
- var LENS_ID = /^[a-z0-9][a-z0-9-]{1,63}$/;
189
- function runtimeLensesEnabled() {
190
- return !["", "0", "false", "no"].includes((process.env[RUNTIME_LENSES_FLAG] ?? "").toLowerCase());
191
- }
192
- function isStringArray(value) {
193
- return Array.isArray(value) && value.every((entry) => typeof entry === "string");
194
- }
195
- function isRawAppsecArchetype(value) {
196
- if (typeof value !== "object" || value === null)
197
- return false;
198
- const archetype = value;
199
- const isNonEmptyString = (field) => typeof field === "string" && field.trim().length > 0;
200
- return isNonEmptyString(archetype.id) && isNonEmptyString(archetype.challenge_hint) && typeof archetype.uid === "string" && typeof archetype.domain === "string" && typeof archetype.name === "string" && typeof archetype.cwe === "string" && typeof archetype.subsystem === "string" && typeof archetype.pattern === "string" && typeof archetype.detection_signature === "string" && typeof archetype.confirmable === "string" && typeof archetype.route === "string" && (archetype.engine_lens === null || typeof archetype.engine_lens === "string") && isStringArray(archetype.grounding);
201
- }
202
- function isDurablyValidatedArchetype(value) {
203
- if (!isRawAppsecArchetype(value))
204
- return false;
205
- return LENS_ID.test(value.id) && value.uid === `appsec/${value.id}` && value.domain === "appsec" && value.engine_lens === null && value.route === "appsec-source-static" && value.source === "synthesized" && typeof value.validated_at === "string" && Number.isFinite(Date.parse(value.validated_at)) && value.grounding.length > 0 && value.grounding.every((entry) => entry.trim().length > 0) && Array.isArray(value.miss_refs) && value.miss_refs.length > 0 && value.miss_refs.every((entry) => typeof entry === "string" && entry.trim().length > 0);
206
- }
207
- function isAppsecLensLedgerEntry(value) {
208
- if (typeof value !== "object" || value === null)
209
- return false;
210
- const entry = value;
211
- return entry.schemaVersion === 1 && Number.isInteger(entry.sequence) && entry.sequence > 0 && typeof entry.occurredAt === "string" && Number.isFinite(Date.parse(entry.occurredAt)) && (entry.type === "promoted" || entry.type === "retired") && typeof entry.lensId === "string" && LENS_ID.test(entry.lensId) && typeof entry.archetypeDigest === "string" && SHA256_DIGEST.test(entry.archetypeDigest) && (entry.previousDigest === null || typeof entry.previousDigest === "string" && SHA256_DIGEST.test(entry.previousDigest)) && typeof entry.entryDigest === "string" && SHA256_DIGEST.test(entry.entryDigest);
212
- }
213
- function loadDurableAppsecArchetypes() {
214
- const registryPath = activeAppsecLensRegistryPath();
215
- if (!existsSync(registryPath))
216
- return [];
217
- try {
218
- const metadata = lstatSync(registryPath);
219
- if (!metadata.isFile())
220
- throw new Error("registry must be a regular file");
221
- if ((metadata.mode & 18) !== 0) {
222
- throw new Error("registry must not be group- or world-writable");
223
- }
224
- const parsed = JSON.parse(readFileSync(registryPath, "utf8"));
225
- if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
226
- throw new Error("registry must be a JSON object");
227
- }
228
- const registry = parsed;
229
- if (registry.schemaVersion !== 1 || typeof registry.provenance !== "string" || registry.provenance.trim().length === 0 || !Array.isArray(registry.archetypes) || !Array.isArray(registry.ledger)) {
230
- throw new Error("registry must carry schemaVersion 1, provenance, archetypes, and ledger");
231
- }
232
- const active = /* @__PURE__ */ new Map();
233
- let previousDigest = null;
234
- for (const [index, rawEntry] of registry.ledger.entries()) {
235
- if (!isAppsecLensLedgerEntry(rawEntry))
236
- throw new Error(`ledger entry ${index} is malformed`);
237
- const entry = rawEntry;
238
- if (entry.sequence !== index + 1 || entry.previousDigest !== previousDigest) {
239
- throw new Error(`ledger entry ${index} breaks sequence or hash linkage`);
240
- }
241
- const expectedDigest = appsecLensLedgerEntryDigest({
242
- schemaVersion: entry.schemaVersion,
243
- sequence: entry.sequence,
244
- occurredAt: entry.occurredAt,
245
- type: entry.type,
246
- lensId: entry.lensId,
247
- archetypeDigest: entry.archetypeDigest,
248
- previousDigest: entry.previousDigest
249
- });
250
- if (entry.entryDigest !== expectedDigest)
251
- throw new Error(`ledger entry ${index} digest does not match`);
252
- if (entry.type === "promoted") {
253
- if (active.has(entry.lensId))
254
- throw new Error(`ledger promotes active lens '${entry.lensId}' twice`);
255
- active.set(entry.lensId, entry.archetypeDigest);
256
- } else {
257
- if (active.get(entry.lensId) !== entry.archetypeDigest) {
258
- throw new Error(`ledger retires unknown or mismatched lens '${entry.lensId}'`);
259
- }
260
- active.delete(entry.lensId);
261
- }
262
- previousDigest = entry.entryDigest;
263
- }
264
- const archetypes = [];
265
- for (const rawArchetype of registry.archetypes) {
266
- if (!isDurablyValidatedArchetype(rawArchetype)) {
267
- throw new Error("registry contains an unvalidated synthesized lens");
268
- }
269
- if (active.get(rawArchetype.id) !== appsecArchetypeDigest(rawArchetype)) {
270
- throw new Error(`registry lens '${rawArchetype.id}' is not bound by its ledger`);
271
- }
272
- archetypes.push(rawArchetype);
273
- }
274
- if (active.size !== archetypes.length) {
275
- throw new Error("registry ledger and active archetype set disagree");
276
- }
277
- return archetypes;
278
- } catch (error) {
279
- console.warn(`[appsec-lens-registry] ignoring ${registryPath}: ${error instanceof Error ? error.message : String(error)}`);
280
- return [];
281
- }
282
- }
283
- function loadRuntimeAppsecLenses() {
284
- if (!runtimeLensesEnabled())
285
- return [];
286
- const blob = process.env[RUNTIME_LENSES_ENV];
287
- if (!blob || blob.trim().length === 0)
288
- return [];
289
- let parsed;
290
- try {
291
- parsed = JSON.parse(blob);
292
- } catch {
293
- console.warn(`[appsec-runtime-lenses] ${RUNTIME_LENSES_ENV} is not valid JSON \u2014 falling back to durable lenses`);
294
- return [];
295
- }
296
- if (!Array.isArray(parsed)) {
297
- console.warn(`[appsec-runtime-lenses] ${RUNTIME_LENSES_ENV} must be a JSON array \u2014 falling back to durable lenses`);
298
- return [];
299
- }
300
- const valid = [];
301
- for (const entry of parsed) {
302
- if (isRawAppsecArchetype(entry))
303
- valid.push(entry);
304
- else
305
- console.warn("[appsec-runtime-lenses] skipping malformed runtime lens entry");
306
- }
307
- return mapRawAppsecArchetypes(valid).map(appsecArchetypeToFinderLens);
308
- }
309
- function loadAppsecFinderLenses() {
310
- const baked = loadAppsecArchetypes().map(appsecArchetypeToFinderLens);
311
- const durable = mapRawAppsecArchetypes(loadDurableAppsecArchetypes()).map(appsecArchetypeToFinderLens);
312
- const runtime = loadRuntimeAppsecLenses();
313
- const seen = new Set(baked.map((lens) => lens.id));
314
- const merged = [...baked];
315
- for (const lens of [...durable, ...runtime]) {
316
- if (seen.has(lens.id))
317
- continue;
318
- seen.add(lens.id);
319
- merged.push(lens);
320
- }
321
- return merged;
322
- }
323
-
324
- export {
325
- appsecArchetypesPath,
326
- appsecUserArchetypesPath,
327
- activeAppsecLensRegistryPath,
328
- appsecArchetypeDigest,
329
- appsecLensLedgerEntryDigest,
330
- loadAppsecArchetypes,
331
- appsecArchetypeToFinderLens,
332
- loadAppsecFinderLenses
333
- };