BNB Chain AI Toolkit contains AI agent definitions (JSON), MCP server implementations (TypeScript/Python), market data libraries, wallet utilities, and documentation. Security is taken seriously given the financial nature of the tools.
If you discover a security issue:
- DO NOT open a public GitHub issue
- Report via GitHub Security Advisories (preferred)
- Or email the maintainer directly at security@bnb-chain-toolkit.vercel.app
- Include:
- Description of the vulnerability
- Steps to reproduce
- Potential impact
- Suggested fix (if any)
- Allow reasonable time for a fix before public disclosure
- We will acknowledge receipt within 48 hours and aim to provide a fix or mitigation within 7 days
- Private keys are never stored, logged, or transmitted by any component
- Keys are passed via environment variables and used only in memory
- The
.gitignoreexcludes.envfiles by default - Always use testnet keys during development
- MCP servers run locally on your machine
- No data is sent to external servers beyond the configured blockchain RPC and exchange APIs
- Review each server's source code before running
- Use read-only API keys when you don't need write access
- Contracts in
standards/erc-8004/contracts/are reference implementations - They have not been formally audited
- Do not deploy to mainnet without independent audit
- Test thoroughly on testnet first
- Agent JSON files contain system prompts, not executable code
- Review system prompts before using with any AI assistant
- Agents do not have inherent blockchain access — they need MCP servers
- Designed for offline use (key generation, signing)
- Never transmits private keys over the network
- Verify wallet operations independently before trusting them with significant funds
All HTTP servers restrict cross-origin requests. By default, only same-origin requests are allowed in production. Configure allowed origins via environment variables:
| Component | Environment Variable | Default |
|---|---|---|
| Agent Runtime | CORS_ORIGINS |
Same-origin (wildcard only in dev mode) |
| Translate API | CORS_ORIGIN |
No cross-origin allowed |
| BNBChain MCP | CORS_ORIGINS |
Same-origin |
| Universal Crypto MCP | CORS_ORIGINS |
Same-origin |
| Agenti MCP | CORS_ORIGINS |
Same-origin |
| Search Service | CORS_ORIGINS |
Same-origin |
Set comma-separated origins for multiple domains:
CORS_ORIGINS="https://app.example.com,https://admin.example.com"The deployment configurations (nginx, Vercel, Netlify) enforce a strict CSP:
default-src 'self'— Only same-origin resources by defaultscript-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdn.jsdelivr.net https://unpkg.com https://cdn.tailwindcss.com https://esm.sh https://binaries.soliditylang.org— Allows inline scripts (for SPA), eval (for Solidity compiler), and trusted CDNs (Pyodide, React sandbox, ERC-8004)style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net— Inline styles for framework compatibility and CDN stylesheetsfont-src 'self' data:— Self-hosted fonts (Inter, JetBrains Mono, OpenDyslexic) and data URIsimg-src 'self' data: https:— Images from same-origin, data URIs, and HTTPSconnect-src 'self' https: wss:— API calls to HTTPS endpoints and WebSocket wallet connectionsworker-src 'self' blob:— Web workers from same-origin and blob URLsframe-src 'self' blob:— Iframes for sandbox/playground previewsmanifest-src 'self'— Web app manifest from same-originPermissions-Policyrestricts camera, microphone, and geolocationReferrer-Policy: strict-origin-when-cross-origin
The server applies rate limiting on all routes. In production, rate limiters validate X-Forwarded-For headers to correctly identify clients behind reverse proxies.
Enable proxy trust when running behind a load balancer:
TRUST_PROXY=true- Deploy route — Network names are validated against an allowlist; bytecode must match hex format; ABI must be an array; constructor args are limited to 20
- IPFS route — CID format is validated (CIDv0 and CIDv1); content uploads are limited to 5 MB
- Search service — SQL LIKE metacharacters (
%,_,\) are escaped in user queries - Auto-submit scripts — Git branch names and agent names are validated against
^[a-zA-Z0-9_-]+$; shell commands useexecFileSyncwith argument arrays (no string interpolation)
All user-controlled data rendered into HTML uses safe DOM APIs (textContent, createElement, appendChild) instead of innerHTML. This applies to:
- Web template generation (avatar URLs, NFT names, user listings)
- VS Code extension webviews (wallet status display)
- Nginx container — Runs as non-root
nginxuser with minimal file permissions - Agent runtime — Runs as non-root
appuser(UID 1001) - Redis — Requires password authentication; binds to localhost only
Configure Redis credentials:
REDIS_PASSWORD=your-secure-password- WebSocket connections — Maximum 1,000 concurrent connections per search service instance (configurable via
MAX_WS_CONNECTIONS) - In-memory cache — Maximum 10,000 entries with LRU-style eviction (configurable via
MAX_CACHE_SIZE)
Stack traces are never exposed to clients in production. To enable stack traces for debugging:
SHOW_STACK_TRACES=trueAPI keys and secrets are masked in log output (showing only first and last 4 characters). The wallet toolkit displays security warnings when outputting private keys or mnemonics to stdout.
- Use testnet first for all development and testing
- Review before running — inspect any script before executing
- Limit API permissions — use read-only API keys where possible
- Set IP restrictions on exchange API keys
- Never commit secrets — use environment variables or
.envfiles - Start small — test with minimal amounts before scaling up
- Verify independently — cross-check any financial calculations
- Configure CORS — set explicit
CORS_ORIGINSin production; never use wildcard - Enable proxy trust — set
TRUST_PROXY=truewhen behind a reverse proxy/load balancer - Set Redis password — always set
REDIS_PASSWORDin production
| Variable | Component | Description |
|---|---|---|
CORS_ORIGINS |
MCP servers, Agent Runtime, Search Service | Comma-separated allowed origins |
CORS_ORIGIN |
Translate API | Single allowed origin |
TRUST_PROXY |
Server | Enable X-Forwarded-For trust (true/false) |
SHOW_STACK_TRACES |
Server | Expose stack traces in errors (true/false) |
REDIS_PASSWORD |
Docker Compose | Redis authentication password |
MAX_WS_CONNECTIONS |
Search Service | Max WebSocket connections (default: 1000) |
MAX_CACHE_SIZE |
Search Service | Max cache entries (default: 10000) |
| Version | Supported |
|---|---|
| v2.x | ✅ |
| v1.x | ❌ |
- MCP server dependencies are listed in each server's
package.json - We monitor for known vulnerabilities via GitHub Dependabot
- Critical dependency updates are applied promptly