T09 · Insecure Skill Coding Practices
- Location
SKILL.md:134- Finding
Client PKCE Challenge Is Never Verified During Token Exchange
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is not malicious, but its OAuth examples could generate weak login protection for an MCP server.
Install only if you treat it as a starting reference, not production-ready security code. Before using its output, require exact client and redirect URI registration, enforce PKCE verifier checks, use secure token storage with revocation and rotation, and add centralized authorization tests proving protected MCP tools cannot run without valid auth.
SKILL.md:134Client PKCE Challenge Is Never Verified During Token Exchange
SKILL.md:105Dynamic Client Registration and Redirect URI Binding Are Not Enforced
SKILL.md:286Protected MCP Tool Execution Is Not Enforced by the Authentication Wrapper
SKILL.md:247Refresh Token Rotation Leaves Previously Used Tokens Valid
The manifest description says to use the skill whenever the user wants to 'add authentication', 'implement login flow', or even just says 'add auth to my MCP server' or 'my MCP server needs login'. While MCP is a domain constraint, these activation instructions are still broad and lack exclusion conditions or negative examples, which can cause unintended invocation for adjacent authentication tasks.
The authorization flow example is incomplete and under-validates OAuth inputs for a security-sensitive endpoint. It only checks presence of a few parameters and applies weak hostname-based redirect validation, while omitting stronger checks such as exact client/redirect binding, response_type validation, PKCE method enforcement, client registration lookup, and robust state/session handling; implementers may copy this into production and introduce open redirect, authorization code injection, or client impersonation flaws.
The guide recommends storing upstream access and refresh tokens for long periods in Redis without emphasizing encryption, least retention, access controls, rotation, and user consent. Because these are highly sensitive bearer credentials tied to user accounts, implementers may persist them insecurely and create account-takeover risk if Redis or logs are exposed.
The manifest and guide position the skill as adding OAuth authentication to protect MCP tools. Yet the example sets required: false and states that unauthenticated discovery is allowed, meaning the wrapper itself does not enforce authentication on requests and relies on each tool to do so correctly.
Skill grants unrestricted tool access without appropriate constraints. An agent with unfettered tool access can perform arbitrary actions including file modification, network requests, and code execution.
},
{
"id": 2,
"prompt": "My MCP server needs user authentication. Users should log in with GitHub OAuth before they can use any tools. The server is on Vercel with Next.js. I need the complete OAuth PKCE flow.",
"expected_output": "Creates the double OAuth architecture (server for MCP clients + client for GitHub), all well-known endpoints, dynamic client registration, withMcpAuth with required: false, Redis schema"
}
]