tanviet12/vbsec/vbs-scan-security

Claude Code and agent skill by tanviet12/vbsec

Trust tier 2
  • community
  • ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when scanning code for security vulnerabilities. Use when user says "scan security", "kiểm tra bảo mật", "security audit", "review security", or invokes `/vbs-scan-security`. Auto-delegates to sub-agents for large scans (>20 main-language files OR >30 total OR >14 days). Outputs bilingual reports (vi/en). Optional `--auto-fix` (agentic patch + verify loop) and `--sca` (live CVE lookup via OSV.dev).

Install

npx vskill@latest install tanviet12/vbsec/vbs-scan-security

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

The same SKILL.md was published earlier as tanviet12/vbsec/vbs-scan-security.

vbsec — Security Scanner cho Vibe Coders

Quét lỗ hổng bảo mật cho code do AI sinh ra (vibe code). Bộ skill có 30 rule quét (01–21 lỗi kinh điển, 23–31 lỗi của app SaaS: AI / MCP, cô lập tenant, phân quyền lệch giữa các đường, lộ dữ liệu quá mức, logic trạng thái / tiền, log chứa dữ liệu nhạy, vòng đời phiên, tiêu hao tài nguyên) + rule 22 tuỳ chọn (--sca). Lỗi có đường khai thác mà ngoài danh mục vẫn là finding (OTHER-CWE-<n>), tính vào kết luận. Kiến trúc SMALL/LARGE mode, cross-language mặc định + overlay chuyên sâu cho Go, PHP, TypeScript, Python, .NET, Dart.

Phiên bản: xem file `VERSION`. Mọi báo cáo in vbsec_version + commit của skill.

Public repo: https://github.com/tanviet12/vbsec
License: MIT (sẽ chốt khi public)

Invocation

CommandScopeMô tả
/vbs-scan-securityToàn repo (default từ v0.3)Mặc định — quét toàn bộ repo
/vbs-scan-security allToàn repoAlias explicit của default
/vbs-scan-security uncommittedUncommitted changesQuét staged + unstaged (cần explicit từ v0.3)
/vbs-scan-security diffUncommitted changesAlias intuitive cho uncommitted
/vbs-scan-security stagedStaged files onlyPre-commit scan
/vbs-scan-security commit within XdaysRecent commitsQuét commit X ngày gần đây
/vbs-scan-security commit id <sha>Specific commitQuét 1 commit
/vbs-scan-security pr id <number>Pull requestQuét PR diff (cần gh CLI)
/vbs-scan-security range <a>..<b>Khoảng commitQuét file đổi giữa 2 ref (vd v1.2.0..HEAD cho cổng phát hành), đọc snapshot tại <b>

v0.3 change: Default scope đổi từ uncommitted → all. Non-tech user lần đầu chạy không bị confused bởi report rỗng. Để giữ behavior cũ, dùng uncommitted hoặc diff explicit.

Lựa chọn ngôn ngữ output (thêm vào bất kỳ scope nào):

  • lang=vi hoặc --vi → Tiếng Việt (mặc định)
  • lang=en hoặc --en → English

Cờ tùy chọn (v0.7+, mặc định TẮT — thêm vào bất kỳ scope nào):

FlagAliasMô tả
--scascaTra cứu CVE live qua OSV.dev cho dependency (6 ecosystem: NuGet/Go/npm/Composer/PyPI/Pub). Xem `references/dependency-scan.md`. Cần network.
--auto-fixauto-fixTự sinh patch (unified diff) cho finding CRITICAL/HIGH, verify bằng build command, revert nếu fail. Xem `workflows/auto-fix.md`. Ghi đè file nguồn — cần git repo, khuyến nghị working tree sạch trước khi chạy.
--context <file>—Nạp luật dự án (bất biến nghiệp vụ, vai, đối tượng nhạy, kênh agent) để soát lỗi logic / phân quyền theo đúng luật. Không truyền mà repo có .vbsec/context.md → tự nạp file đó. Mẫu: `references/project-context.md`.
--run-tests—Chỉ có tác dụng cùng --auto-fix: cho phép chạy test của project (go test ./..., dotnet test) để verify bản nâng version dependency. Test có thể đụng hệ thống thật (DB, dịch vụ trong .env) — chỉ bật khi test an toàn. Không bật → bump dependency chỉ là gợi ý patch.

Ví dụ:

/vbs-scan-security pr id 42 lang=en
/vbs-scan-security staged --vi
/vbs-scan-security commit within 7days
/vbs-scan-security all --sca
/vbs-scan-security uncommitted --auto-fix
/vbs-scan-security all --sca --auto-fix
/vbs-scan-security range v1.4.0..HEAD --context docs/luat-bao-mat.md

CRITICAL: Cách dùng skill này (cho LLM agent)

Các pattern bash/grep trong rule files là VÍ DỤ minh họa, KHÔNG phải lệnh chạy literal.

Nguyên tắc
  1. Lý luận, không pattern-match thuần — Hiểu intent bảo mật đằng sau mỗi check, không chỉ tìm chuỗi
  2. Dùng tool phù hợp — Grep, Read, Glob thay vì bash grep/find
  3. Đọc context đầy đủ — Khi gặp pattern, READ hàm xung quanh để hiểu đây có thực sự là lỗ hổng không
  4. Phân loại trust level — Một query có format chuỗi chỉ nguy hiểm nếu data ghép vào là L1 (untrusted)
