bugx-cli 0.1.0 → 0.1.2

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 (338) hide show
  1. package/README.md +193 -185
  2. package/core/README.md +2 -2
  3. package/core/agent/README.md +2 -1
  4. package/core/agent/agent_artifacts.py +8 -6
  5. package/core/agent/agent_eval.py +136 -54
  6. package/core/agent/agent_execution.py +218 -52
  7. package/core/agent/agent_orchestrator.py +14 -8
  8. package/core/agent/agent_targets.py +8 -2
  9. package/core/agent/feature_baseline.py +150 -0
  10. package/core/assets/README.md +3 -2
  11. package/core/assets/axe-core/LICENSE-3RD-PARTY.txt +66 -0
  12. package/core/assets/axe-core/LICENSE.txt +362 -0
  13. package/core/assets/axe-core/UPSTREAM.md +10 -0
  14. package/core/assets/axe-core/axe.min.js +12 -0
  15. package/core/assets/bugx-hero-en.svg +74 -0
  16. package/core/assets/bugx-hero-zh.svg +74 -0
  17. package/core/assets/bugx-social-preview.svg +71 -0
  18. package/core/assets/bugx-wechat-group.png +0 -0
  19. package/core/assets/codex.png +0 -0
  20. package/core/assets/dsh.png +0 -0
  21. package/core/assets/webui-chatgpt.jpg +0 -0
  22. package/core/assets/webui-session.jpg +0 -0
  23. package/core/assets/webui-skills.jpg +0 -0
  24. package/core/assets/webui-studio.jpg +0 -0
  25. package/core/assets/webui-zcode.jpg +0 -0
  26. package/core/assets/zcode.png +0 -0
  27. package/core/audit_packs/README.md +2 -0
  28. package/core/audit_packs/pitfalls/auth_crypto.json +64 -0
  29. package/core/audit_packs/pitfalls/file_ssrf_cmd.json +64 -0
  30. package/core/audit_packs/pitfalls/go_backend.json +66 -0
  31. package/core/audit_packs/pitfalls/java_spring.json +64 -0
  32. package/core/audit_packs/pitfalls/js_ts_web.json +67 -0
  33. package/core/audit_packs/pitfalls/python_web.json +82 -0
  34. package/core/autonomous_cve/SPEC.md +1 -1
  35. package/core/autonomous_cve/attack_graph_store.py +152 -106
  36. package/core/autonomous_cve/behavior_graph.py +8 -2
  37. package/core/autonomous_cve/verifier.py +4 -1
  38. package/core/bugx.md +1 -1
  39. package/core/bugx_paths.py +43 -8
  40. package/core/cli-help.txt +66 -0
  41. package/core/cloud_sync/SPEC.md +1 -1
  42. package/core/cloud_sync/cloud_client.py +81 -11
  43. package/core/cloud_sync/cloud_onboard.py +42 -1
  44. package/core/cloud_sync/consent.py +33 -3
  45. package/core/cloud_sync/flywheel_client.py +186 -15
  46. package/core/cloud_sync/network_transport.py +24 -3
  47. package/core/cloud_sync/sensitive_filter.py +2 -2
  48. package/core/cloud_sync/sync_push.py +12 -10
  49. package/core/contracts/AGENT_GUIDE.md +6 -9
  50. package/core/contracts/README.md +2 -2
  51. package/core/contracts/bugx-runtime-contract.md +1 -1
  52. package/core/contracts/bugx-worker.md +1 -1
  53. package/core/contracts/engine_gap_contracts.py +86 -3
  54. package/core/coverage/coverage_discovery.py +599 -29
  55. package/core/coverage/coverage_evidence.py +47 -0
  56. package/core/coverage/coverage_forensics.py +9 -0
  57. package/core/coverage/coverage_validate.py +6 -1
  58. package/core/dev_harness/SPEC.md +1 -1
  59. package/core/engine-integrity.json +670 -442
  60. package/core/fuzzing/concurrency_fuzzer.py +53 -0
  61. package/core/fuzzing/differential_oracle.py +562 -27
  62. package/core/fuzzing/fuzz_input.py +109 -6
  63. package/core/fuzzing/stateful_fuzzer.py +72 -0
  64. package/core/governance/secret_redactor.py +22 -10
  65. package/core/host_acp/SPEC.md +1 -1
  66. package/core/host_acp/__init__.py +4 -4
  67. package/core/host_acp/claude.py +59 -1
  68. package/core/host_acp/cline.py +64 -1
  69. package/core/host_acp/codex.py +56 -1
  70. package/core/host_acp/dsh.py +59 -1
  71. package/core/host_acp/opencode.py +56 -1
  72. package/core/host_acp/pi.py +59 -1
  73. package/core/host_acp/zcode.py +59 -1
  74. package/core/host_runtime/SPEC.md +1 -1
  75. package/core/host_runtime/adapters.py +1 -1
  76. package/core/host_runtime/cline.py +13 -0
  77. package/core/host_runtime/host_evaluators.py +44 -4
  78. package/core/host_runtime/host_probe.py +1 -1
  79. package/core/host_runtime/host_provider_arbitrator.py +116 -62
  80. package/core/host_runtime/host_registry.py +15 -8
  81. package/core/host_runtime/mcp_registry_gate.py +12 -1
  82. package/core/host_runtime/pi.py +102 -0
  83. package/core/host_runtime/provider_facts.py +66 -0
  84. package/core/hosts/SPEC.md +1 -1
  85. package/core/hosts/__init__.py +6 -2
  86. package/core/hosts/_dsh_usage.py +1 -1
  87. package/core/hosts/base.py +32 -4
  88. package/core/hosts/claude.py +55 -0
  89. package/core/hosts/cline.py +6 -2
  90. package/core/hosts/codex.py +58 -0
  91. package/core/hosts/dsh.py +9 -1
  92. package/core/hosts/opencode.py +6 -6
  93. package/core/hosts/pi.py +159 -2
  94. package/core/infra/README.md +4 -2
  95. package/core/infra/__init__.py +2 -0
  96. package/core/infra/build_info.py +22 -3
  97. package/core/infra/client_metadata.py +1 -1
  98. package/core/infra/json_utils.py +22 -0
  99. package/core/launch_phases/README.md +6 -3
  100. package/core/launch_phases/SPEC.md +1 -1
  101. package/core/launch_phases/common.py +21 -2
  102. package/core/launch_phases/finding_confirm_phase.py +170 -5
  103. package/core/launch_phases/finding_settlement.py +188 -1
  104. package/core/launch_phases/judge_phase.py +69 -12
  105. package/core/launch_phases/orchestrator_controls.py +11 -7
  106. package/core/launch_phases/post_coverage_sync.py +9 -2
  107. package/core/launch_phases/post_phase.py +144 -8
  108. package/core/launch_phases/post_receipt.py +12 -1
  109. package/core/launch_phases/pre_phase.py +3 -3
  110. package/core/launch_phases/pre_recon_scout.py +66 -36
  111. package/core/launch_phases/pre_state_builder.py +23 -176
  112. package/core/launch_phases/report_sharing.py +3 -7
  113. package/core/launch_phases/round_orchestrator.py +129 -58
  114. package/core/launch_phases/semantic_recon.py +545 -0
  115. package/core/launch_phases/session_runtime.py +56 -9
  116. package/core/launch_phases/startup_gates.py +36 -8
  117. package/core/launch_phases/startup_interaction.py +68 -12
  118. package/core/launch_phases/startup_version_gate.py +13 -3
  119. package/core/launch_phases/supervisor_bridge.py +46 -17
  120. package/core/launch_phases/supervisor_coverage.py +8 -2
  121. package/core/launch_phases/supervisor_degraded.py +1 -9
  122. package/core/launch_phases/verify_loop.py +767 -0
  123. package/core/launch_phases/worker_barriers.py +15 -5
  124. package/core/launch_phases/worker_orchestrator.py +105 -25
  125. package/core/launch_phases/worker_prior.py +115 -0
  126. package/core/ledger/README.md +2 -1
  127. package/core/ledger/SPEC.md +1 -1
  128. package/core/ledger/_facade.py +2 -1
  129. package/core/ledger/archive_ops.py +60 -2
  130. package/core/ledger/cli.py +6 -1
  131. package/core/ledger/export_ops.py +6 -1
  132. package/core/ledger/finding_confirmation.py +48 -6
  133. package/core/ledger/finding_lifecycle.py +428 -5
  134. package/core/ledger/finding_verification.py +555 -10
  135. package/core/ledger/fp_ledger.py +255 -0
  136. package/core/ledger/incidents.py +10 -4
  137. package/core/ledger/patterns.py +10 -7
  138. package/core/ledger/receipt_contract.py +17 -1
  139. package/core/ledger/sync_ops.py +21 -16
  140. package/core/ledger/tool_experience.py +2 -1
  141. package/core/ledger/verify_life.py +88 -17
  142. package/core/locales/en-US.json +2 -2
  143. package/core/locales/zh-CN.json +2 -2
  144. package/core/mcp_handlers/SPEC.md +1 -1
  145. package/core/mcp_handlers/base.py +23 -3
  146. package/core/mcp_handlers/channel_lifecycle.py +85 -30
  147. package/core/mcp_handlers/retrieval_handlers.py +11 -1
  148. package/core/mcp_handlers/rpc_server.py +6 -1
  149. package/core/mcp_handlers/supervisor_handlers.py +32 -6
  150. package/core/mcp_handlers/tool_table.py +15 -0
  151. package/core/mcp_runtime_support/environment.py +0 -38
  152. package/core/mcp_runtime_support/verifier.py +0 -52
  153. package/core/metadata.txt +2 -3
  154. package/core/planning/README.md +2 -1
  155. package/core/planning/domain_router.py +4 -2
  156. package/core/planning/dynamic_flow_analyzer.py +219 -14
  157. package/core/planning/judge_pipeline.py +87 -4
  158. package/core/planning/prompt_harness.py +57 -15
  159. package/core/planning/prompt_policy_engine.py +386 -0
  160. package/core/planning/spec_harvester.py +4 -4
  161. package/core/probes/INTERFACE.md +11 -1
  162. package/core/probes/SPEC.md +11 -1
  163. package/core/probes/__init__.py +46 -40
  164. package/core/probes/android_probe.py +177 -9
  165. package/core/probes/codebase_memory_probe.py +57 -0
  166. package/core/probes/desktop_probe.py +104 -0
  167. package/core/probes/differential_probe.py +99 -21
  168. package/core/probes/efficiency_probe.py +64 -0
  169. package/core/probes/ios_binary_probe.py +105 -1
  170. package/core/probes/memory_probe.py +66 -0
  171. package/core/probes/miniprogram_probe.py +75 -13
  172. package/core/probes/mobile_probe.py +215 -30
  173. package/core/probes/native_probe.py +88 -0
  174. package/core/probes/openwiki_probe.py +70 -0
  175. package/core/probes/pattern_probe.py +106 -0
  176. package/core/probes/platform_probe.py +81 -0
  177. package/core/probes/probe_registry.py +108 -7
  178. package/core/probes/sast_fixture_corpus.py +340 -0
  179. package/core/probes/sast_probe.py +553 -52
  180. package/core/probes/sast_rules.py +668 -28
  181. package/core/probes/sca_scanner.py +48 -0
  182. package/core/probes/ui_accessibility.py +149 -0
  183. package/core/probes/ui_audit.py +513 -0
  184. package/core/probes/ui_contract.py +273 -0
  185. package/core/probes/ui_evidence.py +212 -0
  186. package/core/probes/ui_measurements.py +314 -0
  187. package/core/probes/ui_repair.py +250 -0
  188. package/core/probes/ui_review.py +133 -0
  189. package/core/probes/ui_storybook.py +107 -0
  190. package/core/probes/ui_tokens.py +185 -0
  191. package/core/probes/ui_visual_diff.py +131 -0
  192. package/core/probes/web_probe.py +373 -18
  193. package/core/project_profiler/SPEC.md +1 -1
  194. package/core/project_profiler/arbitrator.py +6 -1
  195. package/core/project_profiler/detector.py +8 -1
  196. package/core/project_profiler/strategy.py +51 -15
  197. package/core/prompts/README.md +4 -2
  198. package/core/prompts/command_routing_en.md +2 -2
  199. package/core/prompts/command_routing_zh.md +2 -2
  200. package/core/prompts/policies/prompt_policies.json +101 -0
  201. package/core/prompts/stages/stage_repair.md +1 -1
  202. package/core/prompts/stages/stage_verify.defensive.md +42 -0
  203. package/core/prompts/stages/stage_verify.md +44 -0
  204. package/core/repair/README.md +1 -1
  205. package/core/repair/l7_repair_loop.py +1 -4
  206. package/core/repair/rsi_fixer.py +4 -4
  207. package/core/repair/rsi_loop.py +1 -3
  208. package/core/repair/rsi_repair.py +7 -7
  209. package/core/repair/rsi_scope.py +27 -8
  210. package/core/report_engine/SPEC.md +1 -1
  211. package/core/report_engine/attestation.py +8 -4
  212. package/core/report_engine/finding_report.py +2 -1
  213. package/core/report_engine/models.py +7 -9
  214. package/core/report_engine/report_share.py +0 -8
  215. package/core/report_engine/sast_bridge.py +2 -2
  216. package/core/report_engine/server.py +18 -8
  217. package/core/report_engine/web-conformance.md +123 -18
  218. package/core/report_engine/web_conformance.py +21 -52
  219. package/core/retrieval/README.md +2 -1
  220. package/core/retrieval/SPEC.md +1 -1
  221. package/core/retrieval/code_analyzer.py +50 -14
  222. package/core/retrieval/context_assembler.py +7 -1
  223. package/core/retrieval/knowledge_sync.py +108 -14
  224. package/core/retrieval/pitfall_packs.py +277 -0
  225. package/core/retrieval/symbol_index.py +25 -6
  226. package/core/retrieval/universal_code_matcher.py +234 -49
  227. package/core/runtime/README.md +1 -1
  228. package/core/runtime/bugx_logging.py +78 -7
  229. package/core/runtime/fixture_solidify.py +5 -10
  230. package/core/runtime/global_telemetry.py +20 -0
  231. package/core/runtime/incident_eval.py +1 -1
  232. package/core/runtime/model_runner.py +4 -41
  233. package/core/runtime/platform_adapter.py +2 -2
  234. package/core/runtime/prep_validate.py +4 -2
  235. package/core/runtime/project_settings.py +2 -1
  236. package/core/runtime/scenario_eval.py +50 -8
  237. package/core/skills/bugx_docs_mcp_server.py +3 -1
  238. package/core/skills/bugx_mcp_server.py +29 -2
  239. package/core/skills/tools_kb.py +1 -1
  240. package/core/supervisor/README.md +1 -1
  241. package/core/supervisor/SPEC.md +1 -1
  242. package/core/supervisor/budget_governor.py +503 -9
  243. package/core/supervisor/checkpoint_pipeline.py +248 -6
  244. package/core/supervisor/checkpoint_sync.py +13 -0
  245. package/core/supervisor/claim_events.py +1 -1
  246. package/core/supervisor/finding_workflow.py +22 -5
  247. package/core/supervisor/lease_manager.py +1 -1
  248. package/core/supervisor/lifecycle_blocks.py +6 -1
  249. package/core/supervisor/rejection_remedies.py +52 -5
  250. package/core/supervisor/serial_authorization.py +48 -4
  251. package/core/supervisor/task_scheduler.py +2 -2
  252. package/core/supervisor/worker_checkpoint.py +8 -1
  253. package/core/supervisor/worker_runtime.py +8 -2
  254. package/core/supervisor_types/worker_claim.py +9 -0
  255. package/core/webui/README.md +1 -1
  256. package/core/webui/SPEC.md +2 -1
  257. package/core/webui/adapters/claude.py +5 -1
  258. package/core/webui/adapters/cline.py +10 -2
  259. package/core/webui/adapters/codex.py +5 -1
  260. package/core/webui/adapters/dsh.py +5 -1
  261. package/core/webui/docs_session_service.py +2 -2
  262. package/core/webui/mcp_inspector.py +11 -7
  263. package/core/webui/static/00-base.css +1060 -0
  264. package/core/webui/static/01-monitoring.css +802 -0
  265. package/core/webui/static/02-header-actions.css +321 -0
  266. package/core/webui/static/03-trigger-popover.css +697 -0
  267. package/core/webui/static/04-composer.css +628 -0
  268. package/core/webui/static/05-skills-center.css +878 -0
  269. package/core/webui/static/06-mcp-center.css +623 -0
  270. package/core/webui/static/07-skill-detail.css +265 -0
  271. package/core/webui/static/08-files-management.css +167 -0
  272. package/core/webui/static/09-files-center.css +386 -0
  273. package/core/webui/static/10-icons.css +105 -0
  274. package/core/webui/static/11-project-options.css +185 -0
  275. package/core/webui/static/12-profile-tab.css +383 -0
  276. package/core/webui/static/design-tokens.css +113 -0
  277. package/core/webui/static/index.html +14 -1
  278. package/core/webui/workspace_service.py +1 -1
  279. package/docs/07_distribution/01_README_NPM.md +193 -185
  280. package/ecosystem/integrations/README.md +1 -1
  281. package/ecosystem/integrations/dsh/mcp/package.json +1 -1
  282. package/ecosystem/integrations/dsh/skills/bugx-dsh/SKILL.md +1 -1
  283. package/ecosystem/integrations/dsh/ui/package.json +1 -1
  284. package/ecosystem/integrations/opencode/bugx-mcp-manifest.json +4 -4
  285. package/ecosystem/integrations/opencode/mcp-lock.json +14 -6
  286. package/ecosystem/integrations/opencode/opencode.json +23 -12
  287. package/ecosystem/integrations/pi/extensions/bugx/manifest.json +1 -1
  288. package/ecosystem/integrations/qoder/connector-meta.json +1 -1
  289. package/ecosystem/integrations/workbuddy/connector-meta.json +1 -1
  290. package/ecosystem/integrations/workbuddy/skills/bugx/SKILL.md +1 -1
  291. package/ecosystem/plugins/bugx/.claude-plugin/plugin.json +1 -1
  292. package/ecosystem/plugins/bugx/.codex-plugin/plugin.json +1 -1
  293. package/ecosystem/plugins/bugx/.zcode-plugin/plugin.json +1 -1
  294. package/ecosystem/plugins/bugx/skills/bugx/SKILL.md +2 -2
  295. package/ecosystem/plugins/bugx/skills/bugx-dsh/SKILL.md +1 -1
  296. package/ecosystem/plugins/bugx/skills/bugx-opencode/SKILL.md +1 -1
  297. package/ecosystem/plugins/bugx/skills/bugx-zcode/SKILL.md +1 -1
  298. package/interfaces/bin/bugx.js +37 -0
  299. package/interfaces/cli/bugx_cli/__init__.py +4 -2
  300. package/interfaces/cli/bugx_cli/cli.py +172 -69
  301. package/interfaces/cli/bugx_cli/commands/advisory.py +1 -1
  302. package/interfaces/cli/bugx_cli/commands/agent.py +461 -134
  303. package/interfaces/cli/bugx_cli/commands/audit.py +10 -9
  304. package/interfaces/cli/bugx_cli/commands/autonomous.py +1 -1
  305. package/interfaces/cli/bugx_cli/commands/cloud.py +31 -22
  306. package/interfaces/cli/bugx_cli/commands/doctor.py +449 -204
  307. package/interfaces/cli/bugx_cli/commands/interaction.py +5 -1
  308. package/interfaces/cli/bugx_cli/commands/knowledge.py +5 -4
  309. package/interfaces/cli/bugx_cli/commands/lifecycle.py +3 -3
  310. package/interfaces/cli/bugx_cli/commands/plugin.py +58 -23
  311. package/interfaces/cli/bugx_cli/commands/plugin_claude.py +7 -7
  312. package/interfaces/cli/bugx_cli/commands/plugin_funide.py +2 -1
  313. package/interfaces/cli/bugx_cli/commands/plugin_zcode.py +1 -1
  314. package/interfaces/cli/bugx_cli/commands/project.py +6 -13
  315. package/interfaces/cli/bugx_cli/commands/report.py +2 -6
  316. package/interfaces/cli/bugx_cli/commands/system.py +524 -169
  317. package/interfaces/cli/bugx_cli/common.py +21 -15
  318. package/interfaces/cli/bugx_cli/host_adapters.py +29 -54
  319. package/interfaces/cli/bugx_cli/hosts/registry.py +8 -6
  320. package/interfaces/cli/bugx_cli/infra/ai_advisor.py +157 -27
  321. package/interfaces/cli/bugx_cli/infra/engine_installer.py +35 -16
  322. package/interfaces/cli/bugx_cli/infra/host_sync.py +11 -8
  323. package/interfaces/cli/bugx_cli/infra/mcp_advisor.py +76 -5
  324. package/interfaces/cli/bugx_cli/infra/security.py +13 -6
  325. package/package.json +30 -15
  326. package/pyproject.toml +60 -9
  327. package/scripts/ensure-python.mjs +7 -7
  328. package/scripts/sync-version.mjs +10 -21
  329. package/scripts/test-npm-wrapper.mjs +1 -1
  330. package/core/assets/bugx-hero-cn.png +0 -0
  331. package/core/assets/bugx-hero-en.png +0 -0
  332. package/core/webui/static/project-settings.css +0 -6458
  333. package/docs/07_distribution/README.md +0 -16
  334. package/docs/README.md +0 -121
  335. package/interfaces/README.md +0 -143
  336. package/interfaces/bin/README.md +0 -35
  337. package/interfaces/cli/README.md +0 -90
  338. package/scripts/README.md +0 -118
