convex-authz
Skill này làm gì
Skill này kiểm tra app Convex xem có lỗi kiểm soát truy cập phổ biến nào không và sửa chúng. Skill dành cho người xây app muốn chắc rằng người dùng chỉ truy cập được dữ liệu của chính họ.
Khi nào nên dùng
- ✓Khi bạn muốn kiểm tra người dùng không thể xem hoặc sửa dữ liệu của người khác trong app Convex.
- ✓Khi bạn sắp ra mắt một app lưu thông tin riêng tư của người dùng.
- ✓Khi có người hỏi ai có thể truy cập một dữ liệu và bạn cần một câu trả lời rõ ràng.
Liên kết skill
https://github.com/openclaw/clawhub/blob/main/.agents/skills/convex-authz/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Kiểm tra app Convex của tôi để đảm bảo người dùng chỉ xem được dữ liệu của chính họ.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent quét code tìm một số mẫu rủi ro đã biết, thêm các kiểm tra quyền sở hữu tiêu chuẩn ở nơi còn thiếu, rồi chạy kiểm tra kiểu dữ liệu để xác nhận các thay đổi biên dịch được.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Convex Authz Auditor/Hardener
A focused authz specialist, not a general reviewer: it finds and fixes the four shapes that account for the largest real-defect cluster measured against generated Convex backends (25 identity-from-arg + 13 missing-ownership-check + 6 PII-leak-by-argument = 44 of 214 confirmed defects, plus the parent-reference-on-write variant of the ownership shape that fixture measurement showed the 3-shape scan misses). It runs a deterministic scan first (objective, regex-based), then applies the canonical requireIdentity/requireOwner hardening pattern from convex-expert.md to every hit, then verifies with tsc. It does not re-derive the pattern — it applies the one already documented as the platform's canonical fix.
Workflow
- MANDATORY FIRST STEP — check the auth foundation exists before injecting any ctx.auth enforcement: (1) is there an auth.config.ts with a provider? (2) is there a users/identities table keyed to the auth subject (tokenIdentifier/identity.subject)? If EITHER is missing, DO NOT add requireIdentity/requireOwner — on a foundationless app ctx.auth.getUserIdentity() always returns null (enforcement is non-functional: every call 401s, or worse, the check is bypassed/miscompared against a non-subject field like an email string) and a reviewer correctly flags that as a NEW authz defect, not a fix. Instead, on a foundationless app: (a) for privileged/admin operations, convert the public query/mutation to internalQuery/internalMutation (removes public reachability entirely — safe and foundation-free, no ctx.auth needed), and (b) tell the user: 'this app has no auth foundation; run
/add author the auth setup first, then re-run convex-authz to add per-user ownership checks.' Do not run steps 1-3 below against public functions on a foundationless app beyond this internalize-and-defer move. Only when the foundation exists (both auth.config.ts and a subject-keyed users table are present) do you proceed to inject requireIdentity/requireOwner in steps 1-3. - SCAN (deterministic, objective-first): for every convex/**/*.ts file (skip convex/_generated/ and .d.ts), grep for the four shapes:
(a) identity-from-arg: a public
query(/mutation(object whoseargsblock declaresuserId/actorId/ownerId/authorId/accountIdtypedv.id(...), where the function's whole block (args + handler) has zeroctx.authreference. Regex:/\b(userId|actorId|ownerId|authorId|accountId)\s*:\s*v\.id\(/inside anargs: { ... }block paired with an absent/\bctx\.auth\b/anywhere in the enclosing(query|mutation)\(\s*\{ ... }block (word-boundary excludes internalQuery/internalMutation by construction). (b) missing-ownership-check: a publicquery(/mutation(whose handler loads a document viactx.db.get(args.<xId>)(an_id-typed arg) and then callsctx.db.patch/ctx.db.delete/ctx.db.replaceon that same id, or returns the doc's fields directly, with no comparison of any<doc>.<ownerField>against an identity value anywhere in the block (no===/!==involvingidentity.subjector actx.authderived value). (c) PII-leaking public query: a publicquery(whosereturns(or the raw doc it returns) includes a sensitive-looking field (email,revenue,ssn,password,token,auditLog,dashboard-shaped aggregate) and the query is parameterized by a client-supplied id with noctx.authcheck gating access to that id's own scope. (d) parent-reference ownership on write: a publicmutation(whose args include av.id(...)of a parent/container table (projectId,boardId,teamId,orgId,listId,folderId,conversationId,accountId, ...) that the handler uses as a foreign key in actx.db.insert/ctx.db.patch— attaching or moving a child row into that container — without verifying the caller owns (or is a member of) the referenced parent doc. Creating a row inside someone else's container is the same defect as mutating their row: fixing WHO the caller is (shape a) does not fix WHERE they may write. After handling shapes a-c, re-audit every REMAININGv.id(...)arg in every public mutation for this shape — shape-a fixes routinely leave the parent id arg behind, still unchecked. Report every hit with file, line, and which of the 4 shapes matched — this is the objective, model-independent baseline; do not skip it in favor of jumping strai
Câu hỏi thường gặp
Skill này có cần thiết lập đăng nhập trước không?
Có. Skill kiểm tra trước xem có nhà cung cấp xác thực và bảng users hay chưa, vì kiểm tra quyền truy cập không hoạt động nếu thiếu chúng.
Skill tìm những loại vấn đề nào?
Nó tìm các function tin tưởng user id do client gửi lên, thiếu kiểm tra quyền sở hữu, truy vấn công khai làm lộ dữ liệu theo id, và ghi vào các bản ghi mà người dùng không sở hữu.
Skill có thay thế việc rà soát bảo mật đầy đủ không?
Không. Skill nhắm vào một nhóm lỗi phổ biến, nên một đánh giá rộng hơn vẫn có thể đáng làm trước khi ra mắt.
Chi tiết
Mô tả gốc của tác giả
Audit and harden a Convex app's authorization: identity-from-arg impersonation, missing per-document ownership checks, public queries leaking data by a client-supplied id, and writes into a parent/container the caller doesn't own. Scans for the 4 shapes, applies requireIdentity/requireOwner, verifies with tsc. TRIGGER on 'secure my app', 'audit auth/authz', 'who can access this data'. SKIP when there is no convex/ directory.
repo: openclaw/clawhub
Độ phổ biến
- Sao GitHub
- 9.5k
- Vị trí xếp hạng
- #12235
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
axiom-alerting
9.5kGiúp agent của bạn tạo và quản lý monitor cùng các tuyến thông báo của Axiom qua API Axiom, và kiểm tra cảnh báo hoạt động đúng như mong đợi.
axiom-sre
9.5kGiúp agent của bạn điều tra sự cố và lỗi production từng bước, kiểm tra mỗi giả thuyết với log Axiom trước khi đưa ra kết luận.
building-dashboards
9.5kGiúp agent của bạn thiết kế dashboard Axiom với biểu đồ, truy vấn và bộ lọc phù hợp, bắt đầu từ các quyết định mà dashboard phải hỗ trợ.
controlling-costs
9.5kGiúp agent của bạn tìm dữ liệu không dùng đến trong Axiom và xây dựng dashboard cùng monitor để theo dõi và giảm chi phí ghi log.
Skill tương tự
reverse-engineer-anything
422kGiúp agent của bạn xem bên trong các app và package đã phát hành để giải thích tính năng, so sánh phiên bản hoặc hướng dẫn dựng lại bằng công cụ REA.
1password
394kGiúp agent của bạn cài đặt CLI của 1Password, đăng nhập, và đọc hoặc đưa thông tin bí mật vào mà không in giá trị ra cuộc trò chuyện.
healthcheck
394kGiúp agent của bạn rà soát bảo mật máy tính hoặc máy chủ đang chạy OpenClaw, như SSH, tường lửa, cập nhật và sao lưu, rồi đề xuất cách sửa an toàn.