[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6GXCT2TTKSGM2YV36B7N9RM":3,"skill-same:01M6GXCT2TTKSGM2YV36B7N9RM":74},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":51,"commitSha":52,"skillDirectory":53,"forksCount":54,"repositoryHtmlUrl":55,"repositoryHomepageUrl":55,"ownerHtmlUrl":56,"ownerBlogUrl":57,"ownerDescription":58,"updatedAt":59,"install":60,"resources":73},"01M6GXCT2TTKSGM2YV36B7N9RM","Authentication & Authorization Patterns",null,"Deep review of auth implementation — JWT lifecycle, OAuth flows, session management, RBAC enforcement, token storage, and common auth bypass vulnerabilities.","malayvuong\u002Fagent-orchestra","malayvuong","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F13240975?v=4","01M6GXCDVPB2VPZMDZK1KF98M0","Nguyen Minh Vuong","01M6GXCE176VDX3XV4Z4KNR33J",1,"MIT","https:\u002F\u002Fgithub.com\u002Fmalayvuong\u002Fagent-orchestra\u002Fblob\u002Fmain\u002F.agent-orchestra\u002Fskills\u002Fauth-patterns\u002FSKILL.md",[],[5,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"authentication","authorization","patterns","common","login","flows","session management","logic","deep","enforcement","session","review","password","lifecycle","OAuth","deep review","rbac","auth","storage","2026-11-10 10:12:30",false,"---\nname: Authentication & Authorization Patterns\ndescription: Deep review of auth implementation — JWT lifecycle, OAuth flows, session management, RBAC enforcement, token storage, and common auth bypass vulnerabilities.\nversion: 2026.3.1\nlicense: MIT\ntriggers:\n  lenses:\n    - security\n    - logic\n  keywords:\n    - auth\n    - jwt\n    - oauth\n    - session\n    - token\n    - rbac\n    - login\n    - password\n---\n\nWhen reviewing authentication and authorization code, apply the following checks.\n\n## JWT Implementation\n\nVerify tokens have an expiration claim (`exp`). Flag JWTs with expiration longer than 15 minutes for access tokens — use short-lived access tokens with refresh token rotation. Check that the `aud` (audience) and `iss` (issuer) claims are validated on every token verification, not just signature.\n\nFlag JWT secrets stored in code or environment variables shorter than 256 bits. Flag `algorithm: 'none'` accepted by the verification library — this is the most common JWT bypass. Verify the algorithm is pinned at verification time (`algorithms: ['RS256']`), not inferred from the token header.\n\nFlag JWTs stored in `localStorage` — they are accessible to XSS. Verify access tokens are stored in memory and refresh tokens in `httpOnly`, `Secure`, `SameSite=Strict` cookies. Flag tokens that contain sensitive data (email, roles, permissions) without encryption — JWTs are base64-encoded, not encrypted.\n\n## Refresh Token Security\n\nVerify refresh tokens are rotated on every use — the old token must be invalidated when a new one is issued. Flag refresh tokens without a family or lineage tracking mechanism — if a refresh token is reused after rotation, all tokens in the family must be revoked (token replay detection).\n\nCheck that refresh tokens have an absolute expiration (e.g., 7 days) independent of rotation. Flag refresh endpoints that do not verify the token was issued to the requesting client (device binding or client fingerprinting).\n\n## OAuth Implementation\n\nVerify PKCE (Proof Key for Code Exchange) is used for all public clients (SPAs, mobile apps). Flag the implicit grant flow — it exposes tokens in the URL fragment. Verify the `state` parameter is used and validated to prevent CSRF on the callback endpoint.\n\nCheck that the redirect URI is validated against a strict allowlist — not a prefix match or regex that could be bypassed. Flag `redirect_uri` validation that allows open redirects to attacker-controlled domains.\n\nVerify authorization codes are single-use and expire within 60 seconds. Flag OAuth token endpoints that do not validate the `client_id` matches the original authorization request.\n\n## Session Management\n\nVerify session IDs are regenerated after authentication (login) to prevent session fixation. Flag sessions that persist the pre-authentication session ID. Check that session cookies have `HttpOnly`, `Secure`, and `SameSite` flags set.\n\nVerify session expiration is enforced server-side — not just by cookie expiry. Flag sessions without idle timeout (user walks away, session stays valid forever). Check that logout invalidates the session on the server, not just deletes the client cookie.\n\n## Authorization Enforcement\n\nVerify authorization checks occur on every API endpoint, not just at the UI layer. Flag endpoints that check user role in the frontend but not in the backend — client-side role checks are decorative, not protective.\n\nCheck for IDOR (Insecure Direct Object Reference): flag endpoints where `GET \u002Fusers\u002F{id}` returns any user's data without verifying the requesting user has permission to access that specific resource. Verify object-level permissions are checked, not just role-level.\n\nFlag authorization logic scattered across controllers — centralize in middleware or policy classes. Check that default authorization is deny — new endpoints should require explicit permission grants, not default to open.\n\n## Password Handling\n\nVerify passwords are hashed with bcrypt (cost factor >= 12), scrypt, or Argon2id — never MD5, SHA-1, or SHA-256 without a salt. Flag custom password hashing implementations — use the language's standard library or a well-audited library.\n\nCheck that password reset tokens are single-use, time-limited (\u003C 1 hour), and cryptographically random (>= 128 bits). Flag password reset flows that reveal whether an email exists in the system — use a generic \"if this email exists, we sent a link\" response.\n\nVerify password strength requirements are enforced server-side, not just client-side. Flag maximum password length limits below 64 characters — these suggest the password is not being hashed (hashing produces fixed-length output regardless of input length).\n\n## Multi-Factor Authentication\n\nVerify TOTP secrets are stored encrypted at rest, not in plaintext. Flag MFA bypass mechanisms that are too easy to trigger (security questions, SMS fallback without rate limiting). Check that MFA enrollment is required for privileged accounts.\n\nVerify backup codes are single-use and hashed before storage. Flag MFA implementations that allow unlimited attempts without rate limiting or lockout.\n\nFor each finding, report: the file or endpoint, the specific auth pattern violated, the attack vector it enables, and the recommended fix.\n","When reviewing authentication and authorization code, apply the following checks.\n\n## JWT Implementation\n\nVerify tokens have an expiration claim (`exp`). Flag JWTs with expiration longer than 15 minutes for access tokens — use short-lived access tokens with refresh token rotation. Check that the `aud` (audience) and `iss` (issuer) claims are validated on every token verification, not just signature.\n\nFlag JWT secrets stored in code or environment variables shorter than 256 bits. Flag `algorithm: 'none'` accepted by the verification library — this is the most common JWT bypass. Verify the algorithm is pinned at verification time (`algorithms: ['RS256']`), not inferred from the token header.\n\nFlag JWTs stored in `localStorage` — they are accessible to XSS. Verify access tokens are stored in memory and refresh tokens in `httpOnly`, `Secure`, `SameSite=Strict` cookies. Flag tokens that contain sensitive data (email, roles, permissions) without encryption — JWTs are base64-encoded, not encrypted.\n\n## Refresh Token Security\n\nVerify refresh tokens are rotated on every use — the old token must be invalidated when a new one is issued. Flag refresh tokens without a family or lineage tracking mechanism — if a refresh token is reused after rotation, all tokens in the family must be revoked (token replay detection).\n\nCheck that refresh tokens have an absolute expiration (e.g., 7 days) independent of rotation. Flag refresh endpoints that do not verify the token was issued to the requesting client (device binding or client fingerprinting).\n\n## OAuth Implementation\n\nVerify PKCE (Proof Key for Code Exchange) is used for all public clients (SPAs, mobile apps). Flag the implicit grant flow — it exposes tokens in the URL fragment. Verify the `state` parameter is used and validated to prevent CSRF on the callback endpoint.\n\nCheck that the redirect URI is validated against a strict allowlist — not a prefix match or regex that could be bypassed. Flag `redirect_uri` validation that allows open redirects to attacker-controlled domains.\n\nVerify authorization codes are single-use and expire within 60 seconds. Flag OAuth token endpoints that do not validate the `client_id` matches the original authorization request.\n\n## Session Management\n\nVerify session IDs are regenerated after authentication (login) to prevent session fixation. Flag sessions that persist the pre-authentication session ID. Check that session cookies have `HttpOnly`, `Secure`, and `SameSite` flags set.\n\nVerify session expiration is enforced server-side — not just by cookie expiry. Flag sessions without idle timeout (user walks away, session stays valid forever). Check that logout invalidates the session on the server, not just deletes the client cookie.\n\n## Authorization Enforcement\n\nVerify authorization checks occur on every API endpoint, not just at the UI layer. Flag endpoints that check user role in the frontend but not in the backend — client-side role checks are decorative, not protective.\n\nCheck for IDOR (Insecure Direct Object Reference): flag endpoints where `GET \u002Fusers\u002F{id}` returns any user's data without verifying the requesting user has permission to access that specific resource. Verify object-level permissions are checked, not just role-level.\n\nFlag authorization logic scattered across controllers — centralize in middleware or policy classes. Check that default authorization is deny — new endpoints should require explicit permission grants, not default to open.\n\n## Password Handling\n\nVerify passwords are hashed with bcrypt (cost factor >= 12), scrypt, or Argon2id — never MD5, SHA-1, or SHA-256 without a salt. Flag custom password hashing implementations — use the language's standard library or a well-audited library.\n\nCheck that password reset tokens are single-use, time-limited (\u003C 1 hour), and cryptographically random (>= 128 bits). Flag password reset flows that reveal whether an email exists in the system — use a generic \"if this email exists, we sent a link\" response.\n\nVerify password strength requirements are enforced server-side, not just client-side. Flag maximum password length limits below 64 characters — these suggest the password is not being hashed (hashing produces fixed-length output regardless of input length).\n\n## Multi-Factor Authentication\n\nVerify TOTP secrets are stored encrypted at rest, not in plaintext. Flag MFA bypass mechanisms that are too easy to trigger (security questions, SMS fallback without rate limiting). Check that MFA enrollment is required for privileged accounts.\n\nVerify backup codes are single-use and hashed before storage. Flag MFA implementations that allow unlimited attempts without rate limiting or lockout.\n\nFor each finding, report: the file or endpoint, the specific auth pattern violated, the attack vector it enables, and the recommended fix.\n",{"name":5,"license":15,"version":43,"triggers":44,"description":7},"2026.3.1",{"lenses":45,"keywords":47},[46,26],"security",[36,48,49,29,50,35,23,31],"jwt","oauth","token","main","eac6069a8690d89fd23f08d2d14e4874ed376a77",".agent-orchestra\u002Fskills\u002Fauth-patterns",0,"https:\u002F\u002Fgithub.com\u002Fmalayvuong\u002Fagent-orchestra","https:\u002F\u002Fgithub.com\u002Fmalayvuong","www.malayvuong.com","Just a newbie at everything","2026-10-09 12:52:45",{"source":8,"skillName":5,"commands":61,"prompt":71,"zipAvailable":72},[62,65,68],{"tool":63,"command":64},"npx","npx skills add malayvuong\u002Fagent-orchestra --skill \"Authentication & Authorization Patterns\"",{"tool":66,"command":67},"bunx","bunx skills add malayvuong\u002Fagent-orchestra --skill \"Authentication & Authorization Patterns\"",{"tool":69,"command":70},"pnpm","pnpm dlx skills add malayvuong\u002Fagent-orchestra --skill \"Authentication & Authorization Patterns\"","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmalayvuong\u002Fagent-orchestra\u002Fblob\u002Fmain\u002F.agent-orchestra\u002Fskills\u002Fauth-patterns\u002FSKILL.md",true,[],[75,98,117,134,152,167],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":38},"01M6GXHYPRJ43SHFPFJTF87GS8","Vue.js Review","Deep review of Vue.js applications — Composition API patterns, reactivity traps, component design, Pinia state management, and performance pitfalls.","https:\u002F\u002Fgithub.com\u002Fmalayvuong\u002Fagent-orchestra\u002Fblob\u002Fmain\u002F.agent-orchestra\u002Fskills\u002Fvue-review\u002FSKILL.md",[],[30,82,83,84,85,86,87,88,89,34,90,91,92,93,94,95,27,26,96,97],"vue","js","Vue js Review","design","performance","component","state management","state","api patterns","applications","api","Composition","pinia","management","pitfalls","pinia state",{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":38},"01M6GXHSPDDH1PQEN61ENMCEF5","Unity Review","Deep review of Unity C# code — object pooling, Update allocation, physics patterns, UI performance, serialization, and mobile optimization.","https:\u002F\u002Fgithub.com\u002Fmalayvuong\u002Fagent-orchestra\u002Fblob\u002Fmain\u002F.agent-orchestra\u002Fskills\u002Funity-review\u002FSKILL.md",[],[30,105,100,86,106,107,34,108,109,110,111,21,112,27,26,113,114,115,116],"unity","update","code","ui","serialization","Optimization","mobile","physics","C#","mobile optimization","object","allocation",{"skillNo":118,"name":119,"nameZh":6,"description":120,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":38},"01M6GXHNKTH12CGSRWDGF2H1Q9","TypeScript Review","Deep review of TypeScript code — type safety, generics patterns, strict mode compliance, type narrowing, module boundaries, and common escape hatches.","https:\u002F\u002Fgithub.com\u002Fmalayvuong\u002Fagent-orchestra\u002Fblob\u002Fmain\u002F.agent-orchestra\u002Fskills\u002Ftypescript-review\u002FSKILL.md",[],[30,124,125,107,34,126,127,128,22,21,27,26,129,130,131,132,133],"typescript","typescript review","compliance","Type Safety","Safety","module","type","interface","consistency","mode",{"skillNo":135,"name":136,"nameZh":6,"description":137,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":138,"categories":139,"keywords":140,"publishedAt":38},"01M6GXHH3DMZD272RVH4800C67","Test Conventions","Testing patterns and conventions for code review. Covers naming, AAA structure, boundary testing, mock vs real dependencies, and coverage expectations.","https:\u002F\u002Fgithub.com\u002Fmalayvuong\u002Fagent-orchestra\u002Fblob\u002Fmain\u002F.agent-orchestra\u002Fskills\u002Ftest-conventions\u002FSKILL.md",[],[141,142,136,143,144,30,107,145,146,147,21,148,149,150,151],"test","conventions","code review","testing","testing patterns","boundary","coverage","dependencies","structure","mock","naming",{"skillNo":153,"name":154,"nameZh":6,"description":155,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":156,"categories":157,"keywords":158,"publishedAt":38},"01M6GXHCAQSJDVNVRFFD1HJWTN","Terraform Review","Deep review of Terraform\u002FOpenTofu configuration — state management, module design, security hardening, drift prevention, and production safety patterns.","https:\u002F\u002Fgithub.com\u002Fmalayvuong\u002Fagent-orchestra\u002Fblob\u002Fmain\u002F.agent-orchestra\u002Fskills\u002Fterraform-review\u002FSKILL.md",[],[30,159,154,85,46,88,89,34,160,161,162,163,128,164,95,165,166,27,26,129],"terraform","cloud","aws","hardening","Production","opentofu","iac","drift",{"skillNo":168,"name":169,"nameZh":6,"description":170,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":171,"categories":172,"keywords":173,"publishedAt":38},"01M6GXH83F11CK4BQEAJPN6HDE","Swift Review","Deep review of Swift code — memory management, concurrency patterns, optionals, protocol design, SwiftUI lifecycle, and iOS platform patterns.","https:\u002F\u002Fgithub.com\u002Fmalayvuong\u002Fagent-orchestra\u002Fblob\u002Fmain\u002F.agent-orchestra\u002Fskills\u002Fswift-review\u002FSKILL.md",[],[174,30,169,85,175,86,107,176,34,177,178,32,179,180,95,27,26,181,182,183],"swift","memory","protocol","ios","concurrency","swiftui","uikit","xcode","apple","platform"]