@@ -0,0 +1,74 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 400" width="1600" height="400">
2
+ <defs>
3
+ <linearGradient id="bgGrad" x1="0" y1="0" x2="0" y2="1">
4
+ <stop offset="0%" stop-color="#0a0e14"/>
5
+ <stop offset="100%" stop-color="#06090d"/>
6
+ </linearGradient>
7
+ <radialGradient id="ghostGlow" cx="0.5" cy="0.5" r="0.5">
8
+ <stop offset="0%" stop-color="#22d3ee" stop-opacity="0.20"/>
9
+ <stop offset="100%" stop-color="#22d3ee" stop-opacity="0"/>
10
+ </radialGradient>
11
+ <linearGradient id="jellyGrad" x1="0" y1="0" x2="1" y2="1">
12
+ <stop offset="0%" stop-color="#08b7d4"/>
13
+ <stop offset="100%" stop-color="#7be6f7"/>
14
+ </linearGradient>
15
+ <mask id="hollowMask">
16
+ <rect x="0" y="0" width="512" height="512" fill="#ffffff"/>
17
+ <ellipse cx="206" cy="225" rx="20" ry="28"/>
18
+ <ellipse cx="306" cy="225" rx="20" ry="28"/>
19
+ </mask>
20
+ <filter id="softGlow" x="-40%" y="-40%" width="180%" height="180%">
21
+ <feGaussianBlur stdDeviation="12" result="blur"/>
22
+ <feMerge>
23
+ <feMergeNode in="blur"/>
24
+ <feMergeNode in="SourceGraphic"/>
25
+ </feMerge>
26
+ </filter>
27
+ <style>
28
+ .wordmark { font-family: -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif; font-weight: 800; }
29
+ .tagline { font-family: -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif; }
30
+ </style>
31
+ </defs>
32
+
33
+ <!-- 背景 -->
34
+ <rect width="1600" height="400" fill="url(#bgGrad)"/>
35
+
36
+ <!-- logo + wordmark 组合整体居中(幽灵 197 宽 + 间隙 44 + BugX 约 300 宽 = 541 → 起点 529) -->
37
+ <ellipse cx="628" cy="150" rx="230" ry="140" fill="url(#ghostGlow)"/>
38
+
39
+ <!-- 幽灵光晕层 -->
40
+ <g transform="translate(402,-25) scale(0.85)" filter="url(#softGlow)" opacity="0.5">
41
+ <path d="M 140 260
42
+ C 140 150, 200 120, 256 120
43
+ C 312 120, 372 150, 372 260
44
+ C 372 280, 356 295, 340 280
45
+ C 324 265, 308 265, 292 280
46
+ C 276 295, 260 295, 244 280
47
+ C 228 265, 212 265, 196 280
48
+ C 180 295, 164 295, 148 280
49
+ C 140 272, 140 265, 140 260 Z"
50
+ fill="#7be6f7"/>
51
+ </g>
52
+ <!-- 幽灵主体 -->
53
+ <g transform="translate(402,-25) scale(0.85)">
54
+ <path d="M 140 260
55
+ C 140 150, 200 120, 256 120
56
+ C 312 120, 372 150, 372 260
57
+ C 372 280, 356 295, 340 280
58
+ C 324 265, 308 265, 292 280
59
+ C 276 295, 260 295, 244 280
60
+ C 228 265, 212 265, 196 280
61
+ C 180 295, 164 295, 148 280
62
+ C 140 272, 140 265, 140 260 Z"
63
+ fill="url(#jellyGrad)" mask="url(#hollowMask)"/>
64
+ </g>
65
+
66
+ <!-- Wordmark -->
67
+ <text class="wordmark" x="766" y="188" font-size="118" fill="#ffffff" letter-spacing="-1">BugX</text>
68
+
69
+ <!-- English tagline(母语构思,非互译) -->
70
+ <text class="tagline" x="800" y="300" font-size="34" fill="#e6edf6" text-anchor="middle"><tspan fill="#7be6f7" font-weight="700">BugX</tspan> makes it easy to audit AI-written code.</text>
71
+
72
+ <!-- 副标语 -->
73
+ <text class="tagline" x="800" y="348" font-size="19" fill="#8b9bb4" text-anchor="middle">An audit assistant that lives in the AI coding tools you already use — code review, functionality review, performance review.</text>
74
+ </svg>
@@ -0,0 +1,74 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1600 400" width="1600" height="400">
2
+ <defs>
3
+ <linearGradient id="bgGrad" x1="0" y1="0" x2="0" y2="1">
4
+ <stop offset="0%" stop-color="#0a0e14"/>
5
+ <stop offset="100%" stop-color="#06090d"/>
6
+ </linearGradient>
7
+ <radialGradient id="ghostGlow" cx="0.5" cy="0.5" r="0.5">
8
+ <stop offset="0%" stop-color="#22d3ee" stop-opacity="0.20"/>
9
+ <stop offset="100%" stop-color="#22d3ee" stop-opacity="0"/>
10
+ </radialGradient>
11
+ <linearGradient id="jellyGrad" x1="0" y1="0" x2="1" y2="1">
12
+ <stop offset="0%" stop-color="#08b7d4"/>
13
+ <stop offset="100%" stop-color="#7be6f7"/>
14
+ </linearGradient>
15
+ <mask id="hollowMask">
16
+ <rect x="0" y="0" width="512" height="512" fill="#ffffff"/>
17
+ <ellipse cx="206" cy="225" rx="20" ry="28"/>
18
+ <ellipse cx="306" cy="225" rx="20" ry="28"/>
19
+ </mask>
20
+ <filter id="softGlow" x="-40%" y="-40%" width="180%" height="180%">
21
+ <feGaussianBlur stdDeviation="12" result="blur"/>
22
+ <feMerge>
23
+ <feMergeNode in="blur"/>
24
+ <feMergeNode in="SourceGraphic"/>
25
+ </feMerge>
26
+ </filter>
27
+ <style>
28
+ .wordmark { font-family: -apple-system, "SF Pro Display", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif; font-weight: 800; }
29
+ .tagline { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif; }
30
+ </style>
31
+ </defs>
32
+
33
+ <!-- 背景 -->
34
+ <rect width="1600" height="400" fill="url(#bgGrad)"/>
35
+
36
+ <!-- logo + wordmark 组合整体居中(幽灵 197 宽 + 间隙 44 + BugX 约 300 宽 = 541 → 起点 529) -->
37
+ <ellipse cx="628" cy="150" rx="230" ry="140" fill="url(#ghostGlow)"/>
38
+
39
+ <!-- 幽灵光晕层 -->
40
+ <g transform="translate(402,-25) scale(0.85)" filter="url(#softGlow)" opacity="0.5">
41
+ <path d="M 140 260
42
+ C 140 150, 200 120, 256 120
43
+ C 312 120, 372 150, 372 260
44
+ C 372 280, 356 295, 340 280
45
+ C 324 265, 308 265, 292 280
46
+ C 276 295, 260 295, 244 280
47
+ C 228 265, 212 265, 196 280
48
+ C 180 295, 164 295, 148 280
49
+ C 140 272, 140 265, 140 260 Z"
50
+ fill="#7be6f7"/>
51
+ </g>
52
+ <!-- 幽灵主体 -->
53
+ <g transform="translate(402,-25) scale(0.85)">
54
+ <path d="M 140 260
55
+ C 140 150, 200 120, 256 120
56
+ C 312 120, 372 150, 372 260
57
+ C 372 280, 356 295, 340 280
58
+ C 324 265, 308 265, 292 280
59
+ C 276 295, 260 295, 244 280
60
+ C 228 265, 212 265, 196 280
61
+ C 180 295, 164 295, 148 280
62
+ C 140 272, 140 265, 140 260 Z"
63
+ fill="url(#jellyGrad)" mask="url(#hollowMask)"/>
64
+ </g>
65
+
66
+ <!-- 文字标题 -->
67
+ <text class="wordmark" x="766" y="188" font-size="118" fill="#ffffff" letter-spacing="-1">BugX</text>
68
+
69
+ <!-- 中文 tagline -->
70
+ <text class="tagline" x="800" y="300" font-size="35" fill="#e6edf6" text-anchor="middle"><tspan fill="#7be6f7" font-weight="700">BugX</tspan>,让你轻松审计 AI 写的代码。</text>
71
+
72
+ <!-- 副行 -->
73
+ <text class="tagline" x="800" y="348" font-size="20" fill="#8b9bb4" text-anchor="middle">装进你现有开发工具的 AI 审计助手,可以协助你实现代码审查、功能审查、性能审查。</text>
74
+ </svg>
@@ -0,0 +1,71 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1280 640" width="1280" height="640">
2
+ <defs>
3
+ <linearGradient id="bgGrad" x1="0" y1="0" x2="0" y2="1">
4
+ <stop offset="0%" stop-color="#0a0e14"/>
5
+ <stop offset="100%" stop-color="#06090d"/>
6
+ </linearGradient>
7
+ <radialGradient id="ghostGlow" cx="0.5" cy="0.5" r="0.5">
8
+ <stop offset="0%" stop-color="#22d3ee" stop-opacity="0.22"/>
9
+ <stop offset="100%" stop-color="#22d3ee" stop-opacity="0"/>
10
+ </radialGradient>
11
+ <linearGradient id="jellyGrad" x1="0" y1="0" x2="1" y2="1">
12
+ <stop offset="0%" stop-color="#08b7d4"/>
13
+ <stop offset="100%" stop-color="#7be6f7"/>
14
+ </linearGradient>
15
+ <mask id="hollowMask">
16
+ <rect x="0" y="0" width="512" height="512" fill="#ffffff"/>
17
+ <ellipse cx="206" cy="225" rx="20" ry="28"/>
18
+ <ellipse cx="306" cy="225" rx="20" ry="28"/>
19
+ </mask>
20
+ <filter id="softGlow" x="-40%" y="-40%" width="180%" height="180%">
21
+ <feGaussianBlur stdDeviation="14" result="blur"/>
22
+ <feMerge>
23
+ <feMergeNode in="blur"/>
24
+ <feMergeNode in="SourceGraphic"/>
25
+ </feMerge>
26
+ </filter>
27
+ <style>
28
+ .wordmark { font-family: -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif; font-weight: 800; }
29
+ .tagline { font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif; }
30
+ </style>
31
+ </defs>
32
+
33
+ <rect width="1280" height="640" fill="url(#bgGrad)"/>
34
+
35
+
36
+ <!-- 光晕(居中于图形) -->
37
+ <ellipse cx="400" cy="260" rx="260" ry="170" fill="url(#ghostGlow)"/>
38
+
39
+ <!-- 幽灵(主体,居中偏左上) -->
40
+ <g transform="translate(280,23.3) scale(0.95)" filter="url(#softGlow)" opacity="0.5">
41
+ <path d="M 140 260
42
+ C 140 150, 200 120, 256 120
43
+ C 312 120, 372 150, 372 260
44
+ C 372 280, 356 295, 340 280
45
+ C 324 265, 308 265, 292 280
46
+ C 276 295, 260 295, 244 280
47
+ C 228 265, 212 265, 196 280
48
+ C 180 295, 164 295, 148 280
49
+ C 140 272, 140 265, 140 260 Z"
50
+ fill="#7be6f7"/>
51
+ </g>
52
+ <g transform="translate(280,23.3) scale(0.95)">
53
+ <path d="M 140 260
54
+ C 140 150, 200 120, 256 120
55
+ C 312 120, 372 150, 372 260
56
+ C 372 280, 356 295, 340 280
57
+ C 324 265, 308 265, 292 280
58
+ C 276 295, 260 295, 244 280
59
+ C 228 265, 212 265, 196 280
60
+ C 180 295, 164 295, 148 280
61
+ C 140 272, 140 265, 140 260 Z"
62
+ fill="url(#jellyGrad)" mask="url(#hollowMask)"/>
63
+ </g>
64
+
65
+ <!-- Wordmark -->
66
+
67
+ <!-- 双语标语 -->
68
+ <text class="tagline" x="640" y="470" font-size="32" fill="#e6edf6" text-anchor="middle"><tspan fill="#7be6f7" font-weight="700">BugX</tspan> makes it easy to audit AI-written code.</text>
69
+ <text class="tagline" x="640" y="530" font-size="24" fill="#8b9bb4" text-anchor="middle">让你轻松审计 AI 写的代码 · AI 代码审计 Agent</text>
70
+ <text class="wordmark" x="580" y="300" font-size="150" fill="#ffffff" letter-spacing="-1">BugX</text>
71
+ </svg>
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -14,6 +14,7 @@ flowchart TD
14
14
  AP --> NA["native-audit/<br/>C/C++/Rust 系统级与底层原生审计"]
