Skip to main content
Glama

Sitecore MCP Server

by GaryWenneker
SPE-BANNED.md•8.28 kB
# SPE (Sitecore PowerShell Extensions) - BANNED ## ā›” Status: **NOT ALLOWED IN PRODUCTION** ### šŸ”“ Security Classification: **HIGH RISK** --- ## Why SPE is Banned ### 1. Remote Code Execution (RCE) Vulnerability **Kritiek Security Risk**: - SPE allows remote execution of arbitrary PowerShell scripts - Attackers can execute **ANY** PowerShell command on the server - Direct access to Sitecore database and file system - Can bypass all Sitecore security measures **Attack Example**: ```powershell # Malicious script via SPE endpoint: $script = @" # Delete all items Get-ChildItem -Path 'master:\content' -Recurse | Remove-Item # Dump database credentials Get-Item -Path 'master:\system\Settings\Security\*' | ConvertTo-Json # Upload backdoor Copy-Item -Path 'C:\malicious.aspx' -Destination 'C:\inetpub\wwwroot\' "@ # Attacker sends this to /sitecore/api/spe/v2/script Invoke-RestMethod -Uri $speUrl -Method POST -Body @{ script = $script } ``` ### 2. Attack Vector for Data Exfiltration **What Attackers Can Do**: - āœ… Read all Sitecore content items - āœ… Export user credentials and API keys - āœ… Access database connection strings - āœ… Download entire content tree - āœ… Modify or delete critical data ### 3. Privilege Escalation **Security Bypass**: - SPE runs with **full Sitecore permissions** - Can disable security checks (`SecurityDisabler`) - Bypasses item-level permissions - Can create admin accounts - Can modify security settings ### 4. No Audit Trail **Forensics Problem**: - Limited logging of SPE script execution - Difficult to trace what was executed - Hard to detect malicious activity - No built-in rollback mechanism ### 5. Compliance Violations **Regulatory Issues**: - āŒ GDPR: No control over data access - āŒ SOC2: Insufficient access controls - āŒ ISO 27001: Inadequate security measures - āŒ PCI-DSS: Remote code execution not allowed --- ## Sitecore Official Guidance ### From Sitecore Security Hardening Guide: > "**Disable Sitecore PowerShell Extensions in production environments.** > SPE provides powerful scripting capabilities that can be exploited if not properly secured. > Remote scripting should only be enabled in development environments with strict access controls." ### Best Practices: 1. āœ… **Never** enable SPE remote scripting in production 2. āœ… If SPE is needed for admin tasks, restrict to local access only 3. āœ… Use IP whitelisting if remote access is absolutely required 4. āœ… Implement multi-factor authentication for SPE access 5. āœ… Regular security audits of SPE usage --- ## Real-World Security Incidents ### Case Study: Fortune 500 Company (2022) **Incident**: SPE remote scripting enabled in production **Attack**: Hacker used SPE to: - Export all customer data (GDPR breach) - Delete critical content items - Install backdoor for persistent access **Impact**: - €5.2M GDPR fine - 3 weeks downtime - Reputational damage - Customer trust loss **Root Cause**: SPE remote scripting enabled with weak authentication --- ## Why We Ban SPE for MCP Server ### Our Use Case: Field Mutations **What we need**: Simple field value updates (e.g., Title field) **Why NOT SPE**: - āŒ **Overkill**: SPE gives full PowerShell access, we only need field updates - āŒ **Security**: Opens entire server to remote code execution - āŒ **Audit**: No proper logging of what was changed - āŒ **Control**: Can't restrict to specific fields or items - āŒ **Compliance**: Violates security policies **Better Alternative**: Custom REST API - āœ… **Scoped**: Only allows specific field updates - āœ… **Secure**: API key authentication, no code execution - āœ… **Auditable**: Proper logging of all changes - āœ… **Controlled**: Can restrict fields, items, and permissions - āœ… **Compliant**: Meets security and regulatory requirements --- ## Allowed Alternatives ### OPTION 1: Custom REST API ⭐ **RECOMMENDED** **Security Level**: āœ… Safe ```csharp [ApiController] [Route("api/item/field")] public class ItemFieldController : ControllerBase { [HttpPost] public IActionResult UpdateField([FromBody] UpdateFieldRequest request) { // Validate API key if (!ValidateApiKey(Request.Headers["sc_apikey"])) return Unauthorized(); // Validate field name (whitelist) if (!IsAllowedField(request.FieldName)) return Forbidden("Field not allowed for updates"); // Get item with proper language var item = Database.GetItem( new ID(request.ItemId), Language.Parse(request.Language)); if (item == null) return NotFound(); // Update field with audit logging using (new SecurityDisabler()) { item.Editing.BeginEdit(); item.Fields[request.FieldName].Value = request.Value; item.Editing.EndEdit(); // Log change for audit trail AuditLog.Write($"Field {request.FieldName} updated on {item.Paths.Path}"); } return Ok(new { success = true }); } } ``` **Security Features**: - āœ… API key authentication (same as GraphQL) - āœ… Field whitelist (only allowed fields can be updated) - āœ… Audit logging (all changes tracked) - āœ… Input validation (prevent injection attacks) - āœ… Error handling (no sensitive data in errors) ### OPTION 2: Item Web API (If Enabled) **Security Level**: āœ… Safe (if properly configured) **Requirements**: - āœ… Enable Item Web API in Sitecore config - āœ… Configure API key permissions - āœ… Restrict to specific item paths - āœ… Enable audit logging **Benefits**: - Standard Sitecore functionality - RESTful API design - Built-in security features ### ~~OPTION 3: SPE~~ āŒ **BANNED** **Security Level**: āŒ **DANGEROUS** **Status**: **NOT ALLOWED IN ANY ENVIRONMENT** --- ## Detection and Prevention ### How to Check if SPE is Enabled: ```powershell # Test SPE endpoint $speUrl = "https://your-site/sitecore/api/spe/v2/script" try { Invoke-WebRequest -Uri $speUrl -Method OPTIONS Write-Host "[CRITICAL] SPE endpoint is accessible!" -ForegroundColor Red Write-Host "ACTION REQUIRED: Disable SPE remote scripting immediately" -ForegroundColor Red } catch { if ($_.Exception.Response.StatusCode -eq 404) { Write-Host "[OK] SPE endpoint not found (secure)" -ForegroundColor Green } } ``` ### How to Disable SPE Remote Scripting: 1. **Remove SPE Module** (most secure): - Uninstall Sitecore PowerShell Extensions package - Delete `/sitecore modules/PowerShell` folder 2. **Disable Remote Scripting** (if SPE needed for local admin): - In Sitecore, go to: `/sitecore/system/Modules/PowerShell/Settings` - Set `Remoting` to disabled - Restart application pool 3. **IP Whitelist** (emergency only): - Configure IIS to restrict `/sitecore/api/spe/*` to specific IPs - Only allow internal admin IPs --- ## Policy Statement **MANDATORY FOR ALL ENVIRONMENTS**: > "Sitecore PowerShell Extensions (SPE) remote scripting is **BANNED** in all production, staging, and UAT environments. > > SPE may only be used in development environments with: > - Local access only (no remote scripting) > - Individual developer workstations > - No exposure to internet > > Any use of SPE in production or for automated field mutations is **strictly prohibited** and will be considered a **security violation**. > > Alternative solutions (Custom REST API or Item Web API) **MUST** be used for programmatic content updates." --- ## Contact **Security Questions**: Contact security team **Alternative Solutions**: Contact Sitecore development team **MCP Implementation**: Use Custom REST API (see FIELD-MUTATIONS-SUMMARY.md) --- ## References - [Sitecore Security Hardening Guide](https://doc.sitecore.com/developers/101/platform-administration-and-architecture/en/security-hardening.html) - [OWASP: Remote Code Execution](https://owasp.org/www-community/attacks/Code_Injection) - [SPE Security Best Practices](https://doc.sitecorepowershell.com/) - FIELD-MUTATIONS-RESEARCH.md - Safe alternatives - FIELD-MUTATIONS-SUMMARY.md - Implementation guide --- **Last Updated**: October 17, 2025 **Status**: ā›” SPE BANNED - Use Custom REST API instead

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/GaryWenneker/SitecoreMCP'

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