本文へ移動
cccskills
無料GitHub で公開

vbs-scan-security

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`. For large scans (>20 main-language files OR >30 total OR >14 days) processes chunks sequentially. Outputs bilingual reports (vi/en). Optional `--auto-fix` (agentic patch + verify loop) and `--sca` (live CVE lookup via OSV.dev).

インストール方法を見る

含まれるファイル(76)

  • SKILL.md22.0 KB
  • references/chunking-strategy.md5.0 KB
  • references/data-flow-classification.md8.4 KB
  • references/dependency-scan.md9.2 KB
  • references/i18n/en.md8.3 KB
  • references/i18n/vi.md9.0 KB
  • references/language-detection.md5.4 KB
  • references/load-rules.sh3.9 KB
  • references/output-format.md24.7 KB
  • references/sub-agent-prompts.md13.6 KB
  • references/validate-report.py6.8 KB
  • rules/generic/01-hardcoded-secret.md5.4 KB
  • rules/generic/02-sql-injection.md5.2 KB
  • rules/generic/03-xss.md4.9 KB
  • rules/generic/04-idor.md5.7 KB
  • rules/generic/05-slopsquatting.md6.1 KB
  • rules/generic/06-brute-force.md6.2 KB
  • rules/generic/07-mass-assignment.md6.3 KB
  • rules/generic/08-insecure-deserialization.md6.3 KB
  • rules/generic/09-ssrf.md6.7 KB
  • rules/generic/10-path-traversal.md6.3 KB
  • rules/generic/11-csrf.md7.4 KB
  • rules/generic/12-broken-access-control.md7.5 KB
  • rules/generic/13-weak-password-hashing.md5.2 KB
  • rules/generic/14-jwt-none-algorithm.md5.3 KB
  • rules/generic/15-cors-misconfig.md5.3 KB
  • rules/generic/16-unrestricted-file-upload.md5.9 KB
  • rules/generic/17-verbose-error-debug-mode.md5.8 KB
  • rules/generic/18-missing-rate-limit.md10.5 KB
  • rules/generic/19-race-condition.md6.4 KB
  • rules/generic/20-outdated-dependency.md7.2 KB
  • rules/generic/21-command-injection.md6.6 KB
  • rules/generic/22-vulnerable-dependency.md5.1 KB
  • rules/languages/dotnet/02-sql-injection.md5.7 KB
  • rules/languages/dotnet/07-mass-assignment.md6.0 KB
  • rules/languages/dotnet/08-insecure-deserialization.md5.7 KB
  • rules/languages/dotnet/17-verbose-error-debug-mode.md5.0 KB
  • rules/languages/dotnet/21-command-injection.md5.3 KB
  • rules/languages/dotnet/README.md1.7 KB
  • rules/languages/go/02-sql-injection.md5.2 KB
  • rules/languages/go/08-insecure-deserialization.md5.0 KB
  • rules/languages/go/09-ssrf.md5.8 KB
  • rules/languages/go/17-verbose-error-debug-mode.md6.1 KB
  • rules/languages/go/21-command-injection.md5.2 KB
  • rules/languages/go/README.md2.7 KB
  • rules/languages/php/02-sql-injection.md5.8 KB
  • rules/languages/php/08-insecure-deserialization.md6.2 KB
  • rules/languages/php/11-csrf.md6.2 KB
  • rules/languages/php/17-verbose-error-debug-mode.md6.5 KB
  • rules/languages/php/21-command-injection.md6.7 KB
  • rules/languages/php/README.md2.9 KB
  • rules/languages/python/02-sql-injection.md7.2 KB
  • rules/languages/python/07-mass-assignment.md7.3 KB
  • rules/languages/python/08-insecure-deserialization.md7.3 KB
  • rules/languages/python/09-ssrf.md7.5 KB
  • rules/languages/python/11-csrf.md7.6 KB
  • rules/languages/python/14-jwt-none-algorithm.md7.5 KB
  • rules/languages/python/15-cors-misconfig.md8.0 KB
  • rules/languages/python/17-verbose-error-debug-mode.md8.4 KB
  • rules/languages/python/21-command-injection.md8.5 KB
  • rules/languages/python/README.md3.4 KB
  • rules/languages/README.md7.9 KB
  • rules/languages/typescript/02-sql-injection.md7.5 KB
  • rules/languages/typescript/03-xss.md6.7 KB
  • rules/languages/typescript/07-mass-assignment.md7.4 KB
  • rules/languages/typescript/08-insecure-deserialization.md7.0 KB
  • rules/languages/typescript/09-ssrf.md7.5 KB
  • rules/languages/typescript/11-csrf.md7.3 KB
  • rules/languages/typescript/14-jwt-none-algorithm.md7.0 KB
  • rules/languages/typescript/15-cors-misconfig.md7.2 KB
  • rules/languages/typescript/17-verbose-error-debug-mode.md7.2 KB
  • rules/languages/typescript/21-command-injection.md6.7 KB
  • rules/languages/typescript/README.md3.3 KB
  • workflows/auto-fix.md17.3 KB
  • workflows/large-review-sequential.md9.7 KB
  • workflows/small-review.md9.2 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

vbsec — Security Scanner cho Vibe Coders (Antigravity variant)

Quét lỗ hổng bảo mật cho code do AI sinh ra (vibe code). Bộ skill này check 21 lỗi bảo mật phổ biến nhất của vibe code, kế thừa kiến trúc SMALL/LARGE mode, tổng quát hóa cross-language + chuyên sâu cho Go/PHP/Python/TypeScript/.NET.

Public repo: https://github.com/tanviet12/vbsec License: MIT Platform: Google Antigravity. Phiên bản Claude Code spawn parallel sub-agents; phiên bản này dùng sequential chunking để giữ portability — chậm hơn ~3× nhưng output identical.

Invocation

Trong Antigravity Agent Manager chat box:

  • Auto-trigger: nói tự nhiên — "scan security cho repo này", "kiểm tra bảo mật", "audit security". Antigravity tự match description và load skill.
  • Explicit slash command: nếu workspace có file .agent/workflows/vbs-scan-security.md (xem README để biết cách tạo), gõ /vbs-scan-security để invoke.
ArgumentScopeMô tả
(không args)Toàn repoMặc định — quét toàn bộ repo
allToàn repoAlias explicit
uncommitted / diffUncommitted changesStaged + unstaged
stagedStaged files onlyPre-commit scan
commit within XdaysRecent commitsQuét commit X ngày gần đây
commit id <sha>Specific commitQuét 1 commit
pr id <number>Pull requestQuét PR diff (cần gh CLI)

Lựa chọn ngôn ngữ output: lang=vi / --vi (mặc định) hoặc lang=en / --en.

Cờ tùy chọn (v0.7+, mặc định TẮT):

FlagAliasMô tả
--scascaTra cứu CVE live qua OSV.dev cho dependency (NuGet/Go/npm/Composer/PyPI). Xem references/dependency-scan.md. Cần network.
--auto-fixauto-fixTự sinh patch, verify bằng build command, revert nếu fail. Xem workflows/auto-fix.md. Ghi đè file nguồn — cần git repo.
--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ụ:

scan security uncommitted lang=en
/vbs-scan-security pr id 42
audit security commit within 7days
scan security all --sca
scan security uncommitted --auto-fix

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 — Antigravity built-in file/grep tools (read, grep, bash/shell), không gọi grep/find shell thô khi tool native có sẵn
  3. Đọc context đầy đủ — Khi gặp pattern, đọc 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 (Antigravity — Sequential)               │
├─────────────────────────────────────────────────────────────────────┤
│  [Step 0] Parse args → scope + lang                                  │
│  [Step 1] Gather files (git)                                         │
│  [Step 2] Detect primary code language                               │
│  [Step 3] Route by size:                                             │
│           SMALL (≤20 main, ≤30 total, ≤14d) → inline                 │
│           LARGE (vượt ngưỡng)                → sequential chunking   │
│  [Step 4] Apply 21 rules (generic + lang overlay)                    │
│  [Step 4b] SCA scan (optional, --sca) → rule 22 VULNERABLE-DEPENDENCY│
│  [Step 4c] Auto-fix (optional, --auto-fix) → patch/verify/retry loop │
│  [Step 5] Generate bilingual report + save to vbsec-reports/         │
└─────────────────────────────────────────────────────────────────────┘

Step 0: Parse Arguments

Dùng shell/bash tool ĐÚNG MỘT LẦN cho step này.

ARGS="${ARGUMENTS:-$1}"

# 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
SCOPE_WORDS=""
set -f  # không expand glob khi tách từ
for w in $ARGS; do
  case "$w" in
    --auto-fix|auto-fix)       AUTO_FIX=true ;;
    --sca|sca)                 SCA=true ;;
    --run-tests)               RUN_TESTS=true ;;
    lang=vi|lang=en|--vi|--en) ;;
    *)                         SCOPE_WORDS="$SCOPE_WORDS $w" ;;
  esac
done
set +f

# 2) Scope = các từ còn lại (đã bỏ lang + auto-fix/sca)
SCOPE=$(echo "$SCOPE_WORDS" | xargs)

# 3) Gather files
NO_GIT_NOTE=""
SCAN_REF=""
SCAN_ROOT="."
case "$SCOPE" in
  "staged"|"uncommitted"|"diff"|"commit within "*|"commit id "*|"pr id "*)
    if [ "$IS_GIT_REPO" = false ]; then
      echo "{msg_scope_needs_git}"
      exit 1
    fi
    case "$SCOPE" in
      "staged")             FILES=$(git diff --cached --name-only --diff-filter=d) ;;
      "uncommitted"|"diff")
        # staged + unstaged (so với HEAD) + file mới chưa `git add`; bỏ file đã xoá
        FILES=$( { git diff --name-only --diff-filter=d HEAD 2>/dev/null || git diff --cached --name-only --diff-filter=d; git ls-files --others --exclude-standard; } | sort -u | grep -v '^$' || true) ;;
      "commit within "*)
        DAYS=$(echo "$SCOPE" | grep -oE '[0-9]+')
        # Đọc bản hiện tại trên đĩa → bỏ file đã bị xoá sau đó
        FILES=$(git log --since="${DAYS} days ago" --name-only --pretty=format: | sort -u | grep -v '^$' | while IFS= read -r f; do [ -f "$f" ] && echo "$f"; done || true) ;;
      "commit id "*)
        SHA=$(echo "$SCOPE" | sed 's/commit id //')
        git cat-file -e "${SHA}^{commit}" 2>/dev/null || { echo "Unknown commit: $SHA"; exit 1; }
        FILES=$(git diff-tree --root --no-commit-id --name-only -r --diff-filter=d "$SHA")
        SCAN_REF="$SHA" ;;
      "pr id "*)
        PR=$(echo "$SCOPE" | sed 's/pr id //')
        FILES=$(gh pr diff "$PR" --name-only) || exit 1
        git fetch -q origin "pull/${PR}/head" 2>/dev/null || git fetch -q "$(gh repo view --json url -q .url)" "pull/${PR}/head" || { echo "Cannot fetch PR #$PR"; exit 1; }
        SCAN_REF=$(git rev-parse FETCH_HEAD)
        # Bỏ file PR đã xoá (không còn ở head của PR)
        FILES=$(echo "$FILES" | while IFS= read -r f; do git cat-file -e "${SCAN_REF}:$f" 2>/dev/null && echo "$f"; done || true) ;;
    esac
    ;;
  "all"|"")
    if [ "$IS_GIT_REPO" = true ]; then
      FILES=$(git ls-files)
    else
      # Non-git folder — walk filesystem
      FILES=$(find . -type f \
        -not -path '*/.git/*' \
        -not -path '*/.next/*' \
        -not -path '*/.nuxt/*' \
        -not -path '*/.venv/*' \
        -not -path '*/.idea/*' \
        -not -path '*/.vscode/*' \
        -not -path '*/node_modules/*' \
        -not -path '*/vendor/*' \
        -not -path '*/dist/*' \
        -not -path '*/build/*' \
        -not -path '*/target/*' \
        -not -path '*/__pycache__/*' \
        -not -path '*/vbsec-reports/*' \
        2>/dev/null | sed 's|^\./||')
      NO_GIT_NOTE="true"
    fi
    ;;
  *)
    echo "Unknown scope: $SCOPE"
    exit 1
    ;;
esac

# 3b) Scope theo commit/PR: extract snapshot đúng ref ra thư mục tạm.
#     Thư mục hiện tại có thể đang ở branch khác → đọc ở đó sẽ quét sai code.
if [ -n "$SCAN_REF" ]; then
  TMP_BASE="${TMPDIR:-/tmp}"; SCAN_ROOT=$(mktemp -d "${TMP_BASE%/}/vbsec-scan.XXXXXX")
  git archive "$SCAN_REF" | tar -x -C "$SCAN_ROOT"
fi

# 4) Strip noise (double-protect)
FILES=$(echo "$FILES" | grep -vE '(^|/)(node_modules|vendor|dist|build|\.next|\.nuxt|target|\.venv|__pycache__|\.git|vbsec-reports)/' || true)

# 5) Prepare save location
TIMESTAMP=$(date +"%Y-%m-%d-%H%M%S")
REPORT_DIR="vbsec-reports"
REPORT_FILE="${REPORT_DIR}/scan-${TIMESTAMP}.md"
mkdir -p "${REPORT_DIR}"

# 6) Check .gitignore (chỉ relevant nếu là git repo)
GITIGNORE_WARNING=""
if [ "$IS_GIT_REPO" = true ]; then
  if [ -f .gitignore ]; then
    grep -qE '^vbsec-reports/?$' .gitignore || GITIGNORE_WARNING="missing"
  else
    GITIGNORE_WARNING="missing"
  fi
fi

echo "Scope: ${SCOPE:-all (default)}"
echo "Lang: $LANG"
echo "Git repo: $IS_GIT_REPO"
echo "Files: $(echo "$FILES" | wc -l)"
echo "Report file: $REPORT_FILE"
echo "Scan root: $SCAN_ROOT"
echo "SCA (live OSV lookup): $SCA"
echo "Auto-fix: $AUTO_FIX (run tests: $RUN_TESTS)"
[ "$NO_GIT_NOTE" = "true" ] && echo "Note: non-git folder — scanning all files via find"

Lưu ý (v0.5.1+): Skill chạy được trên cả non-git folder. Default scope (all) dùng find thay git ls-files. Các scope git-specific (staged, uncommitted, commit within, commit id, pr id) BẮT BUỘC git — báo msg_scope_needs_git rồi exit. Nếu NO_GIT_NOTE=true, report header in {msg_no_git_note}.

Scan root: nếu Scan root khác . (scope commit id, pr id), mọi lần đọc/grep file phải đọc tại $SCAN_ROOT/<path>. Đó là snapshot đúng commit/PR; KHÔNG đọc bản trong thư mục hiện tại (có thể đang ở branch khác). Report vẫn ghi path gốc <path>, không kèm prefix $SCAN_ROOT. LARGE mode cũng đọc mọi chunk tại $SCAN_ROOT. Render report xong → rm -rf "$SCAN_ROOT".

v0.7+: $AUTO_FIX=true nhưng $IS_GIT_REPO=false → Step 4c tự skip và in {msg_autofix_needs_git} (scan/report vẫn chạy bình thường).

v0.7+: $AUTO_FIX=true và $SCAN_ROOT khác . (scope commit id, pr id) → file đang đọc là snapshot tạm, sửa ở đó không có tác dụng. Step 4c KHÔNG apply patch nào: mọi finding CRITICAL/HIGH chỉ ghi diff ra vbsec-reports/patches/, patch_status: "suggested_only", và in {msg_autofix_snapshot_scope} một lần.


Step 1: Load i18n Strings

Đọc file i18n tương ứng với $LANG:

File i18n chứa bảng key→text cho toàn bộ user-facing strings. Mọi text trong report final phải lấy từ i18n, KHÔNG hardcode.

Strings KHÔNG bao giờ dịch: rule ID, file path, code snippet, command name.


Step 2: Detect Primary Code Language

Đọc references/language-detection.md. Tóm tắt:

  1. Count extension trong file list: .go, .py, .php, .js, .ts, .jsx, .tsx, .rb, .java, .rs, .cs, .csproj, .sln
  2. Primary lang = lang chiếm ≥30% tổng files
  3. Có rules/languages/<lang>/ → load overlay; không có → chỉ dùng generic
  4. Multi-lang repo (Go backend + Vue frontend) → load cả 2 overlay

Hiện hỗ trợ chuyên sâu: go, php, typescript (gộp JS+TS), python, dotnet.


Step 3: Route by Size

Điều kiệnNgưỡngMode
Files ngôn ngữ chính≤20SMALL
Files ngôn ngữ chính>20LARGE
Tổng files≤30SMALL
Tổng files>30LARGE
Timespan (scope commit within)≤14 ngàySMALL
Timespan>14 ngàyLARGE

BẤT KỲ điều kiện nào sang LARGE → dùng LARGE mode.


Step 4: Apply Rules

Cho mỗi rule trong rules/generic/ (01-21):

  1. Nạp phần phát hiện của cả bộ rule qua script bash <skill-dir>/references/load-rules.sh --part N <lang...> (chạy đủ mọi phần, dòng cuối output cho biết tổng số phần). Chạy nguyên lệnh, KHÔNG thêm | head, | tail, | grep: mỗi phần đã < 20.000 ký tự, cắt output = bỏ sót rule (overlay đã thay generic) → hiểu intent, severity, search patterns gợi ý. Phần Examples/Fix recommendation chỉ Read khi rule có finding CRITICAL/HIGH (chi tiết trong workflow)
  2. Apply lên files trong scope
  3. Với mỗi match: trace data flow (L1-L4), phân loại có phải vulnerability thật không
  4. Nếu có rule cùng id trong rules/languages/<detected-lang>/, rule chuyên sâu thắng generic.

21 rules generic (luôn chạy) + 1 rule optional (--sca):

#IDSeverity max
1HARDCODED-SECRETCRITICAL
2SQL-INJECTIONCRITICAL
3XSSHIGH
4IDORHIGH
5SLOPSQUATTINGCRITICAL
6BRUTE-FORCEHIGH
7MASS-ASSIGNMENTCRITICAL
8INSECURE-DESERIALIZATIONCRITICAL
9SSRFHIGH
10PATH-TRAVERSALHIGH
11CSRFHIGH
12BROKEN-ACCESS-CONTROLCRITICAL
13WEAK-PASSWORD-HASHINGCRITICAL
14JWT-NONE-ALGORITHMCRITICAL
15CORS-MISCONFIGHIGH
16UNRESTRICTED-FILE-UPLOADCRITICAL
17VERBOSE-ERROR-DEBUG-MODEHIGH
18MISSING-RATE-LIMITHIGH
19RACE-CONDITIONHIGH
20OUTDATED-DEPENDENCYHIGH
21COMMAND-INJECTIONCRITICAL
22VULNERABLE-DEPENDENCYCRITICAL

Rule 22 chỉ chạy khi $SCA=true — xem Step 4b.


Step 4b: SCA Scan (optional — --sca)

Chỉ chạy khi $SCA=true. Rule 22 KHÔNG được nạp qua load-rules.sh (frontmatter opt_in: --sca), nên Read rules/generic/22-vulnerable-dependency.md ở bước này. Đọc references/dependency-scan.md: parse manifest theo ecosystem (NuGet/.NET, Go, npm/TS, Composer/PHP, PyPI), query https://api.osv.dev/v1/querybatch rồi v1/vulns/{id}, lấy severity từ database_specific.severity (không tự tính điểm từ CVSS vector), tạo finding VULNERABLE-DEPENDENCY kèm cve_id/fixed_version. Network fail/không có manifest → note {msg_sca_unavailable}/{msg_sca_no_manifest}, KHÔNG fail scan, fallback rule 20. Chạy 1 lần cho toàn repo (không chunk theo folder).

Step 4c: Auto-fix (optional — --auto-fix)

Chỉ chạy khi $AUTO_FIX=true, và cần $IS_GIT_REPO=true (không có → in {msg_autofix_needs_git}, skip). $SCAN_ROOT khác . hoặc scope staged → chỉ sinh patch, KHÔNG apply, mọi finding là suggested_only. Chạy TRƯỚC Step 5 để patch_status kịp vào report. Đọc workflows/auto-fix.md: preflight 1 lần (command -v build tool + build baseline; thiếu tool hoặc baseline fail → mọi finding suggested_only), rồi với mỗi finding CRITICAL/HIGH: harvest context → generate unified diff → git apply --check → snapshot file sắp bị ghi → git apply → build verify theo $PRIMARY_LANG → khôi phục từ snapshot + retry (tối đa 2 lần) nếu fail. KHÔNG revert bằng git checkout. Patch dependency chỉ applied khi có --run-tests và build + test của project pass (Go, dotnet); npm/Composer/PyPI luôn suggested_only.


Step 5: Generate Report

Tham khảo template trong references/output-format.md. Quy tắc cốt lõi:

Verbose level theo severity:

  • CRITICAL → bảng overview + full verbose block per finding
  • HIGH → bảng overview + medium block per finding
  • MEDIUM → chỉ bảng compact
  • LOW → chỉ bảng compact

Layout:

  1. Header block (scope, file count, primary lang, mode, date, lang code)
  2. VERDICT + 1-line description
  3. CRITICAL section
  4. HIGH section
  5. MEDIUM section
  6. LOW section
  7. PASSED CHECKS 7b. Hardening notes (tuỳ chọn, {header_hardening_title}) — gợi ý phòng thủ, KHÔNG phải finding
  8. Next steps 8b. Auto-fix summary (chỉ khi --auto-fix đã chạy ở Step 4c)
  9. Save notification
  10. Gitignore warning (nếu cần)
  11. Footer + disclaimer
  12. JSON summary (canonical EN) — đúng schema ở references/output-format.md mục 7

Save-to-file: ghi TOÀN BỘ report (identical với stdout) vào vbsec-reports/scan-<timestamp>.md dùng tool write của Antigravity.

Sau đó in 1-2 dòng note ra stdout:

📄 {msg_report_saved}: vbsec-reports/scan-<timestamp>.md
⚠️ {msg_gitignore_warning_title}: {msg_gitignore_warning_text}

Mọi section header, severity label, verdict text lấy từ i18n file đã load ở Step 1.

Finding vs hardening note: chỉ tạo finding khi có đường khai thác cụ thể (input attacker điều khiển được tới sink, hoặc cấu hình sai khai thác được ngay). Reasoning kết luận "an toàn" / "không khai thác được" → KHÔNG tạo finding. Ngoại lệ: check/sanitizer viết sai (HasPrefix thiếu /, endsWith domain, algorithms lấy từ header...) LUÔN là finding dù hiện có yếu tố khác chặn — giữ finding, hạ severity, nêu điều kiện bypass. Vấn đề không thuộc 21 rule (token không hết hạn, thiếu header...) → KHÔNG gán rule gần nhất. "Endpoint không có auth" chỉ là finding khi repo có middleware auth mà route này bị bỏ sót, hoặc endpoint bản chất cần quyền (admin, xoá, tiền, dữ liệu người khác); không thêm BROKEN-ACCESS-CONTROL vào dòng đã có finding CRITICAL khác. Gợi ý phòng thủ thêm cho code đã an toàn (header, cờ cookie khi không có XSS, lockfile...) → hardening_notes[] + section {header_hardening_title}, không gán rule_id, không tính vào summary/verdict. Chi tiết: references/output-format.md mục "Finding vs hardening note".

Validate JSON trước khi kết thúc (bắt buộc): sau khi ghi report, chạy python3 <skill-dir>/references/validate-report.py <report-file> (<skill-dir> = thư mục chứa file SKILL.md này). Script báo lỗi → sửa JSON trong report, ghi lại, chạy lại (tối đa 2 lần). Lỗi hay gặp: dùng key id/rule thay vì rule_id, tự đặt rule ID ngoài 21 rule, severity viết thường, summary đếm lệch với findings, finding tự nhận "not reachable" / "không khai thác được" / "mapped to closest rule" (phải chuyển sang hardening_notes), 2 finding trùng file:line:rule_id. Không có python3 → tự đối chiếu với bảng schema ở output-format.md mục 7.


Verdict Logic

Điều kiệnVerdict
Có ≥1 CRITICALFAIL
Không CRITICAL, có ≥1 HIGHWARN
Không CRITICAL, không HIGHPASS

WARN ≠ approve. Báo cáo cần nêu rõ HIGH issues cần khắc phục trước production.


Khác biệt với Claude Code variant

AspectClaude CodeAntigravity (file này)
LARGE modeParallel sub-agents (3 cùng lúc)Sequential chunking (1 chunk/lần)
Resume on interruptTodoWrite tasks.vbsec-tmp/findings-*.md (re-run skip chunk đã có file)
TriggerSlash command ClaudeAuto-trigger by description + optional .agent/workflows/

Toàn bộ rules, i18n, output format, language detection — identical với Claude Code variant. Khi update rule → sửa ở canonical (skills/vbs-scan-security/) → chạy ./scripts/sync-skills.sh để propagate.


Reasoning-First (cốt lõi)

DO:

  • Đọc full function khi gặp pattern, KHÔNG flag luôn
  • Trace nguồn dữ liệu: input → transformations → sink
  • Phân loại L1-L4 trước khi flag CRITICAL
  • Đọc rule file trước khi áp dụng

DON'T:

  • Copy bash example chạy thẳng (đó là minh họa)
  • Flag mọi fmt.Sprintf là SQLi (chỉ flag nếu data là L1 và không parameterize)
  • Bỏ qua "but" clauses (nhiều pattern legitimate)
  • Skip context (1 dòng grep không đủ để verdict)

Mục tiêu là hiểu bảo mật, không phải đếm pattern.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

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).

日本語の概要は準備中です。原文の説明を表示しています。

tanviet12/vbsec2902026年9月28日 更新

tanviet12 のスキルをすべて見る

このスキルの問題を報告する