15
15
  AP --> DA["desktop-audit/<br/>桌面应用与跨进程通信审计"]
16
16
  AP --> DATA["data-audit/<br/>数据库与数据合规完整性审计"]
17
+ AP --> PF["pitfalls/<br/>按技术栈挂载的冷启动漏洞先验包 (JSON)"]
17
18
  ```
18
19
 
19
20
  ---
@@ -27,6 +28,7 @@ flowchart TD
27
28
  | `native-audit` | C / C++ / Rust / Go 系统级服务、驱动、高性能组件 | 白盒静态分析 (`10-static-white-box`)、内存与并发竞争 (`20-memory-concurrency`)、黑盒模糊测试 (`30-behavior-black-box`)、回归测试 (`80-evidence-regression`) |
28
29
  | `desktop-audit` | Electron / Tauri / macOS Cocoa / Windows 原生桌面应用 | 进程通信模型 (`10-process-model`)、打包签名与分发完整性 (`20-package-integrity`)、UI 行为与剪贴板权限 (`30-ui-behavior`) |
29
30
  | `data-audit` | SQL/NoSQL 数据库模型、数据流水线、合规性脱敏 | 数据表与 Schema 盘点 (`10-schema-inventory`)、查询优化与注入漏洞 (`20-query-and-integrity`)、回溯验证 (`80-evidence-regression`) |
31
+ | `pitfalls/` | 按技术栈按需挂载的冷启动漏洞先验包(`python_web` / `js_ts_web` / `go_backend` / `java_spring` / `auth_crypto` / `file_ssrf_cmd`) | 机读 CWE、反模式信号、误报排除护栏与最小 PoC 骨架(由 `core/retrieval/pitfall_packs.py` 检索注入) |
30
32
  | `platform-testing.md` | 桌面端与移动端测试核心规则 | 跨平台多目标(Electron/Android/iOS/Flutter/Web)审计前置、平台预检通道与验证矩阵 |
31
33
  | `memory-testing.md` | 应用软件内存审计核心规约 | 针对内存泄漏、持续增长、OOM、越界访问、Use-After-Free 的针对性工作负载与证据规则 |
32
34
 
@@ -0,0 +1,64 @@
1
+ {
2
+ "pack_id": "auth_crypto",
3
+ "schema_version": 1,
4
+ "description": "跨语言认证、鉴权与密码学冷启动漏洞先验包(JWT / HMAC / Session / 业务边界)",
5
+ "pitfalls": [
6
+ {
7
+ "pitfall_id": "AUTH-JWT-001",
8
+ "cwe": "CWE-347",
9
+ "severity": "critical",
10
+ "languages": ["*"],
11
+ "frameworks": ["*"],
12
+ "surfaces": ["auth", "http", "api"],
13
+ "title": "JWT 校验允许 alg=none 或跳过签名验证(jwt.decode verify=False)",
14
+ "anti_pattern_signals": ["alg", "none", "verify_signature", "verify=False", "jwt.decode(", "urlsafe_b64decode"],
15
+ "false_positive_guards": [
16
+ "显式传入 algorithms=['HS256'] / ['RS256'] 白名单且强制验签",
17
+ "解析 header 后拒绝任何不在白名单内的 alg"
18
+ ],
19
+ "poc_skeleton": "构造 header `{\"alg\":\"none\"}` + 伪造 payload(sub=admin)+ 空签名段,验证是否通过校验"
20
+ },
21
+ {
22
+ "pitfall_id": "AUTH-TIMING-002",
23
+ "cwe": "CWE-208",
24
+ "severity": "medium",
25
+ "languages": ["*"],
26
+ "frameworks": ["*"],
27
+ "surfaces": ["auth", "crypto", "api"],
28
+ "title": "使用普通字符串相等(== / !=)比对签名/API Token/Webhook MAC",
29
+ "anti_pattern_signals": ["signature ==", "token ==", "hmac", "secret ==", "digest =="],
30
+ "false_positive_guards": [
31
+ "使用常量时间比较:hmac.compare_digest / crypto.timingSafeEqual / subtle.ConstantTimeCompare"
32
+ ],
33
+ "poc_skeleton": "静态定位签名/密钥比对分支未调用常量时间比较原语"
34
+ },
35
+ {
36
+ "pitfall_id": "AUTH-WEAKRAND-003",
37
+ "cwe": "CWE-330",
38
+ "severity": "high",
39
+ "languages": ["*"],
40
+ "frameworks": ["*"],
41
+ "surfaces": ["auth", "crypto", "token"],
42
+ "title": "使用非密码学随机数(random / Math.random / math/rand)生成 Token 或重置码",
43
+ "anti_pattern_signals": ["random.choice(", "random.randint(", "Math.random(", "math/rand"],
44
+ "false_positive_guards": [
45
+ "使用 secrets.token_urlsafe / crypto.randomBytes / crypto/rand"
46
+ ],
47
+ "poc_skeleton": "固定种子或检查调用点确认安全令牌来源于可预测 PRNG"
48
+ },
49
+ {
50
+ "pitfall_id": "BIZ-NEGVAL-004",
51
+ "cwe": "CWE-20",
52
+ "severity": "high",
53
+ "languages": ["*"],
54
+ "frameworks": ["*"],
55
+ "surfaces": ["billing", "payment", "api", "logic"],
56
+ "title": "金额/数量/折扣缺少非负或上界校验导致负数退款/余额篡改",
57
+ "anti_pattern_signals": ["quantity", "amount", "discount", "price", "balance", "refund"],
58
+ "false_positive_guards": [
59
+ "入口校验 quantity > 0 且 amount > 0 且 discount <= total"
60
+ ],
61
+ "poc_skeleton": "传入负数量(quantity=-5)或超大折扣,断言应付金额变为负数或余额反向增加"
62
+ }
63
+ ]
64
+ }
@@ -0,0 +1,64 @@
1
+ {
2
+ "pack_id": "file_ssrf_cmd",
3
+ "schema_version": 1,
4
+ "description": "跨语言文件系统、SSRF 与命令注入冷启动漏洞先验包",
5
+ "pitfalls": [
6
+ {
7
+ "pitfall_id": "IO-PATH-001",
8
+ "cwe": "CWE-22",
9
+ "severity": "high",
10
+ "languages": ["*"],
11
+ "frameworks": ["*"],
12
+ "surfaces": ["file", "http", "api", "storage"],
13
+ "title": "未做规范化前缀校验的路径拼接导致目录穿越或同前缀逃逸",
14
+ "anti_pattern_signals": ["os.path.join(", "Path(", "open(", "send_file(", "readFile(", "startswith("],
15
+ "false_positive_guards": [
16
+ "使用 resolve().relative_to(base.resolve()) 且拦截符号链接组件",
17
+ "startswith 校验包含尾部分隔符 os.sep 且先经 realpath 规范化"
18
+ ],
19
+ "poc_skeleton": "传入 `../target_sibling/secret` 或 `../../etc/hosts`,验证是否绕过目录限制"
20
+ },
21
+ {
22
+ "pitfall_id": "IO-CMD-002",
23
+ "cwe": "CWE-78",
24
+ "severity": "critical",
25
+ "languages": ["*"],
26
+ "frameworks": ["*"],
27
+ "surfaces": ["cli", "api", "process", "http"],
28
+ "title": "subprocess(shell=True) / os.system / child_process.exec 拼接非受信参数",
29
+ "anti_pattern_signals": ["shell=True", "os.system(", "os.popen(", "child_process.exec(", "exec.Command(\"sh\"", "Runtime.getRuntime().exec("],
30
+ "false_positive_guards": [
31
+ "使用 argv 数组形式且 shell=False,并对参数做严格字符白名单校验"
32
+ ],
33
+ "poc_skeleton": "传入带命令分隔符的无害标记参数,验证是否触发预期外命令解析"
34
+ },
35
+ {
36
+ "pitfall_id": "IO-SSRF-003",
37
+ "cwe": "CWE-918",
38
+ "severity": "high",
39
+ "languages": ["*"],
40
+ "frameworks": ["*"],
41
+ "surfaces": ["http", "webhook", "api", "network"],
42
+ "title": "服务端按用户提供 URL 发起 HTTP 请求未拦截回环/私网/云元数据地址(SSRF)",
43
+ "anti_pattern_signals": ["requests.get(", "httpx.", "urllib.request.urlopen(", "fetch(", "axios.get(", "http.Get("],
44
+ "false_positive_guards": [
45
+ "解析 DNS 后校验所有解析 IP 非私网/回环/链路本地(169.254.169.254),且禁用自动重定向或对每跳重验"
46
+ ],
47
+ "poc_skeleton": "传入本地回环测试端点或 `http://169.254.169.254/`,断言服务端直接发出请求且未拒绝私网 IP"
48
+ },
49
+ {
50
+ "pitfall_id": "IO-ZIPSLIP-004",
51
+ "cwe": "CWE-22",
52
+ "severity": "high",
53
+ "languages": ["*"],
54
+ "frameworks": ["*"],
55
+ "surfaces": ["file", "archive", "upload"],
56
+ "title": "zipfile.extractall / tarfile.extractall 未校验归档成员路径(Zip Slip)",
57
+ "anti_pattern_signals": ["extractall(", "tarfile.open(", "zipfile.ZipFile(", "unzip"],
58
+ "false_positive_guards": [
59
+ "逐成员校验 resolved.relative_to(dest) 并拒绝符号链接/硬链接(Python 3.12+ filter='data')"
60
+ ],
61
+ "poc_skeleton": "构造包含 `../escape.txt` 成员的内存归档,调用解压函数验证文件写到目标目录外"
62
+ }
63
+ ]
64
+ }
@@ -0,0 +1,66 @@
1
+ {
2
+ "pack_id": "go_backend",
3
+ "schema_version": 1,
4
+ "description": "Go 后端冷启动漏洞先验包(net/http / Gin / GORM / 并发竞态)",
5
+ "pitfalls": [
6
+ {
7
+ "pitfall_id": "GO-SQLI-001",
8
+ "cwe": "CWE-89",
9
+ "severity": "critical",
10
+ "languages": ["go"],
11
+ "frameworks": ["gin", "gorm", "net/http", "echo"],
12
+ "surfaces": ["http", "api", "database"],
13
+ "title": "GORM Where/Order/Raw 使用 fmt.Sprintf 拼接用户输入",
14
+ "anti_pattern_signals": ["fmt.Sprintf(", ".Where(", ".Raw(", ".Order(", "db.Query("],
15
+ "false_positive_guards": [
16
+ "使用占位符参数 db.Where('name = ?', input)",
17
+ "Order 列名经 map 白名单映射后再拼接"
18
+ ],
19
+ "poc_skeleton": "传入带 SQL 语法边界符的参数(如 `id; DROP` 或 `1 OR 1=1`),验证生成 SQL 改变查询语义"
20
+ },
21
+ {
22
+ "pitfall_id": "GO-PATH-002",
23
+ "cwe": "CWE-22",
24
+ "severity": "high",
25
+ "languages": ["go"],
26
+ "frameworks": ["gin", "net/http", "echo"],
27
+ "surfaces": ["http", "file", "api"],
28
+ "title": "filepath.Join 拼接用户路径未校验前缀边界(路径穿越)",
29
+ "anti_pattern_signals": ["filepath.Join(", "os.ReadFile(", "c.File(", "http.ServeFile("],
30
+ "false_positive_guards": [
31
+ "使用 filepath.Rel 后验证结果不以 '..' 开头且非绝对路径,或使用 os.Root (Go 1.24+)",
32
+ "仅允许匹配 ^[a-zA-Z0-9_-]+$ 的单段文件名"
33
+ ],
34
+ "poc_skeleton": "传入 `../../etc/passwd` 或同前缀目录逃逸 `../base_secret/a`,验证突破 baseDir 约束"
35
+ },
36
+ {
37
+ "pitfall_id": "GO-RACE-003",
38
+ "cwe": "CWE-362",
39
+ "severity": "high",
40
+ "languages": ["go"],
41
+ "frameworks": ["gin", "net/http", "grpc"],
42
+ "surfaces": ["concurrency", "api", "state"],
43
+ "title": "无锁并发读写共享 map 或检查-后-使用(TOCTOU)竞态",
44
+ "anti_pattern_signals": ["go func(", "make(map[", "sync.Mutex", "balance", "quota"],
45
+ "false_positive_guards": [
46
+ "共享状态全程受 sync.Mutex / sync.RWMutex 或 sync.Map / channel 单写者保护",
47
+ "余额/配额扣减在数据库事务中使用原子条件更新 WHERE balance >= ?"
48
+ ],
49
+ "poc_skeleton": "使用 `go test -race` 并发触发多个 goroutine 访问同一处理器,观测 data race 或超扣"
50
+ },
51
+ {
52
+ "pitfall_id": "GO-TEMPLATE-004",
53
+ "cwe": "CWE-79",
54
+ "severity": "medium",
55
+ "languages": ["go"],
56
+ "frameworks": ["gin", "net/http"],
57
+ "surfaces": ["web", "http", "template"],
58
+ "title": "使用 text/template 渲染 HTML 或将非受信输入强转为 template.HTML",
59
+ "anti_pattern_signals": ["text/template", "template.HTML(", "template.JS(", "template.URL("],
60
+ "false_positive_guards": [
61
+ "使用 html/template 且未对用户输入做 template.HTML 类型强转"
62
+ ],
63
+ "poc_skeleton": "向模板变量注入 `<script>1</script>`,验证输出 HTML 未被自动实体转义"
64
+ }
65
+ ]
66
+ }
@@ -0,0 +1,64 @@
1
+ {
2
+ "pack_id": "java_spring",
3
+ "schema_version": 1,
4
+ "description": "Java / Spring Boot 冷启动漏洞先验包(MyBatis / SpEL / Jackson / XXE)",
5
+ "pitfalls": [
6
+ {
7
+ "pitfall_id": "JAVA-MYBATIS-001",
8
+ "cwe": "CWE-89",
9
+ "severity": "critical",
10
+ "languages": ["java", "kotlin"],
11
+ "frameworks": ["spring", "springboot", "mybatis"],
12
+ "surfaces": ["http", "api", "database"],
13
+ "title": "MyBatis Mapper 中使用 ${...} 字符串插值导致 SQL 注入",
14
+ "anti_pattern_signals": ["${", "@Select(", "order by ${", "like '%${"],
15
+ "false_positive_guards": [
16
+ "使用预编译占位符 #{param}",
17
+ "${column} 传入前经过枚举/白名单映射"
18
+ ],
19
+ "poc_skeleton": "向 ORDER BY / LIKE 参数传入 SQL 注释或布尔表达式,对比响应差异"
20
+ },
21
+ {
22
+ "pitfall_id": "JAVA-SPEL-002",
23
+ "cwe": "CWE-917",
24
+ "severity": "critical",
25
+ "languages": ["java", "kotlin"],
26
+ "frameworks": ["spring", "springboot"],
27
+ "surfaces": ["http", "api", "expression"],
28
+ "title": "SpelExpressionParser 解析非受信表达式且使用 StandardEvaluationContext",
29
+ "anti_pattern_signals": ["SpelExpressionParser", "parseExpression(", "StandardEvaluationContext"],
30
+ "false_positive_guards": [
31
+ "使用 SimpleEvaluationContext.forReadOnlyDataBinding() 禁止类型/构造器解析"
32
+ ],
33
+ "poc_skeleton": "传入 `T(java.lang.Math).abs(-7)` 验证类型解析被求值为 7"
34
+ },
35
+ {
36
+ "pitfall_id": "JAVA-JACKSON-003",
37
+ "cwe": "CWE-502",
38
+ "severity": "critical",
39
+ "languages": ["java", "kotlin"],
40
+ "frameworks": ["spring", "springboot", "jackson"],
41
+ "surfaces": ["http", "api", "json"],
42
+ "title": "Jackson enableDefaultTyping / activateDefaultTyping(LaissezFaireSubTypeValidator) 多态反序列化",
43
+ "anti_pattern_signals": ["enableDefaultTyping(", "LaissezFaireSubTypeValidator", "@JsonTypeInfo"],
44
+ "false_positive_guards": [
45
+ "使用 BasicPolymorphicTypeValidator 显式限制允许基类/包白名单"
46
+ ],
47
+ "poc_skeleton": "提交包含非预期 `@class` 类型标签的 JSON,验证反序列化实例化任意类"
48
+ },
49
+ {
50
+ "pitfall_id": "JAVA-XXE-004",
51
+ "cwe": "CWE-611",
52
+ "severity": "high",
53
+ "languages": ["java", "kotlin"],
54
+ "frameworks": ["spring", "springboot", "jaxp"],
55
+ "surfaces": ["http", "api", "xml"],
56
+ "title": "DocumentBuilderFactory / SAXParserFactory 未禁用外部实体解析(XXE)",
57
+ "anti_pattern_signals": ["DocumentBuilderFactory.newInstance(", "SAXParserFactory.newInstance(", "XMLInputFactory.newInstance("],
58
+ "false_positive_guards": [
59
+ "显式设置 disallow-doctype-decl=true 与 external-general-entities=false"
60
+ ],
61
+ "poc_skeleton": "提交含本地无害实体声明的 DOCTYPE XML,验证解析器展开外部/内部实体"
62
+ }
63
+ ]
64
+ }
@@ -0,0 +1,67 @@
1
+ {
2
+ "pack_id": "js_ts_web",
3
+ "schema_version": 1,
4
+ "description": "JavaScript / TypeScript Web 冷启动漏洞先验包(Express / Next.js / React / Node)",
5
+ "pitfalls": [
6
+ {
7
+ "pitfall_id": "JS-PROTO-001",
8
+ "cwe": "CWE-1321",
9
+ "severity": "high",
10
+ "languages": ["javascript", "typescript"],
11
+ "frameworks": ["express", "nextjs", "node"],
12
+ "surfaces": ["http", "api", "json"],
13
+ "title": "递归对象合并/路径赋值未拦截 __proto__ / constructor.prototype(原型污染)",
14
+ "anti_pattern_signals": ["__proto__", "Object.assign", "deepMerge", "merge(", "for (const key in", "target[key] ="],
15
+ "false_positive_guards": [
16
+ "显式跳过 key === '__proto__' || key === 'constructor' || key === 'prototype'",
17
+ "目标对象使用 Object.create(null) 或 Map 存储动态键"
18
+ ],
19
+ "poc_skeleton": "传入 JSON `{\"__proto__\": {\"polluted\": true}}` 经合并函数处理后检查 `({}).polluted === true`"
20
+ },
21
+ {
22
+ "pitfall_id": "JS-XSS-002",
23
+ "cwe": "CWE-79",
24
+ "severity": "high",
25
+ "languages": ["javascript", "typescript"],
26
+ "frameworks": ["react", "nextjs", "vue", "express"],
27
+ "surfaces": ["web", "ui", "http"],
28
+ "title": "dangerouslySetInnerHTML / innerHTML / javascript: URL 未经净化",
29
+ "anti_pattern_signals": ["dangerouslySetInnerHTML", "innerHTML", "v-html", "res.send(", "window.location ="],
30
+ "false_positive_guards": [
31
+ "经过 DOMPurify.sanitize() 且禁止 javascript:/data: 协议",
32
+ "URL 经 new URL() 解析并严格限制 protocol 为 http:/https:"
33
+ ],
34
+ "poc_skeleton": "传入 `<img src=x onerror=alert(1)>` 或 `javascript:alert(1)`,验证输出未转义或协议未拦截"
35
+ },
36
+ {
37
+ "pitfall_id": "JS-NOSQLI-003",
38
+ "cwe": "CWE-943",
39
+ "severity": "critical",
40
+ "languages": ["javascript", "typescript"],
41
+ "frameworks": ["express", "nextjs", "node", "mongoose"],
42
+ "surfaces": ["http", "api", "database"],
43
+ "title": "req.body / req.query 对象直接传入 MongoDB findOne(NoSQL 运算符注入)",
44
+ "anti_pattern_signals": ["findOne(", "find(", "req.body", "req.query", "$ne", "$gt", "$regex"],
45
+ "false_positive_guards": [
46
+ "输入经 zod/joi 强类型校验为 string(String(val) 或 typeof val === 'string')",
47
+ "开启 sanitizeFilter 或过滤 `$` 开头键"
48
+ ],
49
+ "poc_skeleton": "登录或查询接口传入 `{\"password\": {\"$ne\": \"\"}}`,验证绕过校验返回首条记录"
50
+ },
51
+ {
52
+ "pitfall_id": "JS-OPENREDIRECT-004",
53
+ "cwe": "CWE-601",
54
+ "severity": "medium",
55
+ "languages": ["javascript", "typescript"],
56
+ "frameworks": ["express", "nextjs", "node"],
57
+ "surfaces": ["http", "web", "auth"],
58
+ "title": "res.redirect / NextResponse.redirect 直接跳转外部非受信 URL",
59
+ "anti_pattern_signals": ["res.redirect(", "NextResponse.redirect(", "returnUrl", "next=", "redirect_uri"],
60
+ "false_positive_guards": [
61
+ "仅允许单斜杠相对路径(startswith('/') 且不以 '//' 开头且不含反斜杠)",
62
+ "解析 host 严格命中固定域名白名单"
63
+ ],
64
+ "poc_skeleton": "传入 `next=//evil.example` 或 `next=https://evil.example`,断言响应 Location 指向外部域"
65
+ }
66
+ ]
67
+ }