Skip to main content
Glama
SECURITY_AUDIT_REPORT.md8.26 kB
# Security Audit Report - Hostaway MCP Project **Audit Date:** October 15, 2025 **Auditor:** Security Audit Tool **Repository:** hostaway-mcp **Severity Levels:** CRITICAL | HIGH | MEDIUM | LOW --- ## Executive Summary A comprehensive security scan using Gitleaks has identified **118 potential secrets** exposed in the git history. The most critical findings include: - **6 JWT tokens** (Supabase service keys) - CRITICAL - **61 API keys** in various files - HIGH - **51 authentication headers** in curl commands - MEDIUM - **.env file exists** in repository (should be gitignored) - HIGH ## Critical Findings ### 1. Supabase Service Keys (JWT) - CRITICAL **Severity:** CRITICAL **OWASP Category:** A02:2021 - Cryptographic Failures **Exposed Secret Pattern:** ``` eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImlpeGlrYWpvdmlibWZ2aW5rd2V4Iiw... ``` **Affected Files:** - ROOT_DEPLOY_COMMANDS.sh - QUICK_DEPLOY.sh - HOSTINGER_FILE_MANAGER_DEPLOY.md - deploy-to-hostinger.sh - auto-deploy.sh - DEPLOYMENT_GUIDE.md **Risk:** These are Supabase service role keys with full administrative access to the database. If compromised, an attacker could: - Read/write/delete all database data - Bypass Row Level Security (RLS) policies - Access all user credentials stored in Supabase Vault - Perform administrative operations **Remediation:** 1. **IMMEDIATE:** Rotate all Supabase service keys in the Supabase dashboard 2. Remove all hardcoded keys from deployment scripts 3. Use environment variables loaded from secure secret management 4. Never commit service keys to version control ### 2. API Keys in Scripts - HIGH **Severity:** HIGH **OWASP Category:** A07:2021 - Identification and Authentication Failures **Exposed Keys:** - `mcp_Quyj29roULrQZc3ICrGmUcP31Px8Ntk` (MCP API key) - Various test keys in documentation **Affected Files:** - ROOT_DEPLOY_COMMANDS.sh - QUICK_DEPLOY.sh - HOSTINGER_FILE_MANAGER_DEPLOY.md **Risk:** API keys provide authenticated access to the MCP service. Exposure could lead to: - Unauthorized API usage and potential billing charges - Data access through the MCP endpoints - Rate limit exhaustion attacks **Remediation:** 1. Regenerate all API keys 2. Move keys to secure environment configuration 3. Use placeholder values in documentation 4. Implement key rotation schedule ### 3. .env File in Repository - HIGH **Severity:** HIGH **OWASP Category:** A05:2021 - Security Misconfiguration **Issue:** The .env file exists in the repository and may contain production credentials. **Remediation:** 1. Remove .env from repository: `git rm --cached .env` 2. Ensure .env is in .gitignore 3. Use .env.example with placeholder values 4. Document required environment variables without exposing actual values ## Medium Risk Findings ### 4. Credentials in Documentation - MEDIUM **Severity:** MEDIUM Multiple documentation files contain example credentials that could be mistaken for real ones: - curl commands with authentication headers - Example API keys in quickstart guides - Bearer tokens in API documentation **Remediation:** 1. Use clearly fake placeholders (e.g., `YOUR_API_KEY_HERE`, `<PLACEHOLDER>`) 2. Add warnings in documentation about not using real credentials 3. Consider using environment variable references in examples ## Security Recommendations ### 1. Immediate Actions (Within 24 Hours) - [ ] **Rotate ALL Supabase keys** through Supabase dashboard - [ ] **Regenerate all API keys** for the MCP service - [ ] **Remove .env file** from git tracking - [ ] **Review and secure** production deployments ### 2. Short-term Actions (Within 1 Week) - [ ] Implement secret scanning in CI/CD pipeline - [ ] Set up pre-commit hooks to prevent secret commits - [ ] Audit all deployment scripts for hardcoded credentials - [ ] Implement secure secret management solution ### 3. Long-term Security Improvements - [ ] Implement HashiCorp Vault or AWS Secrets Manager - [ ] Set up automated secret rotation - [ ] Implement comprehensive logging and monitoring - [ ] Regular security audits (quarterly) ## Secure Implementation Patterns ### Environment Variable Management ```bash # Use .env.example for documentation SUPABASE_URL=https://your-project.supabase.co SUPABASE_SERVICE_KEY=<service-role-key-here> MCP_API_KEY=<your-mcp-api-key> # Load from secure source in production source /secure/path/to/secrets.sh ``` ### Deployment Script Pattern ```bash #!/bin/bash # Check for required environment variables required_vars=("SUPABASE_URL" "SUPABASE_SERVICE_KEY" "MCP_API_KEY") for var in "${required_vars[@]}"; do if [[ -z "${!var}" ]]; then echo "Error: $var is not set" exit 1 fi done ``` ### Pre-commit Hook Configuration ```yaml # .pre-commit-config.yaml repos: - repo: https://github.com/gitleaks/gitleaks rev: v8.18.0 hooks: - id: gitleaks ``` ## Compliance Checklist ### OWASP Top 10 Coverage - [x] A02:2021 - Cryptographic Failures (JWT exposure) - [x] A05:2021 - Security Misconfiguration (.env file) - [x] A07:2021 - Identification and Authentication Failures (API keys) - [ ] A04:2021 - Insecure Design (needs architecture review) - [ ] A08:2021 - Software and Data Integrity Failures ### Security Headers Configuration ```python # Recommended security headers for FastAPI from fastapi.middleware.cors import CORSMiddleware from fastapi.middleware.trustedhost import TrustedHostMiddleware app.add_middleware( CORSMiddleware, allow_origins=["https://your-domain.com"], allow_credentials=True, allow_methods=["GET", "POST"], allow_headers=["*"], ) app.add_middleware( TrustedHostMiddleware, allowed_hosts=["your-domain.com", "*.your-domain.com"] ) @app.middleware("http") async def add_security_headers(request, call_next): response = await call_next(request) response.headers["X-Content-Type-Options"] = "nosniff" response.headers["X-Frame-Options"] = "DENY" response.headers["X-XSS-Protection"] = "1; mode=block" response.headers["Strict-Transport-Security"] = "max-age=31536000; includeSubDomains" response.headers["Content-Security-Policy"] = "default-src 'self'" return response ``` ## Testing Security Scenarios ### Test Cases for Security ```python # tests/test_security.py import pytest from fastapi.testclient import TestClient def test_api_key_required(): """Test that API endpoints require authentication""" response = client.get("/api/v1/protected") assert response.status_code == 401 def test_invalid_api_key(): """Test that invalid API keys are rejected""" response = client.get( "/api/v1/protected", headers={"X-API-Key": "invalid_key"} ) assert response.status_code == 401 def test_sql_injection_prevention(): """Test SQL injection prevention""" malicious_input = "'; DROP TABLE users; --" response = client.get(f"/api/v1/listings/{malicious_input}") assert response.status_code == 422 # Invalid input def test_rate_limiting(): """Test rate limiting is enforced""" for _ in range(101): # Exceed rate limit response = client.get("/api/v1/listings") assert response.status_code == 429 ``` ## Affected Commits The following commits contain exposed secrets and should be considered compromised: 1. **ff46343e** (Oct 14, 2025) - Multiple secrets in deployment scripts 2. **ad0487a0** (Oct 12, 2025) - Example credentials in documentation 3. **f1e631e2** (Oct 12, 2025) - API keys in quickstart guides ## Next Steps 1. **Immediate Response Team Meeting** - Assess impact and coordinate response 2. **Credential Rotation** - Systematic rotation of all exposed credentials 3. **Security Training** - Team training on secure coding practices 4. **Implement Security Tools** - Automated scanning and prevention 5. **Incident Response Plan** - Document and test response procedures ## References - [OWASP Top 10 2021](https://owasp.org/Top10/) - [Gitleaks Documentation](https://github.com/gitleaks/gitleaks) - [Supabase Security Best Practices](https://supabase.com/docs/guides/security) - [12 Factor App - Config](https://12factor.net/config) --- **Report Generated:** October 15, 2025 **Next Review Date:** October 22, 2025 **Classification:** CONFIDENTIAL - INTERNAL USE ONLY

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/darrentmorgan/hostaway-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server