vibesec 0.1.0__tar.gz
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.
- vibesec-0.1.0/LICENSE +21 -0
- vibesec-0.1.0/PKG-INFO +287 -0
- vibesec-0.1.0/README.md +243 -0
- vibesec-0.1.0/pyproject.toml +35 -0
- vibesec-0.1.0/setup.cfg +4 -0
- vibesec-0.1.0/tests/test_rules.py +282 -0
- vibesec-0.1.0/vibesec/__init__.py +2 -0
- vibesec-0.1.0/vibesec/cli.py +37 -0
- vibesec-0.1.0/vibesec/fixgen.py +40 -0
- vibesec-0.1.0/vibesec/reporter.py +102 -0
- vibesec-0.1.0/vibesec/rules/__init__.py +23 -0
- vibesec-0.1.0/vibesec/rules/auth_routes.py +67 -0
- vibesec-0.1.0/vibesec/rules/cors.py +74 -0
- vibesec-0.1.0/vibesec/rules/jwt.py +52 -0
- vibesec-0.1.0/vibesec/rules/packages.py +83 -0
- vibesec-0.1.0/vibesec/rules/rls.py +51 -0
- vibesec-0.1.0/vibesec/rules/roles.py +58 -0
- vibesec-0.1.0/vibesec/rules/secrets.py +59 -0
- vibesec-0.1.0/vibesec/rules/sourcemaps.py +66 -0
- vibesec-0.1.0/vibesec/rules/webhooks.py +77 -0
- vibesec-0.1.0/vibesec/rules/xss.py +56 -0
- vibesec-0.1.0/vibesec/scanner.py +25 -0
- vibesec-0.1.0/vibesec/utils.py +31 -0
- vibesec-0.1.0/vibesec.egg-info/PKG-INFO +287 -0
- vibesec-0.1.0/vibesec.egg-info/SOURCES.txt +27 -0
- vibesec-0.1.0/vibesec.egg-info/dependency_links.txt +1 -0
- vibesec-0.1.0/vibesec.egg-info/entry_points.txt +2 -0
- vibesec-0.1.0/vibesec.egg-info/requires.txt +5 -0
- vibesec-0.1.0/vibesec.egg-info/top_level.txt +1 -0
vibesec-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ayush Khati
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
vibesec-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: vibesec
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Security scanner for AI-generated code
|
|
5
|
+
Author-email: Ayush Khati <ayushiskhati305@gmail.com>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 Ayush Khati
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://github.com/AyushkhatiDev/vibesec
|
|
29
|
+
Project-URL: Bug Tracker, https://github.com/AyushkhatiDev/vibesec/issues
|
|
30
|
+
Classifier: Programming Language :: Python :: 3
|
|
31
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
32
|
+
Classifier: Operating System :: OS Independent
|
|
33
|
+
Classifier: Topic :: Security
|
|
34
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
35
|
+
Requires-Python: >=3.8
|
|
36
|
+
Description-Content-Type: text/markdown
|
|
37
|
+
License-File: LICENSE
|
|
38
|
+
Requires-Dist: click>=8.0
|
|
39
|
+
Requires-Dist: rich>=13.0
|
|
40
|
+
Requires-Dist: requests>=2.28
|
|
41
|
+
Requires-Dist: groq>=0.4.0
|
|
42
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
43
|
+
Dynamic: license-file
|
|
44
|
+
|
|
45
|
+
# 🔒 VibeSec
|
|
46
|
+
|
|
47
|
+
**Security scanner for AI-generated code.**
|
|
48
|
+
|
|
49
|
+
[](https://badge.fury.io/py/vibesec)
|
|
50
|
+
[](https://opensource.org/licenses/MIT)
|
|
51
|
+
[](https://www.python.org/downloads/)
|
|
52
|
+
[](https://github.com/AyushkhatiDev/vibesec)
|
|
53
|
+
|
|
54
|
+
45% of AI-generated code ships with critical vulnerabilities. Cursor, Claude Code, Bolt, and Lovable generate insecure patterns that existing tools miss. VibeSec catches them before you deploy.
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
$ vibesec scan ./my-cursor-app
|
|
58
|
+
|
|
59
|
+
VibeSec v0.1.0 — AI-Generated Code Security Scanner
|
|
60
|
+
|
|
61
|
+
● CRITICAL 7 findings
|
|
62
|
+
● HIGH 2 findings
|
|
63
|
+
|
|
64
|
+
CRITICAL — Hardcoded Secret
|
|
65
|
+
File: src/lib/supabase.ts Line: 12
|
|
66
|
+
Found: SUPABASE_SERVICE_KEY hardcoded in source code
|
|
67
|
+
Fix: Move to environment variables. Never commit secrets to git.
|
|
68
|
+
|
|
69
|
+
CRITICAL — Supabase RLS Disabled
|
|
70
|
+
File: supabase/migrations/001_init.sql Line: 34
|
|
71
|
+
Found: ALTER TABLE users DISABLE ROW LEVEL SECURITY
|
|
72
|
+
Fix: Enable RLS + add user isolation policies.
|
|
73
|
+
|
|
74
|
+
9 findings in ./my-cursor-app
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Why VibeSec
|
|
80
|
+
|
|
81
|
+
Existing tools like Semgrep, Snyk, and CodeQL are great — but they were built for human-written code. AI tools generate specific anti-patterns that these scanners miss:
|
|
82
|
+
|
|
83
|
+
| Pattern | Semgrep | Snyk | VibeSec |
|
|
84
|
+
|---|---|---|---|
|
|
85
|
+
| Hardcoded secrets | ✓ | ✓ | ✓ |
|
|
86
|
+
| Supabase RLS disabled | ✗ | ✗ | ✓ |
|
|
87
|
+
| Hallucinated npm packages | ✗ | ✗ | ✓ |
|
|
88
|
+
| Missing auth on scaffolded routes | Partial | ✗ | ✓ |
|
|
89
|
+
| Source map exposure in build config | ✗ | ✗ | ✓ |
|
|
90
|
+
| AI-specific JWT misuse | ✗ | ✗ | ✓ |
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Install
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
pip install vibesec
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Usage
|
|
103
|
+
|
|
104
|
+
**Scan a directory:**
|
|
105
|
+
```bash
|
|
106
|
+
vibesec scan ./my-project
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**Scan and get AI-powered fix suggestions:**
|
|
110
|
+
```bash
|
|
111
|
+
vibesec scan ./my-project --fix
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Export results as JSON (for CI/CD):**
|
|
115
|
+
```bash
|
|
116
|
+
vibesec scan ./my-project --output json
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**Filter by severity:**
|
|
120
|
+
```bash
|
|
121
|
+
vibesec scan ./my-project --severity critical
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**Ignore specific checks:**
|
|
125
|
+
```bash
|
|
126
|
+
vibesec scan ./my-project --ignore rls,cors
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## What VibeSec Checks
|
|
132
|
+
|
|
133
|
+
### 🔴 CRITICAL
|
|
134
|
+
|
|
135
|
+
**1. Hardcoded Secrets**
|
|
136
|
+
API keys, passwords, tokens, and database URLs hardcoded in source files. LLMs replicate tutorial patterns where secrets are hardcoded.
|
|
137
|
+
|
|
138
|
+
```python
|
|
139
|
+
# VibeSec catches this
|
|
140
|
+
api_key = "sk-abc123..."
|
|
141
|
+
SUPABASE_SERVICE_KEY = "eyJhbGci..."
|
|
142
|
+
stripe_secret = "sk_live_..."
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**2. Supabase RLS Disabled**
|
|
146
|
+
Row Level Security disabled — any authenticated user can read or modify all data. LLMs skip RLS to make queries work quickly in scaffolding.
|
|
147
|
+
|
|
148
|
+
```sql
|
|
149
|
+
-- VibeSec catches this
|
|
150
|
+
ALTER TABLE users DISABLE ROW LEVEL SECURITY;
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### 🟡 HIGH
|
|
154
|
+
|
|
155
|
+
**3. Missing Route Authentication**
|
|
156
|
+
Admin and sensitive API routes scaffolded without authentication middleware. LLMs build the happy path without thinking about access control.
|
|
157
|
+
|
|
158
|
+
**4. Hallucinated Packages**
|
|
159
|
+
npm packages that don't exist — a typosquatting attack surface. LLMs generate plausible-sounding package names that aren't real.
|
|
160
|
+
|
|
161
|
+
```json
|
|
162
|
+
// VibeSec catches this
|
|
163
|
+
"react-auth-handler": "^1.0.0",
|
|
164
|
+
"supabase-helpers": "^2.1.0"
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**5. Source Map Exposure**
|
|
168
|
+
Build config exposes full source code via `.map` files in production.
|
|
169
|
+
|
|
170
|
+
### 🟠 MEDIUM
|
|
171
|
+
|
|
172
|
+
**6. Unsafe JWT Handling** — JWT decoded without verification, or `none` algorithm accepted
|
|
173
|
+
|
|
174
|
+
**7. dangerouslySetInnerHTML** — Direct HTML injection without sanitization
|
|
175
|
+
|
|
176
|
+
**8. Client-Side Role Trust** — Admin checks done using `localStorage` values
|
|
177
|
+
|
|
178
|
+
**9. Missing Webhook Verification** — Stripe/GitHub webhooks without signature check
|
|
179
|
+
|
|
180
|
+
**10. Permissive CORS** — Wildcard CORS with credentials enabled
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## GitHub Actions Integration
|
|
185
|
+
|
|
186
|
+
Add VibeSec to your CI/CD pipeline:
|
|
187
|
+
|
|
188
|
+
```yaml
|
|
189
|
+
# .github/workflows/vibesec.yml
|
|
190
|
+
name: VibeSec Security Scan
|
|
191
|
+
|
|
192
|
+
on: [push, pull_request]
|
|
193
|
+
|
|
194
|
+
jobs:
|
|
195
|
+
security:
|
|
196
|
+
runs-on: ubuntu-latest
|
|
197
|
+
steps:
|
|
198
|
+
- uses: actions/checkout@v3
|
|
199
|
+
- uses: actions/setup-python@v4
|
|
200
|
+
with:
|
|
201
|
+
python-version: '3.11'
|
|
202
|
+
- name: Install VibeSec
|
|
203
|
+
run: pip install vibesec
|
|
204
|
+
- name: Run Security Scan
|
|
205
|
+
run: vibesec scan . --output json --severity high
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## Development
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
git clone https://github.com/AyushkhatiDev/vibesec
|
|
214
|
+
cd vibesec
|
|
215
|
+
python -m venv venv
|
|
216
|
+
source venv/bin/activate
|
|
217
|
+
pip install -e ".[dev]"
|
|
218
|
+
pytest tests/
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## Contributing
|
|
224
|
+
|
|
225
|
+
VibeSec is open source and contributions are welcome.
|
|
226
|
+
|
|
227
|
+
**Adding a new rule:**
|
|
228
|
+
1. Create `vibesec/rules/your_rule.py`
|
|
229
|
+
2. Implement `check_your_rule(file_path, content) -> list[dict]`
|
|
230
|
+
3. Register it in `vibesec/rules/__init__.py`
|
|
231
|
+
4. Add test cases in `tests/corpus/`
|
|
232
|
+
5. Open a PR
|
|
233
|
+
|
|
234
|
+
Each finding must return:
|
|
235
|
+
```python
|
|
236
|
+
{
|
|
237
|
+
"rule": "Rule Name",
|
|
238
|
+
"severity": "CRITICAL|HIGH|MEDIUM|LOW",
|
|
239
|
+
"file": file_path,
|
|
240
|
+
"line": line_number,
|
|
241
|
+
"message": "What was found",
|
|
242
|
+
"fix_hint": "How to fix it",
|
|
243
|
+
"code_snippet": "offending line"
|
|
244
|
+
}
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for full guide.
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## Roadmap
|
|
252
|
+
|
|
253
|
+
- [x] Secrets detection
|
|
254
|
+
- [x] Supabase RLS checker
|
|
255
|
+
- [x] Missing auth on routes
|
|
256
|
+
- [x] Hallucinated package detector
|
|
257
|
+
- [x] Source map exposure
|
|
258
|
+
- [ ] JWT misuse rules
|
|
259
|
+
- [ ] dangerouslySetInnerHTML
|
|
260
|
+
- [ ] Client-side role trust
|
|
261
|
+
- [ ] Webhook verification
|
|
262
|
+
- [ ] Permissive CORS
|
|
263
|
+
- [ ] GitHub Action marketplace listing
|
|
264
|
+
- [ ] Web app (paste URL → get report)
|
|
265
|
+
- [ ] SARIF output for GitHub Security tab
|
|
266
|
+
- [ ] VS Code extension
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## Built By
|
|
271
|
+
|
|
272
|
+
[Ayush Khati](https://github.com/AyushkhatiDev) — BCA student building real tools for real problems.
|
|
273
|
+
|
|
274
|
+
Found a bug? [Open an issue](https://github.com/AyushkhatiDev/vibesec/issues).
|
|
275
|
+
Want a rule added? [Start a discussion](https://github.com/AyushkhatiDev/vibesec/discussions).
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## License
|
|
280
|
+
|
|
281
|
+
MIT — free to use, modify, and distribute.
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
<p align="center">
|
|
286
|
+
<sub>Built because 45% of vibe-coded apps ship with critical vulnerabilities. Someone had to fix that.</sub>
|
|
287
|
+
</p>
|
vibesec-0.1.0/README.md
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
# 🔒 VibeSec
|
|
2
|
+
|
|
3
|
+
**Security scanner for AI-generated code.**
|
|
4
|
+
|
|
5
|
+
[](https://badge.fury.io/py/vibesec)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://www.python.org/downloads/)
|
|
8
|
+
[](https://github.com/AyushkhatiDev/vibesec)
|
|
9
|
+
|
|
10
|
+
45% of AI-generated code ships with critical vulnerabilities. Cursor, Claude Code, Bolt, and Lovable generate insecure patterns that existing tools miss. VibeSec catches them before you deploy.
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
$ vibesec scan ./my-cursor-app
|
|
14
|
+
|
|
15
|
+
VibeSec v0.1.0 — AI-Generated Code Security Scanner
|
|
16
|
+
|
|
17
|
+
● CRITICAL 7 findings
|
|
18
|
+
● HIGH 2 findings
|
|
19
|
+
|
|
20
|
+
CRITICAL — Hardcoded Secret
|
|
21
|
+
File: src/lib/supabase.ts Line: 12
|
|
22
|
+
Found: SUPABASE_SERVICE_KEY hardcoded in source code
|
|
23
|
+
Fix: Move to environment variables. Never commit secrets to git.
|
|
24
|
+
|
|
25
|
+
CRITICAL — Supabase RLS Disabled
|
|
26
|
+
File: supabase/migrations/001_init.sql Line: 34
|
|
27
|
+
Found: ALTER TABLE users DISABLE ROW LEVEL SECURITY
|
|
28
|
+
Fix: Enable RLS + add user isolation policies.
|
|
29
|
+
|
|
30
|
+
9 findings in ./my-cursor-app
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Why VibeSec
|
|
36
|
+
|
|
37
|
+
Existing tools like Semgrep, Snyk, and CodeQL are great — but they were built for human-written code. AI tools generate specific anti-patterns that these scanners miss:
|
|
38
|
+
|
|
39
|
+
| Pattern | Semgrep | Snyk | VibeSec |
|
|
40
|
+
|---|---|---|---|
|
|
41
|
+
| Hardcoded secrets | ✓ | ✓ | ✓ |
|
|
42
|
+
| Supabase RLS disabled | ✗ | ✗ | ✓ |
|
|
43
|
+
| Hallucinated npm packages | ✗ | ✗ | ✓ |
|
|
44
|
+
| Missing auth on scaffolded routes | Partial | ✗ | ✓ |
|
|
45
|
+
| Source map exposure in build config | ✗ | ✗ | ✓ |
|
|
46
|
+
| AI-specific JWT misuse | ✗ | ✗ | ✓ |
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Install
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pip install vibesec
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Usage
|
|
59
|
+
|
|
60
|
+
**Scan a directory:**
|
|
61
|
+
```bash
|
|
62
|
+
vibesec scan ./my-project
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**Scan and get AI-powered fix suggestions:**
|
|
66
|
+
```bash
|
|
67
|
+
vibesec scan ./my-project --fix
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Export results as JSON (for CI/CD):**
|
|
71
|
+
```bash
|
|
72
|
+
vibesec scan ./my-project --output json
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**Filter by severity:**
|
|
76
|
+
```bash
|
|
77
|
+
vibesec scan ./my-project --severity critical
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**Ignore specific checks:**
|
|
81
|
+
```bash
|
|
82
|
+
vibesec scan ./my-project --ignore rls,cors
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## What VibeSec Checks
|
|
88
|
+
|
|
89
|
+
### 🔴 CRITICAL
|
|
90
|
+
|
|
91
|
+
**1. Hardcoded Secrets**
|
|
92
|
+
API keys, passwords, tokens, and database URLs hardcoded in source files. LLMs replicate tutorial patterns where secrets are hardcoded.
|
|
93
|
+
|
|
94
|
+
```python
|
|
95
|
+
# VibeSec catches this
|
|
96
|
+
api_key = "sk-abc123..."
|
|
97
|
+
SUPABASE_SERVICE_KEY = "eyJhbGci..."
|
|
98
|
+
stripe_secret = "sk_live_..."
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**2. Supabase RLS Disabled**
|
|
102
|
+
Row Level Security disabled — any authenticated user can read or modify all data. LLMs skip RLS to make queries work quickly in scaffolding.
|
|
103
|
+
|
|
104
|
+
```sql
|
|
105
|
+
-- VibeSec catches this
|
|
106
|
+
ALTER TABLE users DISABLE ROW LEVEL SECURITY;
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### 🟡 HIGH
|
|
110
|
+
|
|
111
|
+
**3. Missing Route Authentication**
|
|
112
|
+
Admin and sensitive API routes scaffolded without authentication middleware. LLMs build the happy path without thinking about access control.
|
|
113
|
+
|
|
114
|
+
**4. Hallucinated Packages**
|
|
115
|
+
npm packages that don't exist — a typosquatting attack surface. LLMs generate plausible-sounding package names that aren't real.
|
|
116
|
+
|
|
117
|
+
```json
|
|
118
|
+
// VibeSec catches this
|
|
119
|
+
"react-auth-handler": "^1.0.0",
|
|
120
|
+
"supabase-helpers": "^2.1.0"
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**5. Source Map Exposure**
|
|
124
|
+
Build config exposes full source code via `.map` files in production.
|
|
125
|
+
|
|
126
|
+
### 🟠 MEDIUM
|
|
127
|
+
|
|
128
|
+
**6. Unsafe JWT Handling** — JWT decoded without verification, or `none` algorithm accepted
|
|
129
|
+
|
|
130
|
+
**7. dangerouslySetInnerHTML** — Direct HTML injection without sanitization
|
|
131
|
+
|
|
132
|
+
**8. Client-Side Role Trust** — Admin checks done using `localStorage` values
|
|
133
|
+
|
|
134
|
+
**9. Missing Webhook Verification** — Stripe/GitHub webhooks without signature check
|
|
135
|
+
|
|
136
|
+
**10. Permissive CORS** — Wildcard CORS with credentials enabled
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## GitHub Actions Integration
|
|
141
|
+
|
|
142
|
+
Add VibeSec to your CI/CD pipeline:
|
|
143
|
+
|
|
144
|
+
```yaml
|
|
145
|
+
# .github/workflows/vibesec.yml
|
|
146
|
+
name: VibeSec Security Scan
|
|
147
|
+
|
|
148
|
+
on: [push, pull_request]
|
|
149
|
+
|
|
150
|
+
jobs:
|
|
151
|
+
security:
|
|
152
|
+
runs-on: ubuntu-latest
|
|
153
|
+
steps:
|
|
154
|
+
- uses: actions/checkout@v3
|
|
155
|
+
- uses: actions/setup-python@v4
|
|
156
|
+
with:
|
|
157
|
+
python-version: '3.11'
|
|
158
|
+
- name: Install VibeSec
|
|
159
|
+
run: pip install vibesec
|
|
160
|
+
- name: Run Security Scan
|
|
161
|
+
run: vibesec scan . --output json --severity high
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## Development
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
git clone https://github.com/AyushkhatiDev/vibesec
|
|
170
|
+
cd vibesec
|
|
171
|
+
python -m venv venv
|
|
172
|
+
source venv/bin/activate
|
|
173
|
+
pip install -e ".[dev]"
|
|
174
|
+
pytest tests/
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## Contributing
|
|
180
|
+
|
|
181
|
+
VibeSec is open source and contributions are welcome.
|
|
182
|
+
|
|
183
|
+
**Adding a new rule:**
|
|
184
|
+
1. Create `vibesec/rules/your_rule.py`
|
|
185
|
+
2. Implement `check_your_rule(file_path, content) -> list[dict]`
|
|
186
|
+
3. Register it in `vibesec/rules/__init__.py`
|
|
187
|
+
4. Add test cases in `tests/corpus/`
|
|
188
|
+
5. Open a PR
|
|
189
|
+
|
|
190
|
+
Each finding must return:
|
|
191
|
+
```python
|
|
192
|
+
{
|
|
193
|
+
"rule": "Rule Name",
|
|
194
|
+
"severity": "CRITICAL|HIGH|MEDIUM|LOW",
|
|
195
|
+
"file": file_path,
|
|
196
|
+
"line": line_number,
|
|
197
|
+
"message": "What was found",
|
|
198
|
+
"fix_hint": "How to fix it",
|
|
199
|
+
"code_snippet": "offending line"
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for full guide.
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Roadmap
|
|
208
|
+
|
|
209
|
+
- [x] Secrets detection
|
|
210
|
+
- [x] Supabase RLS checker
|
|
211
|
+
- [x] Missing auth on routes
|
|
212
|
+
- [x] Hallucinated package detector
|
|
213
|
+
- [x] Source map exposure
|
|
214
|
+
- [ ] JWT misuse rules
|
|
215
|
+
- [ ] dangerouslySetInnerHTML
|
|
216
|
+
- [ ] Client-side role trust
|
|
217
|
+
- [ ] Webhook verification
|
|
218
|
+
- [ ] Permissive CORS
|
|
219
|
+
- [ ] GitHub Action marketplace listing
|
|
220
|
+
- [ ] Web app (paste URL → get report)
|
|
221
|
+
- [ ] SARIF output for GitHub Security tab
|
|
222
|
+
- [ ] VS Code extension
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## Built By
|
|
227
|
+
|
|
228
|
+
[Ayush Khati](https://github.com/AyushkhatiDev) — BCA student building real tools for real problems.
|
|
229
|
+
|
|
230
|
+
Found a bug? [Open an issue](https://github.com/AyushkhatiDev/vibesec/issues).
|
|
231
|
+
Want a rule added? [Start a discussion](https://github.com/AyushkhatiDev/vibesec/discussions).
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## License
|
|
236
|
+
|
|
237
|
+
MIT — free to use, modify, and distribute.
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
<p align="center">
|
|
242
|
+
<sub>Built because 45% of vibe-coded apps ship with critical vulnerabilities. Someone had to fix that.</sub>
|
|
243
|
+
</p>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "vibesec"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
authors = [
|
|
9
|
+
{ name="Ayush Khati", email="ayushiskhati305@gmail.com" }
|
|
10
|
+
]
|
|
11
|
+
description = "Security scanner for AI-generated code"
|
|
12
|
+
readme = "README.md"
|
|
13
|
+
license = { file="LICENSE" }
|
|
14
|
+
requires-python = ">=3.8"
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"License :: OSI Approved :: MIT License",
|
|
18
|
+
"Operating System :: OS Independent",
|
|
19
|
+
"Topic :: Security",
|
|
20
|
+
"Topic :: Software Development :: Quality Assurance",
|
|
21
|
+
]
|
|
22
|
+
dependencies = [
|
|
23
|
+
"click>=8.0",
|
|
24
|
+
"rich>=13.0",
|
|
25
|
+
"requests>=2.28",
|
|
26
|
+
"groq>=0.4.0",
|
|
27
|
+
"python-dotenv>=1.0.0",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
[project.scripts]
|
|
31
|
+
vibesec = "vibesec.cli:main"
|
|
32
|
+
|
|
33
|
+
[project.urls]
|
|
34
|
+
"Homepage" = "https://github.com/AyushkhatiDev/vibesec"
|
|
35
|
+
"Bug Tracker" = "https://github.com/AyushkhatiDev/vibesec/issues"
|
vibesec-0.1.0/setup.cfg
ADDED