/prodsec-skills:secure-token-handlingfrom prodsec-skills
Enforces secure token validation and storage for MCP servers, covering JWT signature verification, expiry checks, and encryption at rest.
Ships in prodsec-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
MCP servers MUST implement best practices for token validation and secure token storage to prevent token-based attacks.
Every incoming token MUST be validated for:
| Check | Details |
|---|---|
| Signature | Verify JWT signature against the IdP's JWKS; reject unsigned or weakly signed tokens |
Expiry (exp) | Reject expired tokens; do not allow clock skew greater than 30 seconds |
Audience (aud) | Must match the MCP server's audience identifier |
Issuer (iss) | Must match the trusted IdP issuer URL |
Not-before (nbf) | If present, reject tokens used before this time |
Token ID (jti) | Check against revocation list if token revocation is supported |
If the MCP server needs to store tokens (e.g., cached access tokens or refresh tokens for downstream services):
| Requirement | Details |
|---|---|
| Encrypt at rest | Tokens stored on disk or in databases must be encrypted |
| Memory-only when possible | Prefer in-memory token storage; avoid persisting to disk |
| Short-lived cache | Cache tokens only for the duration of their validity |
| No logging | Never log token values; log token metadata (jti, sub, exp) instead |
| Secure deletion | Clear tokens from memory when no longer needed |
# WRONG - logging the token
logger.info(f"Received token: {token}")
# WRONG - storing token in plaintext file
with open("tokens.txt", "a") as f:
f.write(token)
# CORRECT - log metadata only
logger.info(f"Token validated: sub={claims['sub']}, exp={claims['exp']}")
aud matches the MCP server's identifieriss matches the trusted IdPjti against revocation list if availablealg: none or weak signing algorithmsWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub redhatproductsecurity/prodsec-skills --plugin prodsec-skills130 skills in this plugin
/address-sanitizerAddressSanitizer detects memory errors during fuzzing. Use when fuzzing C/C++ code to find buffer overflows and use-after-free bugs.
/admin-interface-securitySecure the administrative interface of model registries. Use when building, deploying, or reviewing model registry access controls and admin interfaces./aflppAFL++ is a fork of AFL with better fuzzing performance and advanced features. Use for multi-core fuzzing of C/C++ projects.
Other plugins' skills for the same job