nextblock-security
БесплатноБез исполняемых скриптовНе проверенNextBlock's security gate. Use before finishing ANY change that touches a migration, RLS policy, GRANT/REVOKE, Postgres function or trigger, the post-apply…
от nextblock-cms★ 20 звёзд на GitHubОб этом скилле
NextBlock security gate
Every item below is a real hole that shipped at least once (2026-10-17 → 11-03). The automated gates catch most of them; the checklist covers what they cannot see. A change is not done until the gates pass and every checklist line that applies has been answered.
1. Run the gates
npm run security:check # service-role boundary, action actors, sandbox guards, HTML sinks, migration lint, posture runner guard, grant-pass lockstep, generated migration copies, Supabase CLI targets (~20 s)
npx vitest run <paths you touched>
For a migration, a policy, a grant, or anything in GRANTS_SQL, also:
npm run db:migrate:check # read-only; the new file must be listed as pending
# replay every migration into a disposable local database, then the posture gate:
SUPABASE_PROJECT_ID=nextblock-ci npx supabase start --workdir libs/db/src -x realtime,storage-api,imgproxy,kong,mailpit,postgrest,postgres-meta,studio,edge-runtime,logflare,vector,supavisor
npm run security:db-posture -- --db-url postgresql://postgres:[email protected]:54322/postgres
npx supabase stop --workdir libs/db/src --no-backup
security:db-posture runs the post-apply grant pass first (every deploy does) and fails on any
FAIL or skipped assertion; it refuses non-local hosts. Never run it, or security-verify.sql,
against production. CI (.github/workflows/security.yml) runs all of this on every push and PR,
but run it before handing work back: CI only reports after the push.
A Stop hook (.claude/settings.json → tools/scripts/claude-security-stop-hook.mjs) runs
security:check whenever a turn ends with code changes and sends you back if it fails. Fix the
cause; never weaken a check, add an allowlist entry or a grandfather entry to make it pass
without saying so to the user.
2. Checklist
Server actions and routes
- Every exported function of a
'use server'file is a public POST endpoint, reachable from any route (proxy.tsonly gates/cmsURLs). It authenticates and authorizes itself BEFORE any read:requireCmsAdmin()/requireCmsStaff()(lib/auth/cms-actor.ts),requireEcomAdmin()/requireEcomStaff()(libs/ecommerce/.../require-ecom-role.ts), CortexrequireActorRole. - Never trust an id, price, role, owner or token from the client. Re-derive ownership on the
server (order access tokens:
order-access-token.ts; UCP carts:access_token_hash). - A payment provider's browser callback is attacker-controlled. Verify every id it names with the
provider's API before storing it, and never let it set a product, plan or paid state
(
evaluateFreemiusCheckoutLicense: a guest could attach any license to their order and read its key). A page that reveals a secret (license key) re-checks that it belongs to the order. - A helper that returns the service-role client enforces the enrolled second factor, not just the
role: server actions never pass the CMS layout's 2FA redirect. Use
getCmsActor(); the ecommerce lib uses the gate the app registers (lib/auth/second-factor-gate.ts). A'use server'module never builds its own service-role client after a cookie-client role read: it takes the clientrequireCmsAdmin()returns (the package actions did not until 2026-11-13). A role read followed bygetServiceRoleSupabaseClient()is the same first-factor check: resolve the actor with a helper first, also for a public action's staff branch (the checkout success page). Gates:server-action-actors.test.ts, which since 2026-11-13 scans every'use server'module of the app and the libraries for a client built from the secret key (exceptions inOWN_SERVICE_CLIENT_ALLOWED, each with why), and every server action underapp/cmsandapp/actionsfor a role read that can reach the service role with no second-factor helper (findRoleReadsBeforeServiceRole, exceptions inROLE_READ_BEFORE_SERVICE_ROLE_ALLOWED). That second check only sees that a helper is reached, and only in those trees: check the order of the calls, and actions elsewhere, by hand. - A server action that can reach a Freemius coupon push (
syncCouponToFreemius,syncProductSaleCouponToFreemius,deleteCouponFromFreemius: signed with the developer key pair, and a coupon with no product scope applies to every product) awaitsrequireEcomAdmin()/requireCmsAdmin()before every call toward the push, as a whole statement, an initializer or a plain=assignment: never.catch()/.then()on it,void, or a check on one branch only. Reword a refusal withlet admin; try { admin = await requireCmsAdmin(); } catch { throw … }. Call pushes directly (method calls,.call/.bindand aliases are not followed) and list a new push inFREEMIUS_COUPON_PUSHES. Gate:server-action-actors.test.ts(the full rule: docs/04 → "A Freemius coupon push needs a verified admin"). - Partner portal (Affiliates): every page, action and route calls `requireRetaile
Установить nextblock-security в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл nextblock-security?
NextBlock's security gate. Use before finishing ANY change that touches a migration, RLS policy, GRANT/REVOKE, Postgres function or trigger, the post-apply grant pass, auth/2FA/roles, a server action ('use server'), an API route handler, the service-role client, uploads or server-side fetches of user URLs, webhooks, checkout/pricing/coupons/orders, Cortex tools or the MCP server, rendered HTML, or anything a 'use client' component imports. Runs the automated gates and walks the checklist of every vulnerability class found in the 2026-10 red-team.
Как установить скилл nextblock-security?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл nextblock-security запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic