This lab teaches security engineers how to assess ISV-hosted remote MCP endpoints used with Agentforce, with a focus on exploitable authorization, transport, session, token, and protocol misconfiguration risks in endpoint-only testing scenarios.
Executive Summary
When source code is unavailable, remote MCP servers must be assessed as API-like attack surfaces. Security reviewers should evaluate Streamable HTTP and HTTP+SSE endpoints with OWASP Top 10 thinking, then raise findings only when misconfigurations are demonstrably exploitable.
This lab emphasizes practical pentest validation over tool-only output. DAST/SAST can assist coverage, but reviewer-driven exploitation and contextual impact analysis remain mandatory.
Salesforce Attack Surface
MCP transport endpoints: Streamable HTTP and HTTP+SSE protocol surfaces
JSON-RPC message handlers: tools and resources invocation boundaries
AuthN/AuthZ layers: OAuth, API keys, token audience validation, and role controls
Session lifecycle: session ID generation, binding, replay and resumable stream behavior
Server misconfiguration controls: CORS, TLS, cache headers, error handling and logging hygiene
Business Impact
Unauthorized tool execution: privileged actions triggered outside intended user scope
Data leakage: secrets, tokens, and sensitive records exposed through weak controls
Privilege escalation: over-broad connectors and missing segmentation amplify compromise
Session compromise: hijacked or replayed sessions drive malicious resumed responses
Token hygiene: no tokens in URLs, no passthrough without audience validation, secure storage and expiry
Transport hardening: modern TLS-only posture, origin checks, and safe CORS policies
Observability controls: generic error responses, sensitive data redaction, and abuse-focused logging
// Example defensive session key strategy
// queue_key = <derived_user_id> + ":" + <secure_random_session_id>
// Reject if caller context does not match bound user identity.
Verification Checklist
Endpoint inventory covers both Streamable HTTP and HTTP+SSE routes
AuthN/AuthZ behavior validated against data sensitivity and user context
No sensitive tokens in URLs, logs, or publicly cacheable responses
Session replay and resumable-stream abuse cases are mitigated
TLS/CORS/error-handling posture verified against exploitable misconfiguration paths
Findings include reproducible evidence and concrete business impact
Lab Exercises
Follow this sequence to execute an endpoint-only MCP security assessment:
Exercise 1: Build endpoint and protocol map from ISV documentation and traffic observations
Exercise 2: Validate authentication, authorization, and privilege segmentation controls
Exercise 3: Test token/session abuse scenarios including replay and resumable stream attacks
Exercise 4: Validate injection, sensitive-data, TLS, and CORS misconfiguration exploitability
Exercise 5: Produce reviewer-grade report with evidence, severity rationale, and remediation guidance