Phân loại nguồn dữ liệu (L1–L4)
LevelNguồnTin cậyVí dụ
L1Input người dùngKHÔNG tinreq.body, $_GET, request.params, HTTP header, file upload
L2DatabaseBán tinGiá trị từ DB nhưng nguồn gốc là user input
L3Code nội bộTinHardcoded strings, config keys, computed values
L4Hệ thốngTinEnv vars, file paths nội bộ, framework constants

Key insight: f"SELECT ... {x}" SAFE nếu x là L3+. CRITICAL nếu x là L1 không qua parameterization.

Tham khảo chi tiết: `references/data-flow-classification.md`.


Workflow

┌─────────────────────────────────────────────────────────────────────┐
│ vbsec SCAN WORKFLOW │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ [Step 0] Parse args │
│ ├─ Scope (uncommitted/staged/commit/pr/range/all) │
│ ├─ --context (luật dự án) hoặc .vbsec/context.md │
│ └─ Output lang (vi default | en) │
│ ↓ │
│ [Step 1] Gather files (git) │
│ ↓ │
│ [Step 2] Detect primary code language │
│ └─ Đọc references/language-detection.md │
│ ↓ │
│ [Step 3] Route by size │
│ ┌──────────────────┬──────────────────┐ │
│ │ SMALL (inline) │ LARGE (delegate)│ │
│ │ ≤20 main+≤30tot │ >20 OR >30 OR │ │
│ │ AND ≤14d │ >14 ngày │ │
│ └─────┬────────────┴─────────┬────────┘ │
│ ↓ ↓ │
│ workflows/small- workflows/large- │
│ review.md review.md │
│ │
│ Both apply: │
│ - rules/generic/*.md (30 rule; 23–25 nạp khi repo có dấu hiệu) │
│ - rules/languages/<detected>/*.md (override nếu trùng tên) │
│ ↓ │
│ [Step 4b] SCA scan (optional — cần $SCA=true) │
│ └─ references/dependency-scan.md → rule 22 VULNERABLE-DEPENDENCY │
│ ↓ │
│ [Step 4c] Auto-fix (optional — cần $AUTO_FIX=true) │
│ └─ workflows/auto-fix.md → patch + verify + retry loop │
│ (chạy TRƯỚC khi render report cuối, để patch_status kịp vào │
│ JSON summary + section Auto-fix trong report) │
│ ↓ │
│ [Step 5] Generate report │
│ ├─ Markdown report (theo lang chọn, gồm cả section Auto-fix) │
│ └─ JSON summary (canonical EN, ở cuối, gồm patch_status) │
│ │
└─────────────────────────────────────────────────────────────────────┘

Step 0: Parse Arguments

Dùng Bash tool ĐÚNG MỘT LẦN cho step này (gather files là việc của git, không phải reasoning).

bash
ARGS="${ARGUMENTS:-}"
# 0) Detect git availability (KHÔNG bắt buộc có git — v0.5.1+)
IS_GIT_REPO=true
git rev-parse --is-inside-work-tree >/dev/null 2>&1 || IS_GIT_REPO=false
# 1) Extract lang flag (default vi)
LANG="vi"
if echo "$ARGS" | grep -qE 'lang=en|--en|\ben\b'; then LANG="en"; fi
if echo "$ARGS" | grep -qE 'lang=vi|--vi'; then LANG="vi"; fi
# 1b) Extract --auto-fix / --sca flags (v0.7+, default off) + scope.
# Duyệt từng từ thay vì sed \b — BSD sed trên macOS không hỗ trợ \b.
AUTO_FIX=false
SCA=false
RUN_TESTS=false
CONTEXT_FILE=""
SCOPE_WORDS=""
EXPECT_CONTEXT=false
set -f # không expand glob khi tách từ
for w in $ARGS; do
if [ "$EXPECT_CONTEXT" = true ]; then CONTEXT_FILE="$w"; EXPECT_CONTEXT=false; continue; fi
case "$w" in
--auto-fix|auto-fix) AUTO_FIX=true ;;
--sca|sca) SCA=true ;;
--run-tests) RUN_TESTS=true ;;
--context) EXPECT_CONTEXT=true ;;
--context=*) CONTEXT_FILE="${w#--context=}" ;;
lang=vi|lang=en|--vi|--en) ;;
*) SCOPE_WORDS="$SCOPE_WORDS $w" ;;
esac
done
set +f
# Luật dự án: cờ --context thắng; không có thì tự nhận .vbsec/context.md
[ -z "$CONTEXT_FILE" ] && [ -f .vbsec/context.md ] && CONTEXT_FILE=".vbsec/context.md"
if [ -n "$CONTEXT_FILE" ] && [ ! -e "$CONTEXT_FILE" ]; then echo "Context file not found: $CONTEXT_FILE"; exit 1; fi
# Phiên bản skill (in vào header + JSON summary). Thay <skill-dir> = thư mục chứa SKILL.md này.
SKILL_DIR="<skill-dir>"
VBSEC_VERSION=$(cat "$SKILL_DIR/VERSION" 2>/dev/null || echo unknown)
VBSEC_COMMIT=$(git -C "$SKILL_DIR" rev-parse --short HEAD 2>/dev/null || echo unknown)
# 2) Scope = các từ còn lại (đã bỏ lang + auto-fix/sca)
SCOPE=$(echo "$SCOPE_WORDS" | xargs)

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
206
Repository forks
92
7-day trend score
27

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Extension points

  • hookPre/post lifecycle hooks

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/tanviet12/vbsec/vbs-scan-security/badge)](https://verified-skill.com/skills/tanviet12/vbsec/vbs-scan-security)

Something wrong with this skill or its page? Tell us.