Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

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от 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.ts only gates /cms URLs). It authenticates and authorizes itself BEFORE any read: requireCmsAdmin() / requireCmsStaff() (lib/auth/cms-actor.ts), requireEcomAdmin() / requireEcomStaff() (libs/ecommerce/.../require-ecom-role.ts), Cortex requireActorRole.
  • 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 client requireCmsAdmin() returns (the package actions did not until 2026-11-13). A role read followed by getServiceRoleSupabaseClient() 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 in OWN_SERVICE_CLIENT_ALLOWED, each with why), and every server action under app/cms and app/actions for a role read that can reach the service role with no second-factor helper (findRoleReadsBeforeServiceRole, exceptions in ROLE_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) awaits requireEcomAdmin() / 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 with let admin; try { admin = await requireCmsAdmin(); } catch { throw … }. Call pushes directly (method calls, .call / .bind and aliases are not followed) and list a new push in FREEMIUS_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
Полный SKILL.md на GitHub

Установить 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), без исполняемых скриптов.

Похожие скиллы

Сравнить nextblock-security с