@runsec/mcp 1.0.35 → 1.0.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/data/.rag-cache.json +1 -0
- package/dist/data/skills/_exploit_overrides.json +16 -0
- package/dist/data/skills/advanced-agent-cloud/index.md +94 -0
- package/dist/data/skills/advanced-agent-cloud/patterns.md +46 -0
- package/dist/data/skills/advanced-agent-cloud/skill.json +38 -0
- package/dist/data/skills/app-logic/index.md +69 -0
- package/dist/data/skills/app-logic/patterns.md +23 -0
- package/dist/data/skills/app-logic/skill.json +24 -0
- package/dist/data/skills/auth-keycloak/index.md +69 -0
- package/dist/data/skills/auth-keycloak/patterns.md +46 -0
- package/dist/data/skills/auth-keycloak/skill.json +51 -0
- package/dist/data/skills/browser-agent/index.md +58 -0
- package/dist/data/skills/browser-agent/patterns.md +15 -0
- package/dist/data/skills/browser-agent/skill.json +24 -0
- package/dist/data/skills/cloud-secrets/index.md +66 -0
- package/dist/data/skills/cloud-secrets/patterns.md +19 -0
- package/dist/data/skills/cloud-secrets/skill.json +28 -0
- package/dist/data/skills/csharp-dotnet/index.md +103 -0
- package/dist/data/skills/csharp-dotnet/patterns.md +270 -0
- package/dist/data/skills/csharp-dotnet/skill.json +27 -0
- package/dist/data/skills/desktop-vsto-suite/index.md +202 -0
- package/dist/data/skills/desktop-vsto-suite/patterns.md +154 -0
- package/dist/data/skills/desktop-vsto-suite/skill.json +26 -0
- package/dist/data/skills/devops-security/index.md +64 -0
- package/dist/data/skills/devops-security/patterns.md +23 -0
- package/dist/data/skills/devops-security/skill.json +42 -0
- package/dist/data/skills/domain-access-management/index.md +123 -0
- package/dist/data/skills/domain-access-management/patterns.md +58 -0
- package/dist/data/skills/domain-access-management/skill.json +36 -0
- package/dist/data/skills/domain-data-privacy/index.md +98 -0
- package/dist/data/skills/domain-data-privacy/patterns.md +48 -0
- package/dist/data/skills/domain-data-privacy/skill.json +36 -0
- package/dist/data/skills/domain-input-validation/index.md +210 -0
- package/dist/data/skills/domain-input-validation/patterns.md +158 -0
- package/dist/data/skills/domain-input-validation/skill.json +24 -0
- package/dist/data/skills/domain-platform-hardening/index.md +169 -0
- package/dist/data/skills/domain-platform-hardening/patterns.md +96 -0
- package/dist/data/skills/domain-platform-hardening/skill.json +27 -0
- package/dist/data/skills/ds-ml-security/patterns.md +137 -0
- package/dist/data/skills/fastapi-async/index.md +83 -0
- package/dist/data/skills/fastapi-async/patterns.md +329 -0
- package/dist/data/skills/fastapi-async/skill.json +32 -0
- package/dist/data/skills/frontend-react/index.md +26 -0
- package/dist/data/skills/frontend-react/patterns.md +226 -0
- package/dist/data/skills/frontend-react/skill.json +24 -0
- package/dist/data/skills/go-core/index.md +86 -0
- package/dist/data/skills/go-core/patterns.md +272 -0
- package/dist/data/skills/go-core/skill.json +22 -0
- package/dist/data/skills/hft-cpp-security/patterns.md +37 -0
- package/dist/data/skills/index.md +73 -0
- package/dist/data/skills/infra-k8s-helm/index.md +138 -0
- package/dist/data/skills/infra-k8s-helm/patterns.md +279 -0
- package/dist/data/skills/infra-k8s-helm/skill.json +41 -0
- package/dist/data/skills/integration-security/index.md +73 -0
- package/dist/data/skills/integration-security/patterns.md +132 -0
- package/dist/data/skills/integration-security/skill.json +30 -0
- package/dist/data/skills/java-enterprise/index.md +31 -0
- package/dist/data/skills/java-enterprise/patterns.md +816 -0
- package/dist/data/skills/java-enterprise/skill.json +26 -0
- package/dist/data/skills/java-spring/index.md +65 -0
- package/dist/data/skills/java-spring/patterns.md +22 -0
- package/dist/data/skills/java-spring/skill.json +23 -0
- package/dist/data/skills/license-compliance/index.md +58 -0
- package/dist/data/skills/license-compliance/patterns.md +12 -0
- package/dist/data/skills/license-compliance/skill.json +28 -0
- package/dist/data/skills/mobile-security/patterns.md +42 -0
- package/dist/data/skills/nodejs-nestjs/index.md +71 -0
- package/dist/data/skills/nodejs-nestjs/patterns.md +288 -0
- package/dist/data/skills/nodejs-nestjs/skill.json +24 -0
- package/dist/data/skills/observability/index.md +68 -0
- package/dist/data/skills/observability/patterns.md +22 -0
- package/dist/data/skills/observability/skill.json +26 -0
- package/dist/data/skills/php-security/patterns.md +202 -0
- package/dist/data/skills/ru-regulatory/index.md +72 -0
- package/dist/data/skills/ru-regulatory/patterns.md +28 -0
- package/dist/data/skills/ru-regulatory/skill.json +53 -0
- package/dist/data/skills/ruby-rails/index.md +65 -0
- package/dist/data/skills/ruby-rails/patterns.md +172 -0
- package/dist/data/skills/ruby-rails/skill.json +24 -0
- package/dist/data/skills/rust-security/patterns.md +152 -0
- package/dist/data/trufflehog-config.yaml +407 -0
- package/dist/index.js +3766 -372
- package/package.json +1 -1
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
| ID | Название метрики | Anti-Pattern (Vulnerable Code/YAML) | Safe-Pattern (Remediation) | Stack | Источник fix_template | Exploit scenario |
|
|
2
|
+
|---|---|---|---|---|---|---|
|
|
3
|
+
| MOB-001 | Flutter TLS bypass | `badCertificateCallback => true` | Удалить bypass, включить pinning/strict TLS validation. | Flutter | Mobile SAR | Удалить bypass, включить pinning/strict TLS validation. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
4
|
+
| MOB-010 | Token leakage in debug mode | `print('token - $token')` | Никогда не печатать токены, даже в debug. | Flutter | Mobile SAR | Никогда не печатать токены, даже в debug. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
5
|
+
| MOB-021 | Missing UI privacy protection | Нет `FLAG_SECURE` в Android activity | Включить `FLAG_SECURE` на чувствительных экранах. | Flutter | Mobile SAR | Включить `FLAG_SECURE` на чувствительных экранах. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
6
|
+
| DSK-100 | Electron remote code injection path | `executeJavaScript(...userInput...)` | Запрет string-exec, передача данных через безопасный IPC. | Electron/Desktop | Desktop SAR | Запрет string-exec, передача данных через безопасный IPC. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
7
|
+
| DSK-105 | Insecure IPC for sensitive actions | `ipcMain.on(...)` на критическом канале | Использовать `ipcMain.handle` + schema validation + authz. | Electron/Desktop | Desktop SAR | Использовать `ipcMain.handle` + schema validation + authz. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
8
|
+
| DSK-110 | Old xlsx prototype pollution risk | `xlsx` ниже безопасной версии | Обновление зависимости + hardening bootstrap. | Electron/Desktop | Desktop SAR | Обновление зависимости + hardening bootstrap. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
9
|
+
| NJS-017 | Dependency integrity gaps | git dep без lock/integrity | Lockfile + pinned versions + private registry policy. | Node.js/JavaScript | Supply Chain | Validate data with Zod and sanitize DOM/HTML sinks with DOMPurify before rendering. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
10
|
+
| NJS-018 | Header fingerprint leakage | `X-Powered-By` открыт | `helmet()` + disable x-powered-by. | Node.js/JavaScript | HTTP Hardening | Validate data with Zod and sanitize DOM/HTML sinks with DOMPurify before rendering. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
11
|
+
| NJS-033 | Weak TLS config | `rejectUnauthorized: false` | Строгая проверка сертификатов и trust policy. | Node.js/JavaScript | TLS Hardening | Validate data with Zod and sanitize DOM/HTML sinks with DOMPurify before rendering. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
12
|
+
| INF-200 | Hardcoded employee identities in notification routes | В коде зашиты ФИО/логины сотрудников | Вынести персоналии в защищенный справочник и role mapping. | Kubernetes/Infra | Infra Risk Report | Вынести персоналии в защищенный справочник и role mapping. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
13
|
+
| INF-201 | Missing CPU limits in workloads | Pod/container без `resources.limits.cpu` | Обязательные CPU requests/limits по профилю сервиса. | Kubernetes/Infra | Infra Risk Report | Обязательные CPU requests/limits по профилю сервиса. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
14
|
+
| INF-202 | Missing memory limits in workloads | Pod/container без `resources.limits.memory` | Обязательные memory requests/limits и OOM policy. | Kubernetes/Infra | Infra Risk Report | Обязательные memory requests/limits и OOM policy. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
15
|
+
| INF-203 | Unbounded worker autoscaling | HPA без upper bound | Вводить maxReplicas + circuit breaker на upstream. | Kubernetes/Infra | Infra Risk Report | Вводить maxReplicas + circuit breaker на upstream. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
16
|
+
| INF-204 | No pod disruption budget | Отсутствует PDB для критических сервисов | Добавить PDB для сохранения SLO при обновлениях/сбоях. | Kubernetes/Infra | Infra Risk Report | Добавить PDB для сохранения SLO при обновлениях/сбоях. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
17
|
+
| INF-205 | Missing readiness probe | Нет readiness probe | Настроить readiness/liveness/startup probes. | Kubernetes/Infra | Infra Risk Report | Настроить readiness/liveness/startup probes. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
18
|
+
| INF-206 | Missing startup probe for heavy services | Сервис стартует долго без startup probe | Добавить startup probe с корректным timeout window. | Kubernetes/Infra | Infra Risk Report | Добавить startup probe с корректным timeout window. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
19
|
+
| INF-207 | No network egress policy | workload может ходить куда угодно | Egress allowlist через NetworkPolicy/egress proxy. | Kubernetes/Infra | Infra Risk Report | Egress allowlist через NetworkPolicy/egress proxy. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
20
|
+
| INF-208 | Unpinned base image digest | `image: app:latest` | Использовать digest pinning + controlled updates. | Kubernetes/Infra | Infra Risk Report | Использовать digest pinning + controlled updates. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
21
|
+
| INF-209 | Missing SBOM attestation in release flow | Нет SBOM к артефактам | Генерировать и хранить SBOM + provenance attestation. | Kubernetes/Infra | Infra Risk Report | Генерировать и хранить SBOM + provenance attestation. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
22
|
+
| INF-210 | Unencrypted internal traffic | mTLS не включен между сервисами | Включить service mesh mTLS/PKI policy. | Kubernetes/Infra | Infra Risk Report | Включить service mesh mTLS/PKI policy. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
23
|
+
| INF-211 | No centralized secret rotation | Секреты живут бессрочно | Политика ротации и автоматический rollover. | Kubernetes/Infra | Infra Risk Report | Политика ротации и автоматический rollover. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
24
|
+
| INF-212 | Privileged debug containers in production | Debug pod с расширенными правами | Запрет privileged debug в prod namespace. | Kubernetes/Infra | Infra Risk Report | Запрет privileged debug в prod namespace. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
25
|
+
| INF-213 | Missing immutable config boundary | Runtime правит config map в обход CI | Immutable config + signed deployment pipeline. | Kubernetes/Infra | Infra Risk Report | Immutable config + signed deployment pipeline. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
26
|
+
| INF-214 | No resource quota per namespace | Namespace без quota | Ввести ResourceQuota и LimitRange. | Kubernetes/Infra | Infra Risk Report | Ввести ResourceQuota и LimitRange. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
27
|
+
| INF-215 | Missing audit retention policy | Audit logs без retention SLA | Политика хранения/архивации security logs. | Kubernetes/Infra | Infra Risk Report | Политика хранения/архивации security logs. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
28
|
+
| INF-216 | No rollback safety gate | Deploy без canary/rollback trigger | Canary + auto rollback on SLO breach. | Kubernetes/Infra | Infra Risk Report | Canary + auto rollback on SLO breach. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
29
|
+
| INF-217 | Exposed admin endpoints internally without auth | `/admin` endpoint внутри сети без auth | mTLS + authn/authz даже во внутреннем контуре. | Kubernetes/Infra | Infra Risk Report | mTLS + authn/authz даже во внутреннем контуре. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
30
|
+
| INF-218 | Missing runtime seccomp/apparmor baseline | Workload без seccomp/AppArmor profile | Применить baseline профили на namespace/service. | Kubernetes/Infra | Infra Risk Report | Применить baseline профили на namespace/service. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
31
|
+
| INF-219 | No node taint/toleration isolation | Sensitive workload на общих нодах | Изоляция узлов через taints/tolerations/nodeSelector. | Kubernetes/Infra | Infra Risk Report | Изоляция узлов через taints/tolerations/nodeSelector. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
32
|
+
| INF-220 | Incident notification without rate control | Alert storm без throttling | Ввести dedup/throttle и escalation policy. | Kubernetes/Infra | Infra Risk Report | Ввести dedup/throttle и escalation policy. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
33
|
+
| PY-024 | Insecure httpx TLS config | `httpx.Client(verify=False)` | Запрещать `verify=False`, использовать trust store/pinning. | Python | TLS hardening | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
34
|
+
| PY-027 | Unbounded pagination/query limits | `limit = int(request.args["limit"])` no cap | Вводить max limits и server-side caps для pagination. | Python | Resource abuse prevention | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
35
|
+
| NJS-021 | Missing request payload size limits (DoS risk) | `app.use(express.json())` (без `limit`) | Ограничить размер body (`express.json({ limit: "1mb" })`), задавать per-route лимиты для upload endpoints. | Node.js/JavaScript | OWASP API4 Resource Consumption | Validate data with Zod and sanitize DOM/HTML sinks with DOMPurify before rendering. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
36
|
+
| NJS-030 | JSON Depth/Size Limits missing in body parsing | `app.use(bodyParser.json())` без `limit` и depth checks | Ограничить размер payload (`limit`) и глубину вложенности через schema validator/middleware, отклонять аномально глубокие JSON. | Node.js/JavaScript | API Resource Consumption Defense | Validate data with Zod and sanitize DOM/HTML sinks with DOMPurify before rendering. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
37
|
+
| FTS-009 | Dependency Integrity Missing for third-party scripts | `<script src="https://cdn.example.com/lib.js"></script>` | Использовать SRI (`integrity` + `crossorigin`) и pinning версий для внешних скриптов/виджетов. | Node.js/JavaScript | Subresource Integrity (SRI) | Validate data with Zod and sanitize DOM/HTML sinks with DOMPurify before rendering. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
38
|
+
| CWE-400-PY | ReDoS in Python regex on unbounded user input | `re.search(r"(a+)+$", user_input)`<br>`re.match(pattern, user_input)` | Ограничивать длину входных строк, избегать regex с catastrophic backtracking, использовать безопасные шаблоны/таймауты обработки. | Python | CWE Compliance | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
39
|
+
| CWE-670-PY | Race Condition in temporary file creation (predictable path) | `temp_path = "/tmp/report.txt"`<br>`open(temp_path, "w")` | Использовать `tempfile.NamedTemporaryFile(delete=False)`/`mkstemp`, создавать файлы атомарно и проверять гонки/симлинки. | Python | CWE Compliance | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
40
|
+
| CWE-400-JS | ReDoS in JavaScript regex against user input | `const re = /(a+)+$/;`<br>`re.test(userInput)` | Исключать шаблоны с catastrophic backtracking, ограничивать размер input и валидировать regex-паттерны до использования. | Node.js/JavaScript | CWE Compliance | Validate data with Zod and sanitize DOM/HTML sinks with DOMPurify before rendering. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
41
|
+
| CWE-670-JS | Race Condition in file writes with predictable names | `const p = "/tmp/" + Date.now() + ".txt";`<br>`fs.writeFileSync(p, data)` | Использовать `fs.promises.mkdtemp()` + безопасное создание файлов, проверку симлинков и атомарные операции записи. | Node.js/JavaScript | CWE Compliance | Validate data with Zod and sanitize DOM/HTML sinks with DOMPurify before rendering. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
42
|
+
| CWE-755-JS | Unhandled rejection / await without try-catch in IPC handlers | `ipcMain.handle("x", async () => { await doCritical(); return ok; })`<br>`doWork().then(saveResult)` | Для IPC и критичных Promise-цепочек добавлять `try/catch` и `.catch(...)`, гарантировать fail-closed и контролируемое завершение. | Node.js/JavaScript | CWE Compliance | Validate data with Zod and sanitize DOM/HTML sinks with DOMPurify before rendering. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
43
|
+
| CWE-295-PY | TLS certificate validation disabled in Python SSLContext | `ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)`<br>`ctx.check_hostname = False`<br>`ctx.verify_mode = ssl.CERT_NONE` | Включать строгую проверку сертификатов (`check_hostname=True`, `verify_mode=ssl.CERT_REQUIRED`), использовать доверенный CA store/pinning. | Python | CWE Compliance - Transport Layer | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
44
|
+
| CWE-297-PY | Deprecated/weak TLS protocol versions in Python | `ssl.SSLContext(ssl.PROTOCOL_TLSv1)`<br>`ssl.SSLContext(ssl.PROTOCOL_SSLv3)` | Использовать только современные версии TLS (1.2/1.3), отключить устаревшие протоколы через безопасные настройки контекста. | Python | CWE Compliance - Transport Layer | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
45
|
+
| CWE-295-JS-ENV | Global TLS verification bypass via environment in Node.js | `process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"` | Запретить отключение TLS-валидации через env, обеспечить проверку цепочки сертификатов и корректный trust store. | Node.js/JavaScript | CWE Compliance - Transport Layer | Validate data with Zod and sanitize DOM/HTML sinks with DOMPurify before rendering. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
46
|
+
| CWE-295-JS-REQ | TLS validation disabled in https.request options | `https.request({ host, rejectUnauthorized: false })` | Всегда оставлять `rejectUnauthorized: true`, использовать корректные CA/cert pinning и fail-closed transport policy. | Node.js/JavaScript | CWE Compliance - Transport Layer | Validate data with Zod and sanitize DOM/HTML sinks with DOMPurify before rendering. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
47
|
+
| CWE-451-PY | Clickjacking protection middleware missing in Django | Отсутствует `django.middleware.clickjacking.XFrameOptionsMiddleware` в `MIDDLEWARE` | Добавить `XFrameOptionsMiddleware` и политику `X-Frame-Options`/`frame-ancestors` для защиты UI от clickjacking. | Python | CWE Compliance Final | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
48
|
+
| CWE-1321-JS-JSON | Prototype pollution risk after JSON.parse(untrusted) | `const obj = JSON.parse(untrusted)` без schema validation | После `JSON.parse` выполнять strict schema validation (Joi/Zod) и блокировать ключи `__proto__`, `constructor`, `prototype`. | Node.js/JavaScript | CWE Compliance Final | Validate data with Zod and sanitize DOM/HTML sinks with DOMPurify before rendering. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
49
|
+
| CWE-362-PY | Race Condition in async Python state updates | `balance = get_balance(); await external(); set_balance(balance-amount)` | Использовать транзакции/locking (DB row locks, atomic updates) для исключения race condition в async путях. | Python | CWE Final Certification | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
50
|
+
| CWE-362-JS | Race Condition in async Node.js critical sections | `const x = cache.get(k); await op(); cache.set(k, x-1)` | Применять mutex/atomic operations/transactional storage в конкурентных async участках. | Node.js/JavaScript | CWE Final Certification | Validate data with Zod and sanitize DOM/HTML sinks with DOMPurify before rendering. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
51
|
+
| CWE-451-JS | Missing CSP/Clickjacking headers in JS web stack | Нет `Content-Security-Policy` и `X-Frame-Options` в ответах | Включить CSP (`frame-ancestors`, script policy) и `X-Frame-Options: DENY/SAMEORIGIN` на gateway/backend. | Node.js/JavaScript | CWE Final Certification | Validate data with Zod and sanitize DOM/HTML sinks with DOMPurify before rendering. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
52
|
+
| CWE-400-PY-RESOURCE | Unreleased file/socket handles in Python loops/generators | `for item in items: f = open(path)`<br>`for row in stream(): sock = socket.socket()` | Использовать контекстные менеджеры `with open(...) as f:` и `with socket.create_connection(...) as s:` для гарантированного освобождения ресурсов. | Python | CWE Compliance Final | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
53
|
+
| CWE-772-JS-BUFFER | Use of `Buffer.allocUnsafe()` without immediate full overwrite | `const buf = Buffer.allocUnsafe(1024)` | Использовать `Buffer.alloc()` или немедленно полностью заполнять буфер (`buf.fill(0)`/безопасная запись) до любого чтения/логирования. | Node.js/JavaScript | CWE Compliance Final | Validate data with Zod and sanitize DOM/HTML sinks with DOMPurify before rendering. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
54
|
+
| CWE-174-PY-CANONICAL | Missing final canonicalization/boundary check after Python input transformations | `p = p.replace("../","")`<br>`p = normalize(p)`<br>`open(base + "/" + p)` | После всех трансформаций всегда делать финальную проверку `abspath/realpath` и гарантировать, что путь/значение остается в разрешенной зоне. | Python | CWE Final Certification | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
55
|
+
| CWE-174-JS-CANONICAL | Missing final canonicalization check after JS/Node normalization pipeline | `value = value.replace("../","")`<br>`value = value.replace("//","/")`<br>`fs.readFile(base + "/" + value)` | После полной очистки обязательно делать `path.resolve`/URL canonicalization и проверять итог против allowlist/разрешенного base scope. | Node.js/JavaScript | CWE Final Certification | Validate data with Zod and sanitize DOM/HTML sinks with DOMPurify before rendering. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
56
|
+
| CWE-116-PY-PARTIAL-ESCAPE | Improper output encoding in Python: escaping only `<`/`>` but not attribute vectors | `safe = html.replace("<","<").replace(">",">")` | Применять контекстно-зависимое экранирование (HTML body/attr/JS/URL), использовать проверенные энкодеры/templating autoescape вместо partial replace. | Python | CWE Final Certification | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
57
|
+
| CWE-116-JS-PARTIAL-ESCAPE | Improper output encoding in JS: partial replace allows `onerror`/`onload` attribute injection | `safe = input.replace(/</g,"<").replace(/>/g,">")` | Использовать контекстно-корректное экранирование и sanitizer (например, DOMPurify), отдельно валидировать/блокировать event-handler атрибуты. | Node.js/JavaScript | CWE Final Certification | Validate data with Zod and sanitize DOM/HTML sinks with DOMPurify before rendering. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
58
|
+
| CWE-94-UNIVERSAL-NO-SANDBOX-TEMPLATE | Dynamic template rendering without sandbox/isolation controls | `templateEngine.render(userTemplate, data)` без sandbox policy | Для динамического рендеринга избегать исполнения шаблонного кода: использовать статические шаблоны из доверенного каталога и передавать только данные через контекст. | Universal | CWE Final Certification | Для динамического рендеринга избегать исполнения шаблонного кода: использовать статические шаблоны из доверенного каталога и передавать только данные через контекст. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
59
|
+
| CWE-20-UNIVERSAL-TYPE-CONFUSION | Missing input type validation/casting for query-critical fields (type confusion) | `find(req.body)`<br>`where: req.query` (объекты принимаются как есть) | Для query-параметров всегда выполнять явное приведение к ожидаемому примитиву (`string/number/boolean`) и отклонять объекты/операторы. | Universal | CWE Final Certification | Для query-параметров всегда выполнять явное приведение к ожидаемому примитиву (`string/number/boolean`) и отклонять объекты/операторы. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
60
|
+
| CWE-98-UNIVERSAL-FILE-INFRA-CONTROL | External control of executable/loadable file selection without mapping | `module = req.query.name; load(module)`<br>`template = request.GET["tpl"]; render(template)` | Не давать внешнему параметру напрямую выбирать файл/модуль; применять фиксированный маппинг `ID -> Filename` и deny-by-default для неизвестных значений. | Universal | CWE Final Certification | Не давать внешнему параметру напрямую выбирать файл/модуль; применять фиксированный маппинг `ID -> Filename` и deny-by-default для неизвестных значений. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
61
|
+
| CWE-942-PLAYWRIGHT-WEBSEC | Browser security bypass via Playwright insecure launch flags | `chromium.launch(args=["--disable-web-security"])` | Не использовать `--disable-web-security` в тестах/рантайме с реальными данными, включать изоляцию контекста и строгую политику origin/headers. | Python/Node.js Playwright | CWE Final Certification | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
62
|
+
| CWE-295-PLAYWRIGHT-HTTPS | TLS trust bypass in browser automation via `ignoreHTTPSErrors: true` | `browser.new_context(ignoreHTTPSErrors=True)`<br>`newContext({ ignoreHTTPSErrors: true })` | Сохранять валидацию TLS включенной, использовать доверенные сертификаты/test CA вместо отключения HTTPS checks. | Python/Node.js Playwright | CWE Final Certification | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
63
|
+
| CWE-295-S3-MINIO-VERIFY | Insecure TLS disable in MinIO/S3 clients (`verify=False`) | `boto3.client("s3", verify=False)` | Не отключать TLS-проверку для S3/MinIO; настраивать корректный CA bundle и endpoint policy с `verify=True`. | Python boto3/MinIO/S3 | CWE Final Certification | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
64
|
+
| CWE-942-S3-PUBLIC-ACL | Public object ACL exposure in S3/MinIO operations | `put_object(..., ACL="public-read")` | Запретить публичные ACL (`public-read/public-read-write`), использовать приватные bucket policies и signed URLs для controlled access. | Python/Node.js S3/MinIO | CWE Final Certification | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
65
|
+
| CWE-400-GIGAAM-UPLOAD-LIMITS | Missing content-length/file size limits for GigaAM audio upload endpoints | `audio = request.files["audio"]` без проверки размера | Вводить строгие лимиты `Content-Length`/размера аудио и early reject oversized uploads до обработки/транскрибации. | Python/GigaAM | CWE Final Certification | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
66
|
+
| CWE-400-GIGAAM-HTTPX-TIMEOUT | Missing `httpx` timeouts for transcription API calls (resource exhaustion risk) | `httpx.post(transcribe_url, files=...)` без `timeout` | Для всех вызовов к GigaAM/OpenRouter API задавать timeout/retry budget/circuit breaker и ограничивать parallelism. | Python/GigaAM/httpx | CWE Final Certification | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
67
|
+
| CWE-94-ELECTRON-WEBPREFS | Insecure Electron BrowserWindow webPreferences (`nodeIntegration: true` / `contextIsolation: false`) | `new BrowserWindow({ webPreferences: { nodeIntegration: true, contextIsolation: false }})` | Для Electron окон отключать `nodeIntegration`, включать `contextIsolation`, использовать preload bridge с минимальным API и CSP. | Node.js/Electron | CWE Final Certification | Validate data with Zod and sanitize DOM/HTML sinks with DOMPurify before rendering. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
68
|
+
| CWE-250-ELECTRON-REMOTE | Unsafe usage of deprecated Electron `remote` module | `const { remote } = require("electron")` | Исключить `remote` модуль, заменить на безопасный IPC (`ipcMain.handle`/`ipcRenderer.invoke`) с валидацией payload и ACL. | Node.js/Electron | CWE Final Certification | Validate data with Zod and sanitize DOM/HTML sinks with DOMPurify before rendering. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
69
|
+
| CWE-94-NODE-EXEC-CONCAT | Command injection risk in `child_process.exec/spawn` with user-influenced command concatenation | `exec("cmd " + userInput)`<br>`spawn("sh", ["-c", base + user])` | Не конкатенировать команды с внешним вводом; использовать `execFile/spawn` со строгим allowlist аргументов и без shell-интерпретации. | Node.js/System | CWE Final Certification | Validate data with Zod and sanitize DOM/HTML sinks with DOMPurify before rendering. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
70
|
+
| CWE-295-BOTO3-VERIFY-FALSE | Insecure TLS verification disabled in boto3 sessions/clients | `boto3.client("s3", verify=False)`<br>`session.client("s3", verify=False)` | Всегда использовать TLS verification (`verify=True`) и корректный CA bundle для S3/STS/других AWS/MinIO клиентов. | Python/boto3 | CWE Final Certification | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
71
|
+
| CWE-284-BOTO3-PUBLIC-ACL | Overly permissive S3 bucket ACL (`public-read/public-read-write`) via boto3 | `create_bucket(..., ACL="public-read")`<br>`put_bucket_acl(ACL="public-read-write")` | Запретить публичные ACL, использовать private ACL по умолчанию и контролируемые bucket policy/IAM grants. | Python/boto3/S3 | CWE Final Certification | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
72
|
+
| CWE-295-BOTO3-PRESIGNED-TTL | Excessive presigned URL lifetime (`ExpiresIn > 3600`) | `generate_presigned_url(..., ExpiresIn=86400)` | Ограничивать TTL presigned URL (<=3600с), применять минимально необходимое время и контекстные ограничения доступа. | Python/boto3/S3 | CWE Final Certification | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
73
|
+
| CWE-114-CSH-PROCESS-START-RELATIVE | Unsafe process execution via relative binary path (`Process.Start("app.exe")`) | `Process.Start("app.exe")` | Использовать абсолютные пути через `Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "...")`, проверять existence/signature перед запуском. | C#/.NET Desktop | CWE Final Certification | Use using/try-finally and safe .NET APIs; enforce strict allowlists for untrusted input. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
74
|
+
| CWE-497-CSH-SENSITIVE-LOG | Sensitive environment/exception disclosure in logs (`Environment.GetEnvironmentVariables`, full `Exception`) | `logger.Info(Environment.GetEnvironmentVariables())`<br>`logger.Error(ex.ToString())` в публичные логи | Маскировать/фильтровать чувствительные данные, не логировать полный env/stack в public logs, применять structured redaction policy. | C#/.NET Desktop | CWE Final Certification | Use using/try-finally and safe .NET APIs; enforce strict allowlists for untrusted input. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
75
|
+
| CWE-606-CSH-UNTRUSTED-LOOP-BOUND | Untrusted input controls loop termination in unsafe/memory-copy contexts | `for (int i=0; i<userCount; i++)` в `unsafe` блоке<br>`while (n-- > 0) Marshal.Copy(...)` | Валидировать upper bounds для циклов от внешнего ввода, применять жесткие лимиты и fail-closed перед unsafe/Marshal operations. | C#/.NET Desktop | CWE Final Certification | Use using/try-finally and safe .NET APIs; enforce strict allowlists for untrusted input. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
76
|
+
| CWE-114-CSH-DLL-SEARCH-ORDER | Missing DLL search order hardening in VSTO startup (`SetDllDirectory("")`/`SetDefaultDllDirectories`) | `ThisAddIn_Startup` без вызова hardening API | В `ThisAddIn_Startup` явно вызывать `SetDefaultDllDirectories`/`SetDllDirectory("")`, фиксировать trusted DLL paths и исключать side-loading. | C#/.NET Desktop | CWE Final Certification | Use using/try-finally and safe .NET APIs; enforce strict allowlists for untrusted input. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
77
|
+
| CWE-362-CSH-STATIC-ASYNC-RACE | Race condition: writes to `static` fields inside async methods/event handlers without synchronization | `static int counter;`<br>`counter++` в `async` методе/обработчике | Для статического состояния использовать `lock`/`Interlocked`/thread-safe контейнеры и избегать shared mutable state в async pipelines. | C#/.NET Desktop | CWE Final Certification | Use using/try-finally and safe .NET APIs; enforce strict allowlists for untrusted input. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
78
|
+
| CWE-583-CSH-METADATA-ACL-TRUST | Access control decisions based on mutable document metadata (`BuiltInDocumentProperties`) | `if (doc.BuiltInDocumentProperties["Category"] == "Admin") ...` | Не доверять ACL-решения metadata полям документа; использовать серверные policy/claims и проверяемые источники авторизации. | C#/.NET Desktop | CWE Final Certification | Use using/try-finally and safe .NET APIs; enforce strict allowlists for untrusted input. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
79
|
+
| CWE-912-CSH-ANTI-DEBUG-AUTH | Anti-debug logic (`Debugger.IsAttached`/`Debug.Assert`) inside auth-critical flow | `if (Debugger.IsAttached) bypassAuth = true` | Запретить изменение auth-логики на основе debug-состояния; проверки целостности отделять от authorization decision path. | C#/.NET Desktop | CWE Final Certification | Use using/try-finally and safe .NET APIs; enforce strict allowlists for untrusted input. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
80
|
+
| CWE-749-CSH-SINGLETON-PUBLIC-HOOKS | Public `event`/`Action` in singleton security classes allowing external state mutation | `public event Action OnBypass;` в singleton | Для security-синглтонов не экспонировать public hooks, ограничивать mutability private/internal API и валидировать подписчиков/инвокации. | C#/.NET Desktop | CWE Final Certification | Use using/try-finally and safe .NET APIs; enforce strict allowlists for untrusted input. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
81
|
+
| PLT-001 | Создание temp-файла в общем каталоге с предсказуемым именем (CWE-379) | `open("/tmp/report-" + user_id + ".txt", "w")` | `tempfile.NamedTemporaryFile(dir=secure_dir, delete=False)` + `os.chmod` restrictive. | Python | `CWE-379` | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
82
|
+
| PLT-002 | Утечка памяти: повторный `malloc` без `free` в C-extension glue (CWE-401) | `ptr = libc.malloc(n); ptr = libc.malloc(n);` | Один `malloc` на handle; `free` в `finally`/destructor. | Python/C | `CWE-401` | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
83
|
+
| PLT-003 | Двойное освобождение одного указателя (CWE-415) | `free(p); free(p);` | Null-after-free; unique ownership; Rust/`cffi` safe wrappers. | C/Interop | `CWE-415` | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
84
|
+
| PLT-004 | Use-after-free в callback после async (CWE-416) | `cb = lambda: use(ptr); schedule(cb); free(ptr)` | Удлинить lifetime или использовать refcounted handles. | Async/C | `CWE-416` | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
85
|
+
| PLT-005 | Плагин получает доступ к объекту вне его security-контекста (CWE-668) | `SecurityContext.Admin = plugin.GetSingleton()` | Изолировать capability objects; least privilege; no global singleton handoff. | Plugin runtime | `CWE-668` | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
86
|
+
| PLT-006 | Неправильная инициализация ресурса до проверки прав (CWE-403) | `fd = os.open(path, os.O_RDWR); assert os.access(path, os.W_OK)` | Проверять права до open или использовать atomic create с O_EXCL. | Python | `CWE-403` | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
87
|
+
| PLT-007 | Асимметричное потребление ресурсов при парсинге входа (CWE-405) | `while True: chunk += sock.recv(1024*1024)` без лимита размера | Жёсткий max body + streaming parser; fail closed на превышении. | Python | `CWE-405` | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
88
|
+
| PLT-008 | Неверное преобразование типа в security check (CWE-704) | `if int(user_role) == 1:` где `user_role="1abc"` | Строгая валидация enum/int; отклонять нечисловые строки. | Python | `CWE-704` | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
89
|
+
| PLT-009 | Чтение за пределами выделенного буфера в shim (CWE-125) | `struct.unpack_from(fmt, blob, user_offset)` без проверки границ | Проверять `user_offset + size <= len(blob)` до unpack. | Python/Cython | `CWE-125` | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
90
|
+
| PLT-010 | Отсутствие обработки ошибки при security decision (CWE-390) | `if verify_sig(blob) == False: pass` | Fail-closed; audit failed verification. | Universal | `CWE-390` | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
91
|
+
| PLT-011 | Раскрытие чувствительного различия ошибок (CWE-203) | `if user: ... else: raise "unknown user"` timing | Constant-time compare; generic errors. | API | `CWE-203` | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
92
|
+
| PLT-012 | Целочисленное переполнение при выделении структуры (CWE-189) | `items = [None] * (count * row_size)` без проверки произведения | `checked` multiply; cap `count`/`row_size`; reject overflow. | Python | `CWE-189` | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
93
|
+
| PLT-013 | Некавыченный путь поиска при `subprocess` (CWE-428) | `subprocess.call("tools\\migrate " + arg, shell=True)` | `shell=False`; argv list; абсолютный путь к бинарнику. | Python | `CWE-428` | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
94
|
+
| PLT-014 | Нулевой pointer dereference после guard (CWE-476) | `if p: use(p); use(p)` где `p` обнулён между вызовами | Single local copy; synchronized access. | C/Interop | `CWE-476` | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
95
|
+
| PLT-015 | Неправильное сравнение указателей вместо содержимого (CWE-581) | `if secret == token:` для byte buffers | `hmac.compare_digest(secret, token)`. | Python | `CWE-581` | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
96
|
+
| PLT-016 | Некорректные права по умолчанию на конфиг с секретами (CWE-276) | `open("app.conf","w").write(secrets)` без `chmod` | `os.open` с `0o600`; umask; ACL. | Python | `CWE-276` | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. | Атакующий доставляет входные данные, соответствующие anti-pattern; реальный ущерб зависит от приёмника (sink), конфигурации и границ доверия. |
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_id": "domain-platform-hardening",
|
|
3
|
+
"name": "Domain Platform Hardening",
|
|
4
|
+
"activation_triggers": [
|
|
5
|
+
"platform-hardening-infra",
|
|
6
|
+
"flutter-ssl-bypass",
|
|
7
|
+
"electron-ipc-hardening",
|
|
8
|
+
"resource-limits-policy"
|
|
9
|
+
],
|
|
10
|
+
"relevant_extensions": [
|
|
11
|
+
".yaml",
|
|
12
|
+
".yml",
|
|
13
|
+
".json",
|
|
14
|
+
".dart",
|
|
15
|
+
".kt",
|
|
16
|
+
".js",
|
|
17
|
+
".ts"
|
|
18
|
+
],
|
|
19
|
+
"tools": [
|
|
20
|
+
"semgrep",
|
|
21
|
+
"syft",
|
|
22
|
+
"trufflehog"
|
|
23
|
+
],
|
|
24
|
+
"rules_path": "core/skills/domain-platform-hardening/patterns.md",
|
|
25
|
+
"few_shot_examples": "core/gold-standard-testbed/gap_fill_vulnerable.py",
|
|
26
|
+
"security_priority": 9
|
|
27
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
| ID | Название метрики | Anti-Pattern (Vulnerable Code/YAML) | Safe-Pattern (Remediation) | Stack | Источник fix_template | Exploit scenario |
|
|
2
|
+
|---|---|---|---|---|---|---|
|
|
3
|
+
| ML-001 | Unsafe pickle load from untrusted source | `pickle.load(f)` on external file | use JSON/safetensors or signed trusted artifact pipeline | DS/ML Security | CWE-502 | Prevent code execution via malicious pickle payloads. |
|
|
4
|
+
| ML-002 | `pickle.loads` on API input | decode bytes and `pickle.loads` directly | strict schema formats only; reject pickle in external APIs | DS/ML Security | CWE-502 | Block arbitrary object deserialization. |
|
|
5
|
+
| ML-003 | `joblib.load` on untrusted model file | load model from URL path unchecked | verify signature/hash and trusted storage origin | DS/ML Security | CWE-502 | Avoid poisoned model deserialization. |
|
|
6
|
+
| ML-004 | `torch.load` remote URL without integrity checks | `torch.load(download(url))` | fetch from trusted registry + checksum/signature validation | DS/ML Security | CWE-494 | Ensure model provenance before load. |
|
|
7
|
+
| ML-005 | `tf.keras.models.load_model` from untrusted path | accepts user-controlled model URI | allowlisted artifact source + integrity verify | DS/ML Security | CWE-494 | Prevent model poisoning/supply-chain injection. |
|
|
8
|
+
| ML-006 | Dynamic import from model metadata | `importlib.import_module(meta["module"])` | allowlisted module registry only | DS/ML Security | CWE-470 | Block arbitrary code import through model metadata. |
|
|
9
|
+
| ML-007 | Notebook stores API keys in cells | key literals in `.ipynb` source/output | use env secret manager and redacted outputs | DS/ML Security | CWE-798 | Prevent credential leakage in notebooks. |
|
|
10
|
+
| ML-008 | Notebook output includes PII sample rows | displayed full customer records | mask/anonymize output before commit/share | DS/ML Security | CWE-359 | Reduce accidental data exposure in notebooks. |
|
|
11
|
+
| ML-009 | Notebook executes shell with user input | `!pip install {pkg}`/`os.system(user)` | enforce allowlisted commands and isolated env | DS/ML Security | CWE-78 | Prevent command injection in notebook workflows. |
|
|
12
|
+
| ML-010 | Unsafe `eval/exec` in data preprocessing scripts | executes user expression on dataset | use safe expression parser and allowlisted ops | DS/ML Security | CWE-94 | Block arbitrary code execution in pipelines. |
|
|
13
|
+
| ML-011 | Training data loaded over HTTP | `pd.read_csv("http://...")` | enforce HTTPS + signature/checksum verification | DS/ML Security | CWE-319 | Prevent tampering during dataset retrieval. |
|
|
14
|
+
| ML-012 | No dataset schema validation before training | raw dataframe consumed directly | validate schema/types/ranges before fit | DS/ML Security | CWE-20 | Reduce poisoning through malformed features. |
|
|
15
|
+
| ML-013 | Model artifacts written world-readable | permissive file permissions | use restricted permissions and encrypted storage | DS/ML Security | CWE-732 | Protect model and feature confidentiality. |
|
|
16
|
+
| ML-014 | Secrets printed in training logs | logs include tokens/conn strings | redact secret patterns in logger middleware | DS/ML Security | CWE-532 | Avoid secret leak through logs. |
|
|
17
|
+
| ML-015 | Unbounded notebook permissions in shared environment | full fs/network access by default | least-privilege kernels and network egress policy | DS/ML Security | CWE-250 | Constrain blast radius of notebook compromise. |
|
|
18
|
+
| ML-016 | Loading arbitrary custom objects in Keras without allowlist | permissive `custom_objects` map | explicit allowlist and signed code packages | DS/ML Security | CWE-502 | Prevent malicious object injection in model load. |
|
|
19
|
+
| ML-017 | Missing model card/provenance metadata validation | accepts artifacts without lineage | enforce provenance metadata checks in CI | DS/ML Security | CWE-345 | Trust only traceable model lineage. |
|
|
20
|
+
| ML-018 | Insecure temporary files for datasets | `/tmp` plaintext sensitive batches | encrypted temp dirs + secure cleanup | DS/ML Security | CWE-312 | Avoid local leakage of sensitive datasets. |
|
|
21
|
+
| ML-019 | Data loader follows arbitrary redirects | requests follows untrusted redirects | disable redirects or validate target host allowlist | DS/ML Security | CWE-918 | Prevent SSRF-like data poisoning fetches. |
|
|
22
|
+
| ML-020 | Model serving endpoint exposes internals/debug | returns stack/model internals on errors | generic error envelope + server-side diagnostics | DS/ML Security | CWE-209 | Reduce intelligence for attackers. |
|
|
23
|
+
| ML-021 | Insecure serialization format for feature store cache | pickle blobs in shared cache | use typed safe formats (parquet/json/protobuf) | DS/ML Security | CWE-502 | Prevent unsafe deserialization in feature store. |
|
|
24
|
+
| ML-022 | No checksum on downloaded tokenizer/vocab files | uses remote vocab blindly | verify hash/signature for tokenizer assets | DS/ML Security | CWE-353 | Ensure tokenizer integrity. |
|
|
25
|
+
| ML-023 | Notebook includes permissive cloud credentials | broad IAM keys embedded in cells | scoped short-lived credentials via workload identity | DS/ML Security | CWE-732 | Limit credential abuse in DS workflows. |
|
|
26
|
+
| ML-024 | Pipeline trusts user-provided feature transformations | dynamic function names from request | allowlist approved transformations only | DS/ML Security | CWE-915 | Prevent logic poisoning via transform injection. |
|
|
27
|
+
| ML-025 | Training script uses random seed from user input in security-sensitive setting | uncontrolled seed for critical model | controlled seed policy with audit trace | DS/ML Security | CWE-330 | Avoid predictable outputs where sensitive. |
|
|
28
|
+
| ML-026 | Notebook cells execute with elevated filesystem mounts | host mounts writable | mount read-only datasets and isolate write dirs | DS/ML Security | CWE-250 | Restrict host filesystem impact. |
|
|
29
|
+
| ML-027 | Model registry accepts unsigned uploads | no signing requirement for model publish | require artifact signing and verification | DS/ML Security | CWE-347 | Improve model supply-chain integrity. |
|
|
30
|
+
| ML-028 | Data preprocessing uses regex vulnerable to ReDoS | user regex on large corpus | safe regex engine and limits | DS/ML Security | CWE-1333 | Prevent compute exhaustion in ingestion. |
|
|
31
|
+
| ML-029 | Feature endpoint caches raw secrets/PII | cache stores full source payload | cache only derived non-sensitive features | DS/ML Security | CWE-1275 | Minimize sensitive data retention. |
|
|
32
|
+
| ML-030 | Untrusted notebook extensions enabled | arbitrary extension code load | signed extension allowlist policy | DS/ML Security | CWE-494 | Prevent malicious extension execution. |
|
|
33
|
+
| ML-031 | Model explainability endpoint reveals training data fragments | raw rows in explanations | aggregate/perturb outputs to avoid memorization leaks | DS/ML Security | CWE-359 | Limit data leakage in explainability. |
|
|
34
|
+
| ML-032 | Artifact path traversal in model loader | `open(base + user_path)` | normalize and constrain artifact paths | DS/ML Security | CWE-22 | Prevent arbitrary file read/load. |
|
|
35
|
+
| ML-033 | CI for notebooks runs with untrusted PR secrets | secrets available to forks | disable secrets on untrusted notebook jobs | DS/ML Security | CWE-200 | Prevent credential theft from CI runs. |
|
|
36
|
+
| ML-034 | No rollback guard on poisoned model deployment | deploys newest model automatically | canary + quality/security gates + rollback hooks | DS/ML Security | CWE-693 | Reduce impact of poisoned model rollout. |
|
|
37
|
+
| ML-035 | Sensitive arrays not cleared after cryptographic operations | key arrays persist in memory | zero mutable buffers after use | DS/ML Security | CWE-1037 | Minimize secret residence in RAM. |
|
|
38
|
+
| AGT-001 | Indirect prompt injection via retrieved external content (Logic: strong) | `prompt = user_prompt + '\n' + fetched_page_text` | `prompt = secure_template(user_prompt, sanitize_external(fetched_page_text))` | AI-Agentic Safety | CWE-1336 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Injected instructions in external content hijack agent behavior. |
|
|
39
|
+
| AGT-002 | Agent executes LLM-produced shell command without policy gate | `subprocess.run(llm_output, shell=True)` | `cmd = policy_allowlist(llm_output); subprocess.run(cmd, shell=False)` | AI-Agentic Safety | CWE-78 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Model output can include attacker-influenced command payloads. |
|
|
40
|
+
| AGT-003 | Tool call from model output not constrained by capability policy | `tool.invoke(parsed.tool_name, parsed.args)` | `tool.invoke(assert_allowed_tool(parsed.tool_name), validated_args)` | AI-Agentic Safety | CWE-863 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Unconstrained tool access enables privilege escalation in agent loop. |
|
|
41
|
+
| AGT-004 | Autonomous code execution from untrusted model artifact | `exec(generated_python)` | `run_in_sandbox(scan_and_sign(generated_python))` | AI-Agentic Safety | CWE-94 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Executing generated code without sandboxing risks full compromise. |
|
|
42
|
+
| AGT-005 | Indirect prompt injection via retrieved external content (Logic: strong) | `prompt = user_prompt + '\n' + fetched_page_text` | `prompt = secure_template(user_prompt, sanitize_external(fetched_page_text))` | AI-Agentic Safety | CWE-1336 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Injected instructions in external content hijack agent behavior. |
|
|
43
|
+
| AGT-006 | Agent executes LLM-produced shell command without policy gate | `subprocess.run(llm_output, shell=True)` | `cmd = policy_allowlist(llm_output); subprocess.run(cmd, shell=False)` | AI-Agentic Safety | CWE-78 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Model output can include attacker-influenced command payloads. |
|
|
44
|
+
| AGT-007 | Tool call from model output not constrained by capability policy | `tool.invoke(parsed.tool_name, parsed.args)` | `tool.invoke(assert_allowed_tool(parsed.tool_name), validated_args)` | AI-Agentic Safety | CWE-863 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Unconstrained tool access enables privilege escalation in agent loop. |
|
|
45
|
+
| AGT-008 | Autonomous code execution from untrusted model artifact | `exec(generated_python)` | `run_in_sandbox(scan_and_sign(generated_python))` | AI-Agentic Safety | CWE-94 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Executing generated code without sandboxing risks full compromise. |
|
|
46
|
+
| AGT-009 | Indirect prompt injection via retrieved external content (Logic: strong) | `prompt = user_prompt + '\n' + fetched_page_text` | `prompt = secure_template(user_prompt, sanitize_external(fetched_page_text))` | AI-Agentic Safety | CWE-1336 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Injected instructions in external content hijack agent behavior. |
|
|
47
|
+
| AGT-010 | Agent executes LLM-produced shell command without policy gate | `subprocess.run(llm_output, shell=True)` | `cmd = policy_allowlist(llm_output); subprocess.run(cmd, shell=False)` | AI-Agentic Safety | CWE-78 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Model output can include attacker-influenced command payloads. |
|
|
48
|
+
| AGT-011 | Tool call from model output not constrained by capability policy | `tool.invoke(parsed.tool_name, parsed.args)` | `tool.invoke(assert_allowed_tool(parsed.tool_name), validated_args)` | AI-Agentic Safety | CWE-863 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Unconstrained tool access enables privilege escalation in agent loop. |
|
|
49
|
+
| AGT-012 | Autonomous code execution from untrusted model artifact | `exec(generated_python)` | `run_in_sandbox(scan_and_sign(generated_python))` | AI-Agentic Safety | CWE-94 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Executing generated code without sandboxing risks full compromise. |
|
|
50
|
+
| AGT-013 | Indirect prompt injection via retrieved external content (Logic: strong) | `prompt = user_prompt + '\n' + fetched_page_text` | `prompt = secure_template(user_prompt, sanitize_external(fetched_page_text))` | AI-Agentic Safety | CWE-1336 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Injected instructions in external content hijack agent behavior. |
|
|
51
|
+
| AGT-014 | Agent executes LLM-produced shell command without policy gate | `subprocess.run(llm_output, shell=True)` | `cmd = policy_allowlist(llm_output); subprocess.run(cmd, shell=False)` | AI-Agentic Safety | CWE-78 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Model output can include attacker-influenced command payloads. |
|
|
52
|
+
| AGT-015 | Tool call from model output not constrained by capability policy | `tool.invoke(parsed.tool_name, parsed.args)` | `tool.invoke(assert_allowed_tool(parsed.tool_name), validated_args)` | AI-Agentic Safety | CWE-863 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Unconstrained tool access enables privilege escalation in agent loop. |
|
|
53
|
+
| AGT-016 | Autonomous code execution from untrusted model artifact | `exec(generated_python)` | `run_in_sandbox(scan_and_sign(generated_python))` | AI-Agentic Safety | CWE-94 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Executing generated code without sandboxing risks full compromise. |
|
|
54
|
+
| AGT-017 | Indirect prompt injection via retrieved external content (Logic: strong) | `prompt = user_prompt + '\n' + fetched_page_text` | `prompt = secure_template(user_prompt, sanitize_external(fetched_page_text))` | AI-Agentic Safety | CWE-1336 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Injected instructions in external content hijack agent behavior. |
|
|
55
|
+
| AGT-018 | Agent executes LLM-produced shell command without policy gate | `subprocess.run(llm_output, shell=True)` | `cmd = policy_allowlist(llm_output); subprocess.run(cmd, shell=False)` | AI-Agentic Safety | CWE-78 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Model output can include attacker-influenced command payloads. |
|
|
56
|
+
| AGT-019 | Tool call from model output not constrained by capability policy | `tool.invoke(parsed.tool_name, parsed.args)` | `tool.invoke(assert_allowed_tool(parsed.tool_name), validated_args)` | AI-Agentic Safety | CWE-863 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Unconstrained tool access enables privilege escalation in agent loop. |
|
|
57
|
+
| AGT-020 | Autonomous code execution from untrusted model artifact | `exec(generated_python)` | `run_in_sandbox(scan_and_sign(generated_python))` | AI-Agentic Safety | CWE-94 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Executing generated code without sandboxing risks full compromise. |
|
|
58
|
+
| AGT-021 | Indirect prompt injection via retrieved external content (Logic: strong) | `prompt = user_prompt + '\n' + fetched_page_text` | `prompt = secure_template(user_prompt, sanitize_external(fetched_page_text))` | AI-Agentic Safety | CWE-1336 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Injected instructions in external content hijack agent behavior. |
|
|
59
|
+
| AGT-022 | Agent executes LLM-produced shell command without policy gate | `subprocess.run(llm_output, shell=True)` | `cmd = policy_allowlist(llm_output); subprocess.run(cmd, shell=False)` | AI-Agentic Safety | CWE-78 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Model output can include attacker-influenced command payloads. |
|
|
60
|
+
| AGT-023 | Tool call from model output not constrained by capability policy | `tool.invoke(parsed.tool_name, parsed.args)` | `tool.invoke(assert_allowed_tool(parsed.tool_name), validated_args)` | AI-Agentic Safety | CWE-863 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Unconstrained tool access enables privilege escalation in agent loop. |
|
|
61
|
+
| AGT-024 | Autonomous code execution from untrusted model artifact | `exec(generated_python)` | `run_in_sandbox(scan_and_sign(generated_python))` | AI-Agentic Safety | CWE-94 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Executing generated code without sandboxing risks full compromise. |
|
|
62
|
+
| AGT-025 | Indirect prompt injection via retrieved external content (Logic: strong) | `prompt = user_prompt + '\n' + fetched_page_text` | `prompt = secure_template(user_prompt, sanitize_external(fetched_page_text))` | AI-Agentic Safety | CWE-1336 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Injected instructions in external content hijack agent behavior. |
|
|
63
|
+
| AGT-026 | Agent executes LLM-produced shell command without policy gate | `subprocess.run(llm_output, shell=True)` | `cmd = policy_allowlist(llm_output); subprocess.run(cmd, shell=False)` | AI-Agentic Safety | CWE-78 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Model output can include attacker-influenced command payloads. |
|
|
64
|
+
| AGT-027 | Tool call from model output not constrained by capability policy | `tool.invoke(parsed.tool_name, parsed.args)` | `tool.invoke(assert_allowed_tool(parsed.tool_name), validated_args)` | AI-Agentic Safety | CWE-863 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Unconstrained tool access enables privilege escalation in agent loop. |
|
|
65
|
+
| AGT-028 | Autonomous code execution from untrusted model artifact | `exec(generated_python)` | `run_in_sandbox(scan_and_sign(generated_python))` | AI-Agentic Safety | CWE-94 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Executing generated code without sandboxing risks full compromise. |
|
|
66
|
+
| AGT-029 | Indirect prompt injection via retrieved external content (Logic: strong) | `prompt = user_prompt + '\n' + fetched_page_text` | `prompt = secure_template(user_prompt, sanitize_external(fetched_page_text))` | AI-Agentic Safety | CWE-1336 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Injected instructions in external content hijack agent behavior. |
|
|
67
|
+
| AGT-030 | Agent executes LLM-produced shell command without policy gate | `subprocess.run(llm_output, shell=True)` | `cmd = policy_allowlist(llm_output); subprocess.run(cmd, shell=False)` | AI-Agentic Safety | CWE-78 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Model output can include attacker-influenced command payloads. |
|
|
68
|
+
| AGT-031 | Tool call from model output not constrained by capability policy | `tool.invoke(parsed.tool_name, parsed.args)` | `tool.invoke(assert_allowed_tool(parsed.tool_name), validated_args)` | AI-Agentic Safety | CWE-863 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Unconstrained tool access enables privilege escalation in agent loop. |
|
|
69
|
+
| AGT-032 | Autonomous code execution from untrusted model artifact | `exec(generated_python)` | `run_in_sandbox(scan_and_sign(generated_python))` | AI-Agentic Safety | CWE-94 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Executing generated code without sandboxing risks full compromise. |
|
|
70
|
+
| AGT-033 | Indirect prompt injection via retrieved external content (Logic: strong) | `prompt = user_prompt + '\n' + fetched_page_text` | `prompt = secure_template(user_prompt, sanitize_external(fetched_page_text))` | AI-Agentic Safety | CWE-1336 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Injected instructions in external content hijack agent behavior. |
|
|
71
|
+
| AGT-034 | Agent executes LLM-produced shell command without policy gate | `subprocess.run(llm_output, shell=True)` | `cmd = policy_allowlist(llm_output); subprocess.run(cmd, shell=False)` | AI-Agentic Safety | CWE-78 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Model output can include attacker-influenced command payloads. |
|
|
72
|
+
| AGT-035 | Tool call from model output not constrained by capability policy | `tool.invoke(parsed.tool_name, parsed.args)` | `tool.invoke(assert_allowed_tool(parsed.tool_name), validated_args)` | AI-Agentic Safety | CWE-863 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Unconstrained tool access enables privilege escalation in agent loop. |
|
|
73
|
+
| AGT-036 | Autonomous code execution from untrusted model artifact | `exec(generated_python)` | `run_in_sandbox(scan_and_sign(generated_python))` | AI-Agentic Safety | CWE-94 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Executing generated code without sandboxing risks full compromise. |
|
|
74
|
+
| AGT-037 | Indirect prompt injection via retrieved external content (Logic: strong) | `prompt = user_prompt + '\n' + fetched_page_text` | `prompt = secure_template(user_prompt, sanitize_external(fetched_page_text))` | AI-Agentic Safety | CWE-1336 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Injected instructions in external content hijack agent behavior. |
|
|
75
|
+
| AGT-038 | Agent executes LLM-produced shell command without policy gate | `subprocess.run(llm_output, shell=True)` | `cmd = policy_allowlist(llm_output); subprocess.run(cmd, shell=False)` | AI-Agentic Safety | CWE-78 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Model output can include attacker-influenced command payloads. |
|
|
76
|
+
| AGT-039 | Tool call from model output not constrained by capability policy | `tool.invoke(parsed.tool_name, parsed.args)` | `tool.invoke(assert_allowed_tool(parsed.tool_name), validated_args)` | AI-Agentic Safety | CWE-863 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Unconstrained tool access enables privilege escalation in agent loop. |
|
|
77
|
+
| AGT-040 | Autonomous code execution from untrusted model artifact | `exec(generated_python)` | `run_in_sandbox(scan_and_sign(generated_python))` | AI-Agentic Safety | CWE-94 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Executing generated code without sandboxing risks full compromise. |
|
|
78
|
+
| AGT-041 | Indirect prompt injection via retrieved external content (Logic: strong) | `prompt = user_prompt + '\n' + fetched_page_text` | `prompt = secure_template(user_prompt, sanitize_external(fetched_page_text))` | AI-Agentic Safety | CWE-1336 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Injected instructions in external content hijack agent behavior. |
|
|
79
|
+
| AGT-042 | Agent executes LLM-produced shell command without policy gate | `subprocess.run(llm_output, shell=True)` | `cmd = policy_allowlist(llm_output); subprocess.run(cmd, shell=False)` | AI-Agentic Safety | CWE-78 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Model output can include attacker-influenced command payloads. |
|
|
80
|
+
| AGT-043 | Tool call from model output not constrained by capability policy | `tool.invoke(parsed.tool_name, parsed.args)` | `tool.invoke(assert_allowed_tool(parsed.tool_name), validated_args)` | AI-Agentic Safety | CWE-863 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Unconstrained tool access enables privilege escalation in agent loop. |
|
|
81
|
+
| AGT-044 | Autonomous code execution from untrusted model artifact | `exec(generated_python)` | `run_in_sandbox(scan_and_sign(generated_python))` | AI-Agentic Safety | CWE-94 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Executing generated code without sandboxing risks full compromise. |
|
|
82
|
+
| AGT-045 | Indirect prompt injection via retrieved external content (Logic: strong) | `prompt = user_prompt + '\n' + fetched_page_text` | `prompt = secure_template(user_prompt, sanitize_external(fetched_page_text))` | AI-Agentic Safety | CWE-1336 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Injected instructions in external content hijack agent behavior. |
|
|
83
|
+
| AGT-046 | Agent executes LLM-produced shell command without policy gate | `subprocess.run(llm_output, shell=True)` | `cmd = policy_allowlist(llm_output); subprocess.run(cmd, shell=False)` | AI-Agentic Safety | CWE-78 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Model output can include attacker-influenced command payloads. |
|
|
84
|
+
| AGT-047 | Tool call from model output not constrained by capability policy | `tool.invoke(parsed.tool_name, parsed.args)` | `tool.invoke(assert_allowed_tool(parsed.tool_name), validated_args)` | AI-Agentic Safety | CWE-863 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Unconstrained tool access enables privilege escalation in agent loop. |
|
|
85
|
+
| AGT-048 | Autonomous code execution from untrusted model artifact | `exec(generated_python)` | `run_in_sandbox(scan_and_sign(generated_python))` | AI-Agentic Safety | CWE-94 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Executing generated code without sandboxing risks full compromise. |
|
|
86
|
+
| AGT-049 | Indirect prompt injection via retrieved external content (Logic: strong) | `prompt = user_prompt + '\n' + fetched_page_text` | `prompt = secure_template(user_prompt, sanitize_external(fetched_page_text))` | AI-Agentic Safety | CWE-1336 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Injected instructions in external content hijack agent behavior. |
|
|
87
|
+
| AGT-050 | Agent executes LLM-produced shell command without policy gate | `subprocess.run(llm_output, shell=True)` | `cmd = policy_allowlist(llm_output); subprocess.run(cmd, shell=False)` | AI-Agentic Safety | CWE-78 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Model output can include attacker-influenced command payloads. |
|
|
88
|
+
| AGT-051 | Tool call from model output not constrained by capability policy | `tool.invoke(parsed.tool_name, parsed.args)` | `tool.invoke(assert_allowed_tool(parsed.tool_name), validated_args)` | AI-Agentic Safety | CWE-863 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Unconstrained tool access enables privilege escalation in agent loop. |
|
|
89
|
+
| AGT-052 | Autonomous code execution from untrusted model artifact | `exec(generated_python)` | `run_in_sandbox(scan_and_sign(generated_python))` | AI-Agentic Safety | CWE-94 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Executing generated code without sandboxing risks full compromise. |
|
|
90
|
+
| AGT-053 | Indirect prompt injection via retrieved external content (Logic: strong) | `prompt = user_prompt + '\n' + fetched_page_text` | `prompt = secure_template(user_prompt, sanitize_external(fetched_page_text))` | AI-Agentic Safety | CWE-1336 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Injected instructions in external content hijack agent behavior. |
|
|
91
|
+
| AGT-054 | Agent executes LLM-produced shell command without policy gate | `subprocess.run(llm_output, shell=True)` | `cmd = policy_allowlist(llm_output); subprocess.run(cmd, shell=False)` | AI-Agentic Safety | CWE-78 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Model output can include attacker-influenced command payloads. |
|
|
92
|
+
| AGT-055 | Tool call from model output not constrained by capability policy | `tool.invoke(parsed.tool_name, parsed.args)` | `tool.invoke(assert_allowed_tool(parsed.tool_name), validated_args)` | AI-Agentic Safety | CWE-863 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Unconstrained tool access enables privilege escalation in agent loop. |
|
|
93
|
+
| AGT-056 | Autonomous code execution from untrusted model artifact | `exec(generated_python)` | `run_in_sandbox(scan_and_sign(generated_python))` | AI-Agentic Safety | CWE-94 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Executing generated code without sandboxing risks full compromise. |
|
|
94
|
+
| AGT-057 | Indirect prompt injection via retrieved external content (Logic: strong) | `prompt = user_prompt + '\n' + fetched_page_text` | `prompt = secure_template(user_prompt, sanitize_external(fetched_page_text))` | AI-Agentic Safety | CWE-1336 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Injected instructions in external content hijack agent behavior. |
|
|
95
|
+
| AGT-058 | Agent executes LLM-produced shell command without policy gate | `subprocess.run(llm_output, shell=True)` | `cmd = policy_allowlist(llm_output); subprocess.run(cmd, shell=False)` | AI-Agentic Safety | CWE-78 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Model output can include attacker-influenced command payloads. |
|
|
96
|
+
| AGT-059 | Tool call from model output not constrained by capability policy | `tool.invoke(parsed.tool_name, parsed.args)` | `tool.invoke(assert_allowed_tool(parsed.tool_name), validated_args)` | AI-Agentic Safety | CWE-863 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Unconstrained tool access enables privilege escalation in agent loop. |
|
|
97
|
+
| AGT-060 | Autonomous code execution from untrusted model artifact | `exec(generated_python)` | `run_in_sandbox(scan_and_sign(generated_python))` | AI-Agentic Safety | CWE-94 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Executing generated code without sandboxing risks full compromise. |
|
|
98
|
+
| AGT-061 | Indirect prompt injection via retrieved external content (Logic: strong) | `prompt = user_prompt + '\n' + fetched_page_text` | `prompt = secure_template(user_prompt, sanitize_external(fetched_page_text))` | AI-Agentic Safety | CWE-1336 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Injected instructions in external content hijack agent behavior. |
|
|
99
|
+
| AGT-062 | Agent executes LLM-produced shell command without policy gate | `subprocess.run(llm_output, shell=True)` | `cmd = policy_allowlist(llm_output); subprocess.run(cmd, shell=False)` | AI-Agentic Safety | CWE-78 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Model output can include attacker-influenced command payloads. |
|
|
100
|
+
| AGT-063 | Tool call from model output not constrained by capability policy | `tool.invoke(parsed.tool_name, parsed.args)` | `tool.invoke(assert_allowed_tool(parsed.tool_name), validated_args)` | AI-Agentic Safety | CWE-863 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Unconstrained tool access enables privilege escalation in agent loop. |
|
|
101
|
+
| AGT-064 | Autonomous code execution from untrusted model artifact | `exec(generated_python)` | `run_in_sandbox(scan_and_sign(generated_python))` | AI-Agentic Safety | CWE-94 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Executing generated code without sandboxing risks full compromise. |
|
|
102
|
+
| AGT-065 | Indirect prompt injection via retrieved external content (Logic: strong) | `prompt = user_prompt + '\n' + fetched_page_text` | `prompt = secure_template(user_prompt, sanitize_external(fetched_page_text))` | AI-Agentic Safety | CWE-1336 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Injected instructions in external content hijack agent behavior. |
|
|
103
|
+
| AGT-066 | Agent executes LLM-produced shell command without policy gate | `subprocess.run(llm_output, shell=True)` | `cmd = policy_allowlist(llm_output); subprocess.run(cmd, shell=False)` | AI-Agentic Safety | CWE-78 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Model output can include attacker-influenced command payloads. |
|
|
104
|
+
| AGT-067 | Tool call from model output not constrained by capability policy | `tool.invoke(parsed.tool_name, parsed.args)` | `tool.invoke(assert_allowed_tool(parsed.tool_name), validated_args)` | AI-Agentic Safety | CWE-863 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Unconstrained tool access enables privilege escalation in agent loop. |
|
|
105
|
+
| AGT-068 | Autonomous code execution from untrusted model artifact | `exec(generated_python)` | `run_in_sandbox(scan_and_sign(generated_python))` | AI-Agentic Safety | CWE-94 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Executing generated code without sandboxing risks full compromise. |
|
|
106
|
+
| AGT-069 | Indirect prompt injection via retrieved external content (Logic: strong) | `prompt = user_prompt + '\n' + fetched_page_text` | `prompt = secure_template(user_prompt, sanitize_external(fetched_page_text))` | AI-Agentic Safety | CWE-1336 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Injected instructions in external content hijack agent behavior. |
|
|
107
|
+
| AGT-070 | Agent executes LLM-produced shell command without policy gate | `subprocess.run(llm_output, shell=True)` | `cmd = policy_allowlist(llm_output); subprocess.run(cmd, shell=False)` | AI-Agentic Safety | CWE-78 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Model output can include attacker-influenced command payloads. |
|
|
108
|
+
| AGT-071 | Tool call from model output not constrained by capability policy | `tool.invoke(parsed.tool_name, parsed.args)` | `tool.invoke(assert_allowed_tool(parsed.tool_name), validated_args)` | AI-Agentic Safety | CWE-863 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Unconstrained tool access enables privilege escalation in agent loop. |
|
|
109
|
+
| AGT-072 | Autonomous code execution from untrusted model artifact | `exec(generated_python)` | `run_in_sandbox(scan_and_sign(generated_python))` | AI-Agentic Safety | CWE-94 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Executing generated code without sandboxing risks full compromise. |
|
|
110
|
+
| AGT-073 | Indirect prompt injection via retrieved external content (Logic: strong) | `prompt = user_prompt + '\n' + fetched_page_text` | `prompt = secure_template(user_prompt, sanitize_external(fetched_page_text))` | AI-Agentic Safety | CWE-1336 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Injected instructions in external content hijack agent behavior. |
|
|
111
|
+
| AGT-074 | Agent executes LLM-produced shell command without policy gate | `subprocess.run(llm_output, shell=True)` | `cmd = policy_allowlist(llm_output); subprocess.run(cmd, shell=False)` | AI-Agentic Safety | CWE-78 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Model output can include attacker-influenced command payloads. |
|
|
112
|
+
| AGT-075 | Tool call from model output not constrained by capability policy | `tool.invoke(parsed.tool_name, parsed.args)` | `tool.invoke(assert_allowed_tool(parsed.tool_name), validated_args)` | AI-Agentic Safety | CWE-863 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Unconstrained tool access enables privilege escalation in agent loop. |
|
|
113
|
+
| AGT-076 | Autonomous code execution from untrusted model artifact | `exec(generated_python)` | `run_in_sandbox(scan_and_sign(generated_python))` | AI-Agentic Safety | CWE-94 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Executing generated code without sandboxing risks full compromise. |
|
|
114
|
+
| AGT-077 | Indirect prompt injection via retrieved external content (Logic: strong) | `prompt = user_prompt + '\n' + fetched_page_text` | `prompt = secure_template(user_prompt, sanitize_external(fetched_page_text))` | AI-Agentic Safety | CWE-1336 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Injected instructions in external content hijack agent behavior. |
|
|
115
|
+
| AGT-078 | Agent executes LLM-produced shell command without policy gate | `subprocess.run(llm_output, shell=True)` | `cmd = policy_allowlist(llm_output); subprocess.run(cmd, shell=False)` | AI-Agentic Safety | CWE-78 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Model output can include attacker-influenced command payloads. |
|
|
116
|
+
| AGT-079 | Tool call from model output not constrained by capability policy | `tool.invoke(parsed.tool_name, parsed.args)` | `tool.invoke(assert_allowed_tool(parsed.tool_name), validated_args)` | AI-Agentic Safety | CWE-863 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Unconstrained tool access enables privilege escalation in agent loop. |
|
|
117
|
+
| AGT-080 | Autonomous code execution from untrusted model artifact | `exec(generated_python)` | `run_in_sandbox(scan_and_sign(generated_python))` | AI-Agentic Safety | CWE-94 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Executing generated code without sandboxing risks full compromise. |
|
|
118
|
+
| AGT-081 | Indirect prompt injection via retrieved external content (Logic: strong) | `prompt = user_prompt + '\n' + fetched_page_text` | `prompt = secure_template(user_prompt, sanitize_external(fetched_page_text))` | AI-Agentic Safety | CWE-1336 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Injected instructions in external content hijack agent behavior. |
|
|
119
|
+
| AGT-082 | Agent executes LLM-produced shell command without policy gate | `subprocess.run(llm_output, shell=True)` | `cmd = policy_allowlist(llm_output); subprocess.run(cmd, shell=False)` | AI-Agentic Safety | CWE-78 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Model output can include attacker-influenced command payloads. |
|
|
120
|
+
| AGT-083 | Tool call from model output not constrained by capability policy | `tool.invoke(parsed.tool_name, parsed.args)` | `tool.invoke(assert_allowed_tool(parsed.tool_name), validated_args)` | AI-Agentic Safety | CWE-863 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Unconstrained tool access enables privilege escalation in agent loop. |
|
|
121
|
+
| AGT-084 | Autonomous code execution from untrusted model artifact | `exec(generated_python)` | `run_in_sandbox(scan_and_sign(generated_python))` | AI-Agentic Safety | CWE-94 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Executing generated code without sandboxing risks full compromise. |
|
|
122
|
+
| AGT-085 | Indirect prompt injection via retrieved external content (Logic: strong) | `prompt = user_prompt + '\n' + fetched_page_text` | `prompt = secure_template(user_prompt, sanitize_external(fetched_page_text))` | AI-Agentic Safety | CWE-1336 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Injected instructions in external content hijack agent behavior. |
|
|
123
|
+
| AGT-086 | Agent executes LLM-produced shell command without policy gate | `subprocess.run(llm_output, shell=True)` | `cmd = policy_allowlist(llm_output); subprocess.run(cmd, shell=False)` | AI-Agentic Safety | CWE-78 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Model output can include attacker-influenced command payloads. |
|
|
124
|
+
| AGT-087 | Tool call from model output not constrained by capability policy | `tool.invoke(parsed.tool_name, parsed.args)` | `tool.invoke(assert_allowed_tool(parsed.tool_name), validated_args)` | AI-Agentic Safety | CWE-863 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Unconstrained tool access enables privilege escalation in agent loop. |
|
|
125
|
+
| AGT-088 | Autonomous code execution from untrusted model artifact | `exec(generated_python)` | `run_in_sandbox(scan_and_sign(generated_python))` | AI-Agentic Safety | CWE-94 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Executing generated code without sandboxing risks full compromise. |
|
|
126
|
+
| AGT-089 | Indirect prompt injection via retrieved external content (Logic: strong) | `prompt = user_prompt + '\n' + fetched_page_text` | `prompt = secure_template(user_prompt, sanitize_external(fetched_page_text))` | AI-Agentic Safety | CWE-1336 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Injected instructions in external content hijack agent behavior. |
|
|
127
|
+
| AGT-090 | Agent executes LLM-produced shell command without policy gate | `subprocess.run(llm_output, shell=True)` | `cmd = policy_allowlist(llm_output); subprocess.run(cmd, shell=False)` | AI-Agentic Safety | CWE-78 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Model output can include attacker-influenced command payloads. |
|
|
128
|
+
| AGT-091 | Tool call from model output not constrained by capability policy | `tool.invoke(parsed.tool_name, parsed.args)` | `tool.invoke(assert_allowed_tool(parsed.tool_name), validated_args)` | AI-Agentic Safety | CWE-863 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Unconstrained tool access enables privilege escalation in agent loop. |
|
|
129
|
+
| AGT-092 | Autonomous code execution from untrusted model artifact | `exec(generated_python)` | `run_in_sandbox(scan_and_sign(generated_python))` | AI-Agentic Safety | CWE-94 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Executing generated code without sandboxing risks full compromise. |
|
|
130
|
+
| AGT-093 | Indirect prompt injection via retrieved external content (Logic: strong) | `prompt = user_prompt + '\n' + fetched_page_text` | `prompt = secure_template(user_prompt, sanitize_external(fetched_page_text))` | AI-Agentic Safety | CWE-1336 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Injected instructions in external content hijack agent behavior. |
|
|
131
|
+
| AGT-094 | Agent executes LLM-produced shell command without policy gate | `subprocess.run(llm_output, shell=True)` | `cmd = policy_allowlist(llm_output); subprocess.run(cmd, shell=False)` | AI-Agentic Safety | CWE-78 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Model output can include attacker-influenced command payloads. |
|
|
132
|
+
| AGT-095 | Tool call from model output not constrained by capability policy | `tool.invoke(parsed.tool_name, parsed.args)` | `tool.invoke(assert_allowed_tool(parsed.tool_name), validated_args)` | AI-Agentic Safety | CWE-863 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Unconstrained tool access enables privilege escalation in agent loop. |
|
|
133
|
+
| AGT-096 | Autonomous code execution from untrusted model artifact | `exec(generated_python)` | `run_in_sandbox(scan_and_sign(generated_python))` | AI-Agentic Safety | CWE-94 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Executing generated code without sandboxing risks full compromise. |
|
|
134
|
+
| AGT-097 | Indirect prompt injection via retrieved external content (Logic: strong) | `prompt = user_prompt + '\n' + fetched_page_text` | `prompt = secure_template(user_prompt, sanitize_external(fetched_page_text))` | AI-Agentic Safety | CWE-1336 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Injected instructions in external content hijack agent behavior. |
|
|
135
|
+
| AGT-098 | Agent executes LLM-produced shell command without policy gate | `subprocess.run(llm_output, shell=True)` | `cmd = policy_allowlist(llm_output); subprocess.run(cmd, shell=False)` | AI-Agentic Safety | CWE-78 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Model output can include attacker-influenced command payloads. |
|
|
136
|
+
| AGT-099 | Tool call from model output not constrained by capability policy | `tool.invoke(parsed.tool_name, parsed.args)` | `tool.invoke(assert_allowed_tool(parsed.tool_name), validated_args)` | AI-Agentic Safety | CWE-863 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Unconstrained tool access enables privilege escalation in agent loop. |
|
|
137
|
+
| AGT-100 | Autonomous code execution from untrusted model artifact | `exec(generated_python)` | `run_in_sandbox(scan_and_sign(generated_python))` | AI-Agentic Safety | CWE-94 | Autofix: sanitize retrieved context, apply tool/command allowlists, and enforce sandbox execution. | Executing generated code without sandboxing risks full compromise. |
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# FastAPI / Async SQLAlchemy
|
|
2
|
+
|
|
3
|
+
## Stack overview
|
|
4
|
+
|
|
5
|
+
Async **FastAPI** APIs with **Encode Databases** / SQLAlchemy patterns, **SlowAPI**, **Pydantic**, and Python security baselines. Metrics are prefixed **`FAS`**.
|
|
6
|
+
|
|
7
|
+
## Top threats
|
|
8
|
+
|
|
9
|
+
- Injection and unsafe query construction (`FAS-004`, `FAS-005`, `FAS-021`, `FAS-024`–`FAS-027`).
|
|
10
|
+
- Broken async/resource hygiene (`FAS-006`–`FAS-009`, `FAS-020`).
|
|
11
|
+
- Information disclosure and misconfiguration (`FAS-010`–`FAS-013`, `FAS-019`).
|
|
12
|
+
- AuthZ and object-level flaws (`FAS-016`, `FAS-017`, `FAS-018`).
|
|
13
|
+
|
|
14
|
+
## Pattern catalog
|
|
15
|
+
|
|
16
|
+
Complete Anti-Pattern / Safe-Pattern definitions live in [`patterns.md`](patterns.md). The table below is a **table of contents** by metric ID.
|
|
17
|
+
|
|
18
|
+
| ID | Metric | Stack |
|
|
19
|
+
|---|---|---|
|
|
20
|
+
| `FAS-001` | SlowAPI: неверный порядок декораторов `limit` | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. |
|
|
21
|
+
| `FAS-002` | SlowAPI: endpoint без `request: Request` | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. |
|
|
22
|
+
| `FAS-003` | SlowAPI: нет `response` при необходимости модификации заголовков | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. |
|
|
23
|
+
| `FAS-004` | SQLi: интерполяция значений в SQL (без `:param`) | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. |
|
|
24
|
+
| `FAS-005` | SQLi: конкатенация строк в SQL (без `:param`) | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. |
|
|
25
|
+
| `FAS-006` | Transaction Leak: несколько `execute()` без `async with database.transaction()` | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. |
|
|
26
|
+
| `FAS-007` | Missing `await` на async DB call | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. |
|
|
27
|
+
| `FAS-008` | Global Client Reuse: создание `AsyncClient`/DB-коннекта внутри хендлера | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. |
|
|
28
|
+
| `FAS-009` | Missing Timeouts: асинхронные сетевые вызовы без `timeout` | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. |
|
|
29
|
+
| `FAS-010` | PII Leakage in Logs: логирование `Request`/секретных полей без маскирования | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. |
|
|
30
|
+
| `FAS-011` | Exposed Docs in Prod: Swagger/ReDoc включены в production | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. |
|
|
31
|
+
| `FAS-012` | Insecure CORS Policy: `allow_origins=["*"]` | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. |
|
|
32
|
+
| `FAS-013` | Pydantic Arbitrary Types: `arbitrary_types_allowed=True` в модели | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. |
|
|
33
|
+
| `FAS-014` | Background Task Exception Handling: задача без `try/except` | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. |
|
|
34
|
+
| `FAS-015` | Large Payload DoS: upload endpoint без лимита размера тела | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. |
|
|
35
|
+
| `FAS-016` | Host/Header Injection: отсутствие валидации `Host` и `X-` заголовков | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. |
|
|
36
|
+
| `FAS-017` | Mass Assignment Protection: прямой маппинг DTO в DB-модель | `OWASP API Security Top 10 (API3: Broken Object Property Level Authorization); FastAPI Production Readiness (strict input models)` |
|
|
37
|
+
| `FAS-018` | Insecure File Uploads: нет защиты от path traversal и magic-bytes проверки | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. |
|
|
38
|
+
| `FAS-019` | Verbose Error Messages: возврат raw Exception в HTTP-ответ | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. |
|
|
39
|
+
| `FAS-020` | Async Context Leakage: dependency без `yield/finally` не закрывает ресурсы | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. |
|
|
40
|
+
| `FAS-021` | OS Command Injection: shell-команда строится из пользовательского ввода | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. |
|
|
41
|
+
| `FAS-022` | Unsafe Deserialization: `pickle.loads`/`yaml.load` на недоверенных данных | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. |
|
|
42
|
+
| `FAS-023` | CSRF on Cookie Session: state-changing endpoint без CSRF-токена | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. |
|
|
43
|
+
| `FAS-024` | SSTI: пользовательский шаблон рендерится на сервере | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. |
|
|
44
|
+
| `FAS-025` | Code Injection: выполнение пользовательского кода через `eval/exec` | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. |
|
|
45
|
+
| `FAS-026` | Command Injection: небезопасный shell-вызов через `os.system`/`subprocess(..., shell=Tr... | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. |
|
|
46
|
+
| `FAS-027` | Unsafe Imports: динамический `__import__` из пользовательского ввода | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. |
|
|
47
|
+
| `FAS-028` | Excessive Data Exposure: `response_model` equals DB model without excluding sensitive f... | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. |
|
|
48
|
+
| `FAS-029` | Verbose error disclosure in custom `exception_handler` via `str(exc)` / `repr(exc)` | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. |
|
|
49
|
+
| `FAS-030` | Unsafe `FileResponse` path from user input discloses internal filesystem paths | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. |
|
|
50
|
+
| `FAS-031` | CSV Injection in export endpoints: user cells written without formula neutralization (C... | Атакующий присылает файл/строку с ячейкой вроде =SUM(1+1) cmd\ |
|
|
51
|
+
| `FAS-032` | Production logs expose full debug exception payloads (CWE-1295) | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. |
|
|
52
|
+
| `FAS-033` | CSV export builds rows from raw query params without sanitization (CWE-1236) | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. |
|
|
53
|
+
| `FAS-034` | FastAPI middleware prints request/response debug internals in production (CWE-1295) | Use strict Pydantic BaseModel schemas for input/output, including response_model and field allowlists. |
|
|
54
|
+
| `FAS-035` | Paladin: утечка `UserAuthData` (password_hash, internal_id) в JSON ответе (CWE-201) | Use Pydantic response models with explicit field exclusions; map domain entities to public DTOs only. |
|
|
55
|
+
|
|
56
|
+
## Verification
|
|
57
|
+
|
|
58
|
+
**Verification:** Check the gold testbed file(s) below for `Vulnerable: <ID>` markers (static Semgrep + `detection-matrix.md` ground truth).
|
|
59
|
+
|
|
60
|
+
- [`gold-standard-testbed/api_vulnerable.py`](../gold-standard-testbed/api_vulnerable.py)
|
|
61
|
+
|
|
62
|
+
**Optional HTTP integration tests** (pytest + httpx; require a running API, `HEXVIBE_TARGET_URL`): [`gold-standard-testbed/integration/verify_fastapi_async_poc.py`](../gold-standard-testbed/integration/verify_fastapi_async_poc.py). See [`gold-standard-testbed/integration/README.md`](../gold-standard-testbed/integration/README.md).
|
|
63
|
+
|
|
64
|
+
After changing [`patterns.md`](patterns.md), run from the repo root:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
python scripts/sync_semgrep.py
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Workflow: Recon → Scan → Verify
|
|
71
|
+
|
|
72
|
+
### 1) Recon
|
|
73
|
+
- Map entrypoints, data flows, and trust boundaries for this stack.
|
|
74
|
+
- Identify which metrics in [`patterns.md`](patterns.md) apply to the code under review.
|
|
75
|
+
|
|
76
|
+
### 2) Scan
|
|
77
|
+
- Run Semgrep with `semgrep-rules/<skill>.yaml` (generated) and correlate with Anti-Patterns.
|
|
78
|
+
- Eliminate findings that cannot bind to a metric row.
|
|
79
|
+
|
|
80
|
+
### 3) Verify
|
|
81
|
+
- Confirm markers or scanner hits for touched IDs in the gold testbed when adding metrics.
|
|
82
|
+
- Emit findings as `Vulnerable: <PREFIX>-<NNN>` in written reviews.
|
|
83
|
+
|