supply-chain-dependency-risks-ai-code
БесплатноБез исполняемых скриптовНе проверенUnderstand supply chain vulnerabilities and dependency risks in AI-generated code including outdated packages, malicious packages, and dependency confusion…
Об этом скилле
Insecure Dependencies and Supply Chain Risks in AI-Generated Code
The Hidden Danger of Outdated Packages
Research from the Center for Security and Emerging Technology identifies supply chain vulnerabilities as one of three main categories of AI code generation risks, noting:
"Models generating code often suggest outdated or vulnerable dependencies, creating a cascading effect of security issues."
1.4.1 Using Vulnerable Dependencies
The Problem
A 2025 analysis by KDnuggets found:
"AI models frequently suggest packages that haven't been updated in years, with 67% of suggested dependencies containing at least one known vulnerability."
Why This Happens
1. Training Data Lag:
- AI trained on code from 2020-2023
- Suggests package versions from that era
- Doesn't know about vulnerabilities discovered since
2. Example Code Bias:
- Tutorial code uses older, stable versions
- AI learns these as "recommended"
- Perpetuates outdated patterns
3. No Vulnerability Awareness:
- AI can't check CVE databases
- Doesn't know which versions are vulnerable
- Can't reason about security patches
AI-Generated Vulnerable Code
Vulnerable package.json
// package.json generated by AI
{
"name": "ai-generated-app",
"dependencies": {
"express": "3.0.0", // ❌ VULNERABLE: 66 known vulnerabilities
"mongoose": "4.0.0", // ❌ VULNERABLE: Multiple injection vulnerabilities
"jsonwebtoken": "5.0.0", // ❌ VULNERABLE: Algorithm confusion vulnerability
"request": "2.88.0", // ❌ DEPRECATED: No longer maintained
"node-uuid": "1.4.8", // ❌ DEPRECATED: Should use 'uuid' instead
"body-parser": "1.9.0", // ❌ VULNERABLE: DoS vulnerability
"bcrypt": "0.8.7", // ❌ OUTDATED: Missing critical security fixes
"moment": "2.19.3", // ❌ VULNERABLE: ReDoS and path traversal
"lodash": "4.17.4", // ❌ VULNERABLE: Prototype pollution
"axios": "0.18.0" // ❌ VULNERABLE: SSRF vulnerability
}
}
Vulnerable requirements.txt
# requirements.txt generated by AI
Flask==0.12.0 # ❌ VULNERABLE: Multiple security issues
Django==1.8.0 # ❌ EOL: No longer receives security updates
requests==2.6.0 # ❌ VULNERABLE: Multiple CVEs
PyYAML==3.11 # ❌ VULNERABLE: Arbitrary code execution
Pillow==3.3.2 # ❌ VULNERABLE: Multiple security issues
cryptography==2.1.4 # ❌ OUTDATED: Missing important fixes
paramiko==1.15.0 # ❌ VULNERABLE: Authentication bypass
sqlalchemy==0.9.0 # ❌ VULNERABLE: SQL injection possibilities
jinja2==2.7.0 # ❌ VULNERABLE: XSS vulnerabilities
urllib3==1.22 # ❌ VULNERABLE: Multiple security issues
What's Wrong With These Versions
Express 3.0.0:
- Released: 2012 (13 years old)
- Known vulnerabilities: 66
- Current version: 4.19.0
- Missing: Security middleware, vulnerability fixes
jsonwebtoken 5.0.0:
- Algorithm confusion vulnerability
- Allows attackers to forge tokens
- Change algorithm from RS256 to none
- Bypass authentication entirely
PyYAML 3.11:
- Arbitrary code execution vulnerability
- Unsafe YAML parsing
- Attacker can execute Python code
- CVE-2017-18342
Django 1.8.0:
- End of Life (no security updates)
- Multiple known CVEs
- Current version: 5.0+
- Missing years of security fixes
Secure Implementation
Secure package.json
// package.json with security considerations
{
"name": "secure-app",
"dependencies": {
"express": "^4.19.0", // ✅ Latest stable version
"mongoose": "^8.0.3", // ✅ Current version with security fixes
"jsonwebtoken": "^9.0.2", // ✅ Latest with improved security
"axios": "^1.6.5", // ✅ Maintained alternative to 'request'
"uuid": "^9.0.1", // ✅ Current uuid package
"bcrypt": "^5.1.1", // ✅ Latest with security improvements
"dayjs": "^1.11.10", // ✅ Lightweight alternative to moment
"lodash": "^4.17.21", // ✅ Patched version
"helmet": "^7.1.0", // ✅ Security middleware
"express-rate-limit": "^7.1.5" // ✅ Rate limiting for DoS protection
},
"devDependencies": {
"npm-audit-resolver": "^3.0.0", // ✅ Tool for managing vulnerabilities
"snyk": "^1.1266.0", // ✅ Vulnerability scanning
"eslint-plugin-security": "^2.1.0" // ✅ Security linting
},
"scripts": {
"audit": "npm audit --production",
"audit:fix": "npm audit fix",
"snyk:test": "snyk test",
"snyk:monitor": "snyk monitor",
"security:check": "npm run audit && npm run snyk:test",
"preinstall": "npm run security:check"
},
"engines": {
"node": ">=18.0.0", // ✅ Require LTS version
"npm": ">=9.0.0"
}
}
Secure requirements.txt
# requirements.txt with version pinning and comments
# Last security review: 2025-01-15
# Web Framework
Flask==3.0.0 # ✅ L
Установить supply-chain-dependency-risks-ai-code в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл supply-chain-dependency-risks-ai-code?
Understand supply chain vulnerabilities and dependency risks in AI-generated code including outdated packages, malicious packages, and dependency confusion attacks. Use this skill when you need to learn about vulnerable dependencies in AI code, understand supply chain attacks, recognize typosquatting, or identify outdated package suggestions. Triggers include "supply chain attacks", "dependency vulnerabilities", "outdated packages", "malicious npm packages", "typosquatting", "dependency confusion", "vulnerable dependencies AI", "npm security".
Как установить скилл supply-chain-dependency-risks-ai-code?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл supply-chain-dependency-risks-ai-code запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic