xploitscan 0.7.0 → 0.8.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.
package/README.md CHANGED
@@ -1,8 +1,11 @@
1
- # xploitscan
1
+ # XploitScan
2
2
 
3
- AI security scanner for vibe-coded apps. Find vulnerabilities before attackers do.
3
+ [![npm version](https://img.shields.io/npm/v/xploitscan.svg)](https://www.npmjs.com/package/xploitscan)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
4
5
 
5
- Built for solo devs and non-technical founders shipping AI-generated code via Cursor, Lovable, Bolt, Replit, and Claude Code.
6
+ **Security scanner for AI-generated code.** Find vulnerabilities before attackers do.
7
+
8
+ Built for developers shipping code via Cursor, Lovable, Bolt, Replit, and Claude Code. 131 security rules. Plain-English results. Copy-paste fixes.
6
9
 
7
10
  ## Quick Start
8
11
 
@@ -10,29 +13,29 @@ Built for solo devs and non-technical founders shipping AI-generated code via Cu
10
13
  npx xploitscan scan .
11
14
  ```
12
15
 
13
- That's it. No config needed.
16
+ No install, no config, no account required. Your code stays 100% local.
14
17
 
15
18
  ## What It Catches
16
19
 
17
- | Rule | Vulnerability | Severity |
18
- |------|--------------|----------|
19
- | VC001 | Hardcoded API keys & secrets (AWS, Stripe, OpenAI, Supabase, DB URLs) | Critical |
20
- | VC002 | .env files with secrets committed to git | High |
21
- | VC003 | API routes missing authentication | High |
22
- | VC004 | Supabase service_role key in client code / RLS bypass | Critical |
23
- | VC005 | Stripe webhooks without signature verification | Critical |
24
- | VC006 | SQL injection via string interpolation | Critical |
25
- | VC007 | XSS (dangerouslySetInnerHTML, innerHTML, v-html) | High |
26
- | VC008 | Server without rate limiting | Medium |
27
- | VC009 | Wildcard CORS configuration | Medium |
28
- | VC010 | Client-side only authorization checks | High |
29
-
30
- Plus **AI-powered contextual analysis** that catches issues static rules miss.
20
+ 131 rules across 15+ categories:
21
+
22
+ | Category | Examples | Rules |
23
+ |----------|---------|-------|
24
+ | **Secrets** | Hardcoded API keys, .env files, OAuth secrets, Terraform state | 15+ |
25
+ | **Injection** | SQL, XSS, SSRF, command injection, path traversal, XXE, SSTI | 20+ |
26
+ | **Authentication** | Missing auth, weak JWT, insecure password reset, OAuth flaws | 15+ |
27
+ | **Cryptography** | Weak RSA, deprecated TLS, ECB mode, hardcoded IVs | 10+ |
28
+ | **Infrastructure** | Dockerfile, Kubernetes, Terraform, AWS IAM misconfigs | 10+ |
29
+ | **Supply Chain** | Unpinned GitHub Actions, vulnerable dependencies | 5+ |
30
+ | **Information Leakage** | PII in logs, unencrypted DB fields, exposed admin routes | 10+ |
31
+ | **Code Quality** | Console.log in production, empty catch blocks, TODO/FIXME | 10+ |
32
+
33
+ Every finding includes OWASP Top 10 and CWE compliance mappings.
31
34
 
32
35
  ## Installation
33
36
 
34
37
  ```bash
35
- # Run directly (no install)
38
+ # Run directly (recommended — always latest version)
36
39
  npx xploitscan scan .
37
40
 
38
41
  # Or install globally
@@ -44,105 +47,102 @@ xploitscan scan .
44
47
 
45
48
  ```bash
46
49
  # Scan current directory
47
- xploitscan scan .
50
+ npx xploitscan scan .
48
51
 
49
- # Scan a specific directory
50
- xploitscan scan ./my-project
52
+ # Scan a specific folder
53
+ npx xploitscan scan ./src
51
54
 
52
- # Skip AI analysis (faster, no API key needed)
53
- xploitscan scan . --no-ai
55
+ # JSON output (for scripting/CI)
56
+ npx xploitscan scan . --format json
54
57
 
55
- # JSON output (for CI pipelines)
56
- xploitscan scan . --format json
58
+ # SARIF output (for GitHub Security tab)
59
+ npx xploitscan scan . --format sarif
57
60
 
58
- # SARIF output (for GitHub Code Scanning)
59
- xploitscan scan . --format sarif
61
+ # Scan only changed files vs main branch
62
+ npx xploitscan scan . --diff
60
63
 
61
- # Verbose output (show per-scanner results)
62
- xploitscan scan . -v
64
+ # Watch mode re-scan on file changes
65
+ npx xploitscan scan . --watch
63
66
  ```
64
67
 
65
- ## AI-Powered Analysis
68
+ ## Output Formats
66
69
 
67
- Set your Anthropic API key for deeper, contextual vulnerability analysis:
70
+ | Format | Use Case |
71
+ |--------|----------|
72
+ | `text` | Human-readable terminal output (default) |
73
+ | `json` | Machine-readable JSON with all findings |
74
+ | `sarif` | GitHub Security tab integration |
68
75
 
69
- ```bash
70
- export ANTHROPIC_API_KEY=sk-ant-...
71
- xploitscan scan .
72
- ```
73
-
74
- The AI analyzer understands your code in context and explains vulnerabilities in plain English with specific fix instructions.
76
+ ## GitHub Action
75
77
 
76
- ## CI Integration
77
-
78
- ### GitHub Actions
78
+ Add automated scanning to every PR:
79
79
 
80
80
  ```yaml
81
81
  name: Security Scan
82
82
  on: [push, pull_request]
83
83
 
84
84
  jobs:
85
- xploitscan:
85
+ security:
86
86
  runs-on: ubuntu-latest
87
87
  steps:
88
88
  - uses: actions/checkout@v4
89
- - uses: xploitscan/action@v1
90
- with:
91
- anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
92
- ```
93
-
94
- Results appear in the GitHub Security tab.
95
89
 
96
- ### Any CI
90
+ - name: Run XploitScan
91
+ uses: bgage72590/xploitscan@main
92
+ with:
93
+ path: '.'
94
+ format: 'sarif'
95
+ fail-on: 'critical'
97
96
 
98
- ```bash
99
- npx xploitscan scan . --format sarif --no-ai > results.sarif
97
+ - name: Upload SARIF
98
+ if: always()
99
+ uses: github/codeql-action/upload-sarif@v3
100
+ with:
101
+ sarif_file: xploitscan-results.sarif
100
102
  ```
101
103
 
102
- Exit code is 1 when critical or high severity issues are found.
104
+ Findings appear in the GitHub Security tab as code scanning alerts.
103
105
 
104
106
  ## Configuration
105
107
 
106
- Create a `.xploitscanrc.json` in your project root:
108
+ Create a `.xploitscanrc` file in your project root:
107
109
 
108
110
  ```json
109
111
  {
110
- "exclude": ["tests/**", "scripts/**"],
111
- "ai": true,
112
- "severity": "medium",
113
- "disableRules": ["VC008"]
112
+ "rules": {
113
+ "include": ["VC001-VC131"],
114
+ "exclude": ["VC042"]
115
+ },
116
+ "format": "json",
117
+ "fail-on": "high",
118
+ "ignore": ["node_modules", "dist", ".git"]
114
119
  }
115
120
  ```
116
121
 
117
- ## Optional: Deeper Scanning
122
+ ## Web Dashboard
118
123
 
119
- Install these tools for additional detection coverage:
124
+ Scan via the web at [xploitscan.com](https://xploitscan.com):
120
125
 
121
- ```bash
122
- # Semgrep - 2000+ community security rules
123
- pip install semgrep
126
+ - Drag-and-drop file/ZIP upload
127
+ - GitHub URL scanning
128
+ - Scan history and score trends
129
+ - PDF security reports
130
+ - SOC2/ISO27001 compliance mapping
131
+ - Slack and Discord webhook notifications
124
132
 
125
- # Gitleaks - advanced secret detection
126
- brew install gitleaks
127
- ```
128
-
129
- XploitScan automatically uses them if available.
133
+ **Free**: 5 scans/day, 30 core rules. **Pro** ($29/mo): unlimited scans, all 131 rules, and all dashboard features.
130
134
 
131
- ## Auth & Pro Plan
135
+ ## Supported Languages
132
136
 
133
- ```bash
134
- # Log in to sync scan history
135
- xploitscan auth login
137
+ JavaScript, TypeScript, Python, Ruby, Go, Rust, Java, PHP, Swift, Kotlin, C#, Dart, C/C++, and configuration files (Dockerfile, Terraform, Kubernetes, GitHub Actions, .env).
136
138
 
137
- # Check your plan
138
- xploitscan auth whoami
139
-
140
- # Upgrade to Pro ($29/mo) for unlimited scans
141
- xploitscan upgrade
142
- ```
139
+ ## Links
143
140
 
144
- Free plan: 3 scans/day. Pro: unlimited scans, scan history, team features.
141
+ - **Website**: [xploitscan.com](https://xploitscan.com)
142
+ - **Documentation**: [xploitscan.com/docs](https://xploitscan.com/docs)
143
+ - **Changelog**: [xploitscan.com/changelog](https://xploitscan.com/changelog)
144
+ - **Email**: admin@xploitscan.com
145
145
 
146
146
  ## License
147
147
 
148
- MIT
148
+ MIT -- [Cipherline LLC](https://xploitscan.com)
package/dist/index.js CHANGED
@@ -6011,10 +6011,16 @@ async function scanCommand(directory, options) {
6011
6011
  const config = await loadConfig(dir);
6012
6012
  const useAI = (options.aiAnalysis ?? config.ai ?? true) && !!process.env.ANTHROPIC_API_KEY;
6013
6013
  const isSilent = format !== "terminal";
6014
+ let tier = "free";
6015
+ let userPlan = "anonymous";
6014
6016
  if (isAuthenticated()) {
6015
6017
  const usage = await checkUsage();
6018
+ userPlan = usage.plan;
6019
+ if (usage.plan === "pro") {
6020
+ tier = "pro";
6021
+ }
6016
6022
  if (!usage.allowed) {
6017
- console.log(chalk2.red("\nDaily scan limit reached (3/3 scans used)."));
6023
+ console.log(chalk2.red("\nDaily scan limit reached."));
6018
6024
  console.log(chalk2.yellow("Upgrade to Pro for unlimited scans: ") + chalk2.bold("xploitscan upgrade"));
6019
6025
  console.log(chalk2.gray(`Resets tomorrow. Plan: ${usage.plan}
6020
6026
  `));
@@ -6065,7 +6071,7 @@ async function scanCommand(directory, options) {
6065
6071
  fileContentsForAnalysis.push({ path: filePath, content });
6066
6072
  const astCtx = buildASTContext(content, filePath);
6067
6073
  if (astCtx.isScannerFile) continue;
6068
- const findings = runCustomRules(content, filePath, config.disableRules);
6074
+ const findings = runCustomRules(content, filePath, config.disableRules, tier);
6069
6075
  for (const f of findings) {
6070
6076
  if (astCtx.isTestFile) {
6071
6077
  f.confidence = "low";
@@ -6205,6 +6211,15 @@ async function scanCommand(directory, options) {
6205
6211
  renderTerminalReport(result, fileContentsForAnalysis);
6206
6212
  break;
6207
6213
  }
6214
+ if (tier === "free" && !isSilent) {
6215
+ console.log("");
6216
+ if (userPlan === "anonymous") {
6217
+ console.log(chalk2.gray(" Scanned with 30 free rules.") + chalk2.cyan(" Log in to unlock all 131 rules \u2192") + chalk2.bold(" xploitscan auth login"));
6218
+ } else {
6219
+ console.log(chalk2.gray(" Scanned with 30 rules.") + chalk2.cyan(" Upgrade to Pro for all 131 rules \u2192") + chalk2.bold(" xploitscan upgrade"));
6220
+ }
6221
+ console.log("");
6222
+ }
6208
6223
  if (isAuthenticated()) {
6209
6224
  await Promise.allSettled([
6210
6225
  incrementUsage(),
@@ -6417,7 +6432,7 @@ Open this URL in your browser to log in:`));
6417
6432
  var program = new Command();
6418
6433
  program.name("xploitscan").description(
6419
6434
  "AI security scanner for vibe-coded apps. Find vulnerabilities before attackers do."
6420
- ).version("0.7.0");
6435
+ ).version("0.8.0");
6421
6436
  program.command("scan").description("Scan a directory for security vulnerabilities").argument("[directory]", "Directory to scan", ".").option("--no-ai", "Skip AI-powered analysis").option("-f, --format <format>", "Output format: terminal, json, sarif", "terminal").option("-v, --verbose", "Show detailed output", false).option("--diff [base]", "Scan only files changed vs base branch (default: main)").option("-w, --watch", "Watch for file changes and re-scan automatically", false).action(async (directory, opts) => {
6422
6437
  await scanCommand(directory, {
6423
6438
  directory,