На главную

Security

V0.5 · production-grade testnet

Security posture

Threat model, защитные меры, vulnerability disclosure.

1.

Threat model

Weft строится против background-agent threat landscape описанного в Background Agent Summit (ONA, 2026). Ключевая идея:

«Prompt — не security boundary.»

Caller agent compromise possible через prompt injection в tool description, в данных возвращаемых downstream API, или в системных command'ах. Защиту нельзя строить на доверии к agent reasoning.

2.

Defense in depth — 5 слоёв

  1. JWT capability scoping — tools allowlist, max_per_call_usdc, max_session_usdc, expires_at. Подписан вне agent'а. Default = empty allowlist.
  2. On-chain allowance — WeftEscrow V2 allowancePerTool[tenant][toolId][sessionId] на Base Sepolia. Userspace obхода нет. Адрес: 0xE8Ee...E0ce.
  3. Rate limiting — 60 req/min/IP, BullMQ-backed quotas, Redis-cached counters.
  4. Anomaly detection — webhook-event watcher, escalation на abnormal patterns (10+ calls на 10+ tools за 60s от одного session-token → auto-cap).
  5. Tamper-evident ledger — HMAC-SHA256 на каждом ledger entry. Manual DB tampering детектируется.
3.

Manifest signing

Каждый зарегистрированный сервис имеет:

  • manifest_hash = SHA256({id, title, description, price_usdc, params_schema}) — проверяется на каждый enable_x402. Tampering → MANIFEST_TAMPERING error.
  • manifest_signature (опционально) — EIP-712 подпись провайдера. Verified-badge в /marketplace.
4.

Description sanitization

Перед сохранением description провайдера, применяется regex sanitizer:

  • Адреса 0x[40 hex][blocked: address] (anti address-injection)
  • Urgency-фразы (urgent / asap / expires in / now) → [blocked: urgency]
  • Imperative verbs на старте (send / transfer / approve / execute) → [blocked: imperative]
  • HTML-теги — strip
5.

Infrastructure

  • HTTPS via Let's Encrypt TLS 1.3 (Caddy)
  • HD master mnemonic — file mode 0600, root only, никогда не передаётся по wire
  • Daily encrypted backups (AES-256 GPG symmetric)
  • PM2 systemd-managed weft-pay process
  • Postgres + Redis on isolated network
6.

Smart contract security

WeftEscrow V1 (0xacb59..., V0.4) и V2 (0xE8Ee5Da..., V0.5) — open-source, Hardhat tested 57/57. НЕ аудированы independent firm в V0.x. Trail of Bits audit запланирован Q3 2026 перед mainnet launch.

Operator role — multisig в V1+ (сейчас single key). Pause-функция доступна owner'у в случае критической уязвимости.

7.

Vulnerability disclosure

Если ты нашёл уязвимость:

  1. НЕ exploit на mainnet (after mainnet launch).
  2. Создай private security advisoryна GitHub.
  3. Включи: PoC, affected version, reproduction steps, expected vs actual behavior.
  4. Жди ответ в течение 48 часов.
8.

Bug bounty

Bug bounty программа планируется после mainnet launch + Trail of Bits audit completion. Ожидаемый payout range: $500 (informational) до $50,000 (critical economic attacks). Programme TBA через GitHub announcement.

9.

Past incidents

На момент V0.5 — security incidents с user fund loss не было. Public log incident'ов — в docs/incidents.md на GitHub после первого инцидента.

10.

Contact