AGENTFORCE-MCP-22: OAuth Token Stored With Open Permissions, Logged or Put in a URL
๐ก Medium ยท Credential Exposure
Detects MCP / agent server code that writes OAuth tokens or credentials to a file without restricting its permissions or to a path built from a caller / tenant value, logs or prints a token, or puts a token in a URL (including Salesforce frontdoor.jsp?sid=) that is redirected to, returned or logged. Token values are followed through variables, object attributes and helper calls, not matched by name alone.
Detailsโ
| Field | Value |
|---|---|
| Rule ID | AGENTFORCE-MCP-22 |
| Severity | Medium |
| Category | Credential Exposure |
| Compliance | SOC2_CC6, PCI_DSS |
Remediationโ
Store tokens in the OS keychain (keyring / keytar) or create the file with mode 0600 (os.open(path, flags, 0o600) / fs.writeFile(path, data, { mode: 0o600 })); never log token values (log a fingerprint or the last 4 characters); send tokens in the Authorization header or a POST body, not in URLs.