Logo Dependency Audit

Dependency Audit

Cộng đồng
briiirussell
dependency-audit

Audit project dependencies, frameworks, languages, and dev tools for known vulnerabilities, CVEs, and security anti-patterns. Use when the user mentions 'dependency audit,' 'npm audit,' 'CVE,' 'vulnerable packages,' 'supply chain security,' 'outdated dependencies,' 'known vulnerabilities,' 'security advisory,' 'package security,' 'framework vulnerability,' 'is this package safe,' or needs to check whether their stack has known security issues.

Tổng quan

Nhà phát hànhbriiirussell
Kho mãcybersecurity-skills
Tên kỹ năngdependency-audit
Sao
429
Bản fork
60
Tệp đi kèm
Chỉ có hướng dẫn
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Hướng dẫn có đủ mọi thứ cần thiết

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được briiirussell công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Dependency Audit trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/briiirussell/cybersecurity-skills/tree/main/skills/dependency-audit
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/briiirussell/cybersecurity-skills.git /tmp/cybersecurity-skills
mkdir -p .claude/skills
cp -r /tmp/cybersecurity-skills/skills/dependency-audit .claude/skills/dependency-audit
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Dependency Audit trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Dependency Audit ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Dependency Audit với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Dependency Audit — Framework, Package, and Toolchain Security

Audit project dependencies, frameworks, language runtimes, and dev tools for known vulnerabilities (CVEs), security anti-patterns, and supply chain risks.

Methodology

Step 1: Inventory the Stack

Identify everything in use — not just direct dependencies but the full chain:

Package manifests — read and catalog:

Node/JS:    package.json, package-lock.json, yarn.lock, pnpm-lock.yaml
Python:     requirements.txt, Pipfile.lock, pyproject.toml, poetry.lock
Ruby:       Gemfile, Gemfile.lock
Go:         go.mod, go.sum
Rust:       Cargo.toml, Cargo.lock
Java:       pom.xml, build.gradle
PHP:        composer.json, composer.lock
.NET:       *.csproj, packages.config

Framework and runtime versions:

  • Check framework version (Next.js, Django, Rails, Spring, Laravel, Express, etc.)
  • Check language/runtime version (Node.js, Python, Ruby, Go, Java, PHP, .NET)
  • Check infrastructure tools (Docker base images, Terraform providers, Kubernetes versions)

Dev tools and CI/CD:

  • Check CI/CD pipeline configs (.github/workflows, .gitlab-ci.yml, Jenkinsfile)
  • Check pre-commit hooks, linters, formatters
  • Check container base images and their update status
  • Check IaC tool versions (Terraform, Pulumi, CDK)

Edge cases in package manifests:

  • optionalDependencies — installed but not audited by default
  • peerDependencies — version range may not match what's installed
  • overrides / yarn resolutions / pnpm overrides — check if used to silence advisories rather than fix them
  • Monorepos: read every packages/*/package.json and apps/*/package.json, not just the root
  • engines field — older-than-LTS Node makes other audits moot

Step 2: Run Automated Audit Tools

Run the appropriate audit command for the project:

bash
# Node.js
npm audit --json                # full structured output
npm audit --omit=dev --json     # production-only: filters dev/build-time vulns
# Compare the two — vulns only in dev/build tooling do not ship to users
# and should be triaged as lower priority. Don't bury this in the report.

# Python
pip audit          # If pip-audit installed
safety check       # If safety installed

# Ruby
bundle audit

# Go
govulncheck ./...

# Rust
cargo audit

# PHP
composer audit

# .NET
dotnet list package --vulnerable

# Docker
docker scout cves <image>
trivy image <image>

# General (if Trivy is available)
trivy fs .

Applying fixes — read before you --force:

bash
npm audit fix                   # safe: upgrades within stated ranges
npm audit fix --dry-run --force # ALWAYS dry-run first
npm audit fix --force           # only after reviewing the dry-run

npm audit fix --force can resolve an advisory by DOWNGRADING a package to an older version that doesn't trigger the audit signature. This is almost always wrong (e.g. downgrading next@16 to next@9 to "fix" a transitive postcss CVE). Inspect dry-run output for "Will install X@Y, which is a breaking change" — that's the tool trying to downgrade.

When npm audit fix cannot resolve an advisory (transitive dep pinned by an upstream package):

  1. Determine reachability — is the vulnerable code path actually invoked in your usage? npm ls <package> + reading the parent's source can rule it out as unreachable.
  2. Consider a package.json overrides pin to a patched version (test thoroughly — overrides can break the parent).
  3. Consider swapping the parent provider entirely.
  4. If none apply: document explicitly, track upstream, and note in the audit report rather than silently dropping the finding.

Step 3: Research Framework-Specific Known Issues

Beyond CVEs in packages, check for known vulnerability patterns specific to the framework in use. Search for recent advisories and common misconfiguration issues.

For every direct dependency, cross-reference the installed version against:

  • https://github.com/advisories?ecosystem=npm&query=<package>
  • https://github.com/<org>/<repo>/security/advisories

The framework-specific patterns below cover evergreen anti-patterns (mass assignment, debug-in-prod, etc.). Recent CVEs need a fresh check because hardcoded advisory lists rot fast and LLM training data is often 6+ months behind the latest.

Next.js / React:

  • Server Actions exposing internal endpoints (pre-14.1.1 middleware bypass CVE-2025-29927)
  • dangerouslySetInnerHTML without sanitization
  • SSRF through image optimization (next/image with unrestricted domains)
  • Exposed .env files in public directory or client bundle (NEXT_PUBLIC_ prefix leaking secrets)
  • Middleware auth bypass patterns — check middleware.ts matches all protected routes
  • Server Component / Client Component boundary leaking server-only data:
    • Any module reading process.env.SECRET or instantiating a DB client should start with import "server-only"; — fails the build if imported from a Client Component
    • Grep for: files in lib/ that touch process.env.[A-Z_]+ but do NOT import server-only
    • Inverse check: any file with "use client" importing from such a module is a leak
  • Outdated next.config.js security headers

Django:

  • DEBUG=True in production
  • ALLOWED_HOSTS misconfigured (wildcard *)
  • Missing CSRF middleware or @csrf_exempt on state-changing views
  • Raw SQL via extra(), raw(), or RawSQL without parameterization
  • Pickle deserialization in sessions (use JSON serializer)
  • Secret key committed to source control

Rails:

  • Mass assignment without strong parameters
  • SQL injection via where("column = '#{input}'")
  • Unpatched Action Pack, Action View, or Active Record CVEs
  • Insecure deserialization in cookies (verify secret_key_base rotation)
  • CSRF token bypass in API-only mode

Express / Node.js:

  • Prototype pollution through Object.assign, lodash.merge, deep-extend
  • ReDoS (Regular Expression Denial of Service) in validation patterns
  • Path traversal through req.params in file serving routes
  • Missing rate limiting on auth endpoints
  • eval() or Function() with user input
  • Event loop blocking with synchronous operations

Serverless / edge runtimes (Vercel, Lambda, Cloud Run, Workers):

  • In-memory state ≠ rate limit. A module-scoped Map or Set for rate limiting, sessions, or caches is per-instance. Cold starts reset state; load spreads across instances; attackers bypass trivially.
    • Grep for: const rateLimitMap = new Map, const cache = new Map in server-action / API-route files
    • Fix: shared store — Vercel KV, Upstash Ratelimit, Redis, DynamoDB
  • Unbounded in-memory collections leak memory under traffic. Cap size and evict (LRU or FIFO).
  • x-forwarded-for trust: only trustworthy when the edge overwrites it. Behind misconfigured proxy chains it's attacker-spoofable. A fallback to a single "unknown" bucket throttles all anonymous traffic together; random-fallback silently disables the limit.

Spring / Java:

  • Spring4Shell and related RCE vulnerabilities
  • Deserialization attacks (Java native serialization, Jackson polymorphic types)
  • SpEL injection in Spring Expression Language
  • Missing CSRF protection on state-changing endpoints
  • Actuator endpoints exposed without authentication

Laravel / PHP:

  • APP_DEBUG=true in production (leaks env vars in error pages)
  • SQL injection via raw DB queries without bindings
  • Mass assignment without $fillable / $guarded
  • File upload without type validation (PHP execution via uploaded .php)
  • Insecure deserialization in queued jobs

WordPress:

  • Outdated core, theme, or plugin versions (most common attack vector)
  • File editor enabled in wp-admin (allows code injection if admin is compromised)
  • XML-RPC enabled (brute force amplification, SSRF)
  • Default admin username, weak passwords
  • Unpatched plugin vulnerabilities (check WPScan database)

Step 4: Check for Supply Chain Risks

Beyond known CVEs, look for supply chain attack indicators:

Dependency confusion / substitution:

  • Private package names that could be claimed on public registries
  • Missing .npmrc or pip.conf scoping to private registry
  • No lockfile integrity verification

Typosquatting:

  • Package names that are close misspellings of popular packages
  • Recently published packages with very few downloads
  • Packages that changed ownership recently

Malicious packages:

  • Postinstall scripts that make network requests or execute code (scripts.postinstall in package.json)
  • Packages with obfuscated code
  • Excessive permission requests relative to functionality

Maintenance risk:

  • Unmaintained packages (no commits in 2+ years, archived repos)
  • Single-maintainer packages for critical functionality
  • Packages with known but unpatched vulnerabilities (maintainer unresponsive)

Lockfile integrity:

  • Lockfile committed? git ls-files | grep -E 'package-lock\.json|yarn\.lock|pnpm-lock\.yaml|Gemfile\.lock|poetry\.lock|composer\.lock|Cargo\.lock|go\.sum'
  • CI installs from lockfile?
    • Check .github/workflows/*.yml, .gitlab-ci.yml, Jenkinsfile, vercel.json, netlify.toml, Dockerfile
    • npm install (bad) vs npm ci (good); yarn install (bad) vs yarn install --immutable (good); pip install -r (bad) vs pip install --require-hashes -r (good)
  • integrity hashes present in the lockfile? (modern npm/pnpm yes by default)

Step 5: Check Dev Tool and CI/CD Security

GitHub Actions:

  • pull_request_target trigger with checkout of PR code (code injection risk)
  • Secrets accessible in forked PR workflows
  • Unpinned action versions (uses: actions/checkout@main vs @v4.1.0 or SHA pin)
  • Script injection via ${{ github.event.issue.title }} in run: blocks

Docker:

  • Running as root in container (missing USER directive)
  • Base image with known CVEs (check with trivy or docker scout)
  • Secrets baked into image layers (visible via docker history)
  • latest tag instead of pinned version

Terraform / IaC:

  • Hardcoded secrets in .tf files
  • Unpinned provider versions
  • Missing state file encryption
  • Over-permissive IAM in provider configuration

Output Format

markdown
# Dependency & Stack Security Audit
## Project: [name]
## Stack: [language, framework, key tools]
## Date: [date]

### Stack Inventory
| Component | Version | Latest | Status |
|-----------|---------|--------|--------|

### Known Vulnerabilities (CVEs)
| Package | Installed | Vuln | Severity | Where reachable | CVE | Fix Version |
|---------|-----------|------|----------|-----------------|-----|-------------|

Where reachable values: `runtime` / `build-only` / `dev-only`. Confirm with `npm ls --omit=dev <package>` or inspect the deployment artifact (Vercel function bundle, Docker layer). Build- and dev-only vulnerabilities should not block a release on their own; runtime-reachable ones should.

### Framework-Specific Issues
#### [SEVERITY] [Title]
**Component:** [framework/tool name and version]
**Issue:** [description]
**Evidence:** [code or config snippet]
**Remediation:** [specific fix]

### Supply Chain Risks
| Risk | Package/Component | Details | Remediation |
|------|-------------------|---------|-------------|

### Dev Tool / CI Security
| Tool | Issue | Severity | Remediation |
|------|-------|----------|-------------|

### Prioritized Action Plan
1. [Critical — actively exploited CVEs, RCE vulnerabilities]
2. [High — known CVEs with public exploits, supply chain risks]
3. [Medium — framework misconfigurations, outdated dependencies]
4. [Low — maintenance risks, best practice improvements]

Boundaries

  • Only audit code and configurations the user provides
  • When identifying CVEs, verify they apply to the actual installed version
  • Provide specific fix versions or remediation steps for every finding
  • Note when a vulnerability requires specific conditions to exploit (reducing effective severity)
  • Refuse to help exploit found vulnerabilities against unauthorized targets

References

  • OWASP Dependency-Check
  • National Vulnerability Database (NVD)
  • GitHub Advisory Database
  • Snyk Vulnerability Database
  • npm audit / pip-audit / bundler-audit documentation
  • SLSA (Supply-chain Levels for Software Artifacts) framework

Câu hỏi thường gặp

Kỹ năng AI Dependency Audit làm được gì?

Audit project dependencies, frameworks, languages, and dev tools for known vulnerabilities, CVEs, and security anti-patterns. Use when the user mentions 'dependency audit,' 'npm audit,' 'CVE,' 'vulnerable packages,' 'supply chain security,' 'outdated dependencies,' 'known vulnerabilities,' 'security advisory,' 'package security,' 'framework vulnerability,' 'is this package safe,' or needs to check whether their stack has known security issues.

Vì sao nên dùng Dependency Audit trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Dependency Audit là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Dependency Audit trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/briiirussell/cybersecurity-skills/tree/main/skills/dependency-audit. TypingMind đọc tệp SKILL.md rồi cài đặt kỹ năng để bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Dependency Audit?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Dependency Audit với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Dependency Audit với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Dependency Audit có miễn phí không?

Có. Kỹ năng này được briiirussell phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