Project: ClimateGPT Version: 0.3.0 Last Updated: 2025-11-16
- Supported Versions
- Reporting a Vulnerability
- Security Measures
- Known Security Considerations
- Security Best Practices
- Dependency Security
- Disclosure Policy
We release security updates for the following versions:
| Version | Supported | End of Support |
|---|---|---|
| 0.3.x | ✅ Yes | Active |
| 0.2.x | 2026-02-16 | |
| 0.1.x | ❌ No | 2025-03-16 |
| < 0.1 | ❌ No | Not supported |
Recommendation: Always use the latest version for best security and features.
DO NOT create a public GitHub issue for security vulnerabilities.
Instead, please report security vulnerabilities via one of these methods:
-
GitHub Security Advisory (Preferred)
- Go to: https://github.com/DharmpratapSingh/Team-1B-Fusion/security/advisories
- Click "Report a vulnerability"
- Fill out the form with details
-
Direct Email
- Email: [security contact - to be added]
- Subject: "[SECURITY] Brief description"
- Include: Detailed description, steps to reproduce, impact assessment
Please provide:
- Description: What is the vulnerability?
- Impact: What can an attacker do?
- Reproduction: Step-by-step instructions
- Affected Versions: Which versions are affected?
- Proposed Fix: If you have suggestions
- Disclosure Timeline: When you plan to publicly disclose (if applicable)
- Initial Response: Within 48 hours
- Triage: Within 7 days
- Fix Development: Within 30 days (depending on severity)
- Public Disclosure: Coordinated with reporter
| Severity | Description | Response Time |
|---|---|---|
| Critical | Remote code execution, authentication bypass | 24 hours |
| High | SQL injection, XSS, data exposure | 7 days |
| Medium | Information disclosure, DoS | 14 days |
| Low | Minor information leaks, edge cases | 30 days |
- Pydantic schema validation for all API inputs
- SQL injection prevention via parameterized queries
- Column name sanitization (whitelist approach)
- Type checking for all parameters
- API key validation (username:password format)
- No hardcoded credentials (environment variables only)
- Credential format validation on startup
- Default: 100 requests per 60 seconds per IP
- Configurable via environment variables
- Sliding window algorithm
- 429 responses with Retry-After headers
- Fail-closed security model
- Explicit origin whitelist (no wildcards in production)
- Configurable via ALLOWED_ORIGINS
- Validation on every request
- Production mode: Generic error messages
- Development mode: Detailed errors (never in production)
- No SQL query exposure in error messages
- Request ID tracking for debugging
- No eval() usage (replaced with pandas.eval())
- No exec() or compile()
- No pickle for data serialization
- Controlled dynamic imports only
- Automated scanning (pip-audit, bandit)
- Dependabot for security updates
- License compliance checking
- Regular audits (quarterly)
┌─────────────────────────────────────────────────┐
│ Layer 1: Network (CORS, Rate Limiting, HTTPS) │
├─────────────────────────────────────────────────┤
│ Layer 2: Authentication (API Keys) │
├─────────────────────────────────────────────────┤
│ Layer 3: Input Validation (Pydantic) │
├─────────────────────────────────────────────────┤
│ Layer 4: Query Safety (Parameterized Queries) │
├─────────────────────────────────────────────────┤
│ Layer 5: Error Handling (Sanitized Messages) │
├─────────────────────────────────────────────────┤
│ Layer 6: Monitoring (Request IDs, Logging) │
└─────────────────────────────────────────────────┘
Consideration: DuckDB is single-file, read-only
Mitigations:
- ✅ No write access from API
- ✅ File permissions restricted
- ✅ Connection pooling limits concurrent access
- ✅ No user-provided SQL execution
Consideration: LLM can be prompt-injected
Mitigations:
- ✅ Tool calls validated via Pydantic
- ✅ LLM output sanitized before database queries
- ✅ No direct SQL generation from LLM
- ✅ Structured tool responses only
Consideration: Credentials in environment variables
Production Recommendation:
- Use secrets management (Kubernetes Secrets, AWS Secrets Manager)
- Rotate credentials regularly
- Never commit .env files
- Use principle of least privilege
Consideration: Per-IP rate limiting can be bypassed
Mitigations:
- ✅ IP-based limiting (basic protection)
⚠️ Consider adding user-based limits⚠️ Consider adding API key-based limits
Consideration: Misconfigured CORS can expose API
Mitigations:
- ✅ Fail-closed by default
- ✅ No wildcards allowed
- ✅ Explicit origin whitelist
- ✅ Production validation required
Always validate user input:
# Good - Pydantic validation
from models.schemas import QueryEmissionsRequest
req = QueryEmissionsRequest(sector=sector, year=year)
# Bad - No validation
result = query_db(sector, year) # Unsafe!Always use parameterized queries:
# Good
sql = "SELECT * FROM table WHERE year = ?"
result = conn.execute(sql, [2023]).fetchall()
# Bad - SQL injection risk!
sql = f"SELECT * FROM table WHERE year = {year}"Never expose internal details:
# Good
from utils.error_handling import sanitize_sql_error
try:
result = execute_query(sql)
except Exception as e:
return {"error": sanitize_sql_error(e, sql)}
# Bad - Exposes SQL and stack trace!
except Exception as e:
return {"error": str(e), "sql": sql}Never hardcode credentials:
# Good
api_key = os.getenv("OPENAI_API_KEY")
if not api_key:
raise ValueError("OPENAI_API_KEY required")
# Bad - Hardcoded secret!
api_key = "my-secret-key"Keep dependencies updated:
# Check for vulnerabilities
pip-audit
# Update dependencies
pip install --upgrade package_name
# Review Dependabot PRs# In production, enforce HTTPS
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"# Don't use environment variables in production
# Use secrets management instead
# Kubernetes
kubectl create secret generic api-keys \
--from-literal=OPENAI_API_KEY='username:password'
# AWS
aws secretsmanager create-secret \
--name climategpt/api-key \
--secret-string '{"OPENAI_API_KEY":"username:password"}'# Restrict network access
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: climategpt-policy
spec:
podSelector:
matchLabels:
app: climategpt
policyTypes:
- Ingress
- Egress
ingress:
- from:
- podSelector:
matchLabels:
role: frontend# Prevent DoS via resource exhaustion
resources:
requests:
cpu: 1000m
memory: 2Gi
limits:
cpu: 2000m
memory: 4GiWe run security scans on every push:
# .github/workflows/security-scan.yml
- pip-audit (dependency vulnerabilities)
- bandit (code security issues)
- TruffleHog (secret scanning)
- Trivy (container scanning)Automated dependency updates:
# .github/dependabot.yml
- Weekly updates for Python packages
- Weekly updates for GitHub Actions
- Auto-create PRs for security patchesQuarterly dependency audit:
# Run audit script
python audit_dependencies.py
# Check for outdated packages
pip list --outdated
# Review licenses
pip-licenses --format=jsonIf vulnerability found:
- Assess Impact: Does it affect us?
- Check Fix: Is there a patch available?
- Update: Upgrade to fixed version
- Test: Run full test suite
- Deploy: Emergency deployment if critical
- Document: Update changelog
We follow coordinated disclosure:
- Report received → Acknowledge within 48 hours
- Validate → Confirm vulnerability within 7 days
- Fix → Develop patch within 30 days
- Notify → Inform reporter when fixed
- Coordinate → Agree on public disclosure date
- Disclose → Publish advisory and release
After fix is released:
- Security Advisory on GitHub
- CVE if applicable
- Blog Post for critical issues
- Credit to reporter (if desired)
For critical vulnerabilities (RCE, auth bypass):
- May disclose before fix if actively exploited
- Will coordinate with affected users
- Will provide workarounds if possible
- All inputs validated with Pydantic
- All database queries parameterized
- No hardcoded secrets
- Error messages sanitized
- Type hints on all functions
- Security-sensitive code reviewed
- Tests include security scenarios
- HTTPS/TLS enabled
- CORS properly configured
- Rate limiting enabled
- Secrets in vault (not env vars)
- Logs reviewed regularly
- Security updates automated
- Backup and recovery tested
- Failed authentication attempts logged
- Rate limit violations logged
- Abnormal query patterns detected
- Error rates monitored
- Security advisories subscribed
- Incident response plan ready
- Contain: Isolate affected systems
- Assess: Determine scope and impact
- Notify: Inform affected users
- Remediate: Fix vulnerability
- Review: Post-mortem analysis
- Improve: Update processes
- Project Maintainers: [To be added]
- Security Team: [To be added]
- Hosting Provider: [Cloud provider support]
We recognize security researchers who responsibly disclose vulnerabilities:
(To be populated with contributors)
docs/ARCHITECTURE.md- System architecturedocs/DEPLOYMENT.md- Secure deployment guideCONTRIBUTING.md- Secure development practices
For security-related questions:
- General: GitHub Issues (for non-sensitive questions)
- Sensitive: Email security team (for sensitive matters)
Thank you for helping keep ClimateGPT secure! 🔒
Document Version: 1.0.0 Last Updated: 2025-11-16 Next Review: 2026-02-16