Pattern library

173 patterns from real production sites

Every security gap, SEO miss, and performance issue we've learned across the network. Each pattern has a trigger, a proven fix, and a confidence score. Free to browse.

Showing 19 of 19 patterns in category security
securitycritical
IF

Any endpoint that trusts client-submitted prices or totals

THEN

Always fetch menu_items fresh from DB and recompute unit_price + options + subtotal server-side; never trust client total

orders · tier 1 · 100% conf
securitycritical
IF

pre_send_3_layer_validation

THEN

Format+15 blacklist+MX DNS gondermeden once kontrol

email_validator · tier 2 · 100% conf
securitycritical
IF

imap_bounce_cleanup

THEN

IMAP mailer-daemon bounce bul DB temizle mail sil

email_validator · tier 2 · 100% conf
securitycritical
IF

email_warmup_kademeli

THEN

Kademeli artis 10-25-40-50 Gmail ban koruma

outreach_writer · tier 2 · 100% conf
securitycritical
IF

spf_dkim_dmarc_setup

THEN

SPF+DKIM+DMARC 2.7x inbox orani

outreach_writer · tier 2 · 100% conf
securitycritical
IF

bounce_3_layer

THEN

Format+blacklist+MX 3 katman validation

outreach_writer · tier 2 · 100% conf
securitycritical
IF

ufw_docker_conflict

THEN

Contabo VPS'te UFW Docker iptables ile cakisir. UFW DROP kurali docker-proxy trafigini bloke eder host'tan curl 127.0.0.1:PORT timeout. Cozum: ufw --force disable. SSH 22 disinda public port yok zaten.

vps_deployment · tier 2 · 100% conf
securitycritical
IF

ufw_smtp_imap_outgoing

THEN

UFW default deny outgoing 587 (SMTP) ve 993 (IMAP) kapali => Gmail email gonderim ve bounce kontrol calismaz. ufw allow out 587/tcp, ufw allow out 993/tcp. Veya UFW disable.

vps_deployment · tier 2 · 100% conf
securitycritical
IF

sandbox_isolation_critical

THEN

Otonom agent ana sistemi bozmasin. Docker veya Git Worktree ile izole et.

ai_agent_systems_synthesis · tier 3 · 95% conf
securityhigh
IF

pathname.startsWith('/restoran') incorrectly protects /restoran-basvuru public page

THEN

Use (pathname === '/restoran' || pathname.startsWith('/restoran/')) with explicit trailing slash

security · tier 1 · 100% conf
securityhigh
IF

Admin might accidentally delete own account or demote own role

THEN

In every admin mutation, compare target_user_id with current auth.uid(); reject if equal

admin · tier 1 · 100% conf
securityhigh
IF

Concurrent spends could allow overdraft

THEN

SELECT SUM(amount) FOR UPDATE before inserting the negative spend row

loyalty · tier 1 · 100% conf
securityhigh
IF

Concurrent order creations with same coupon code — race condition on used_count

THEN

Use SECURITY DEFINER plpgsql function with FOR UPDATE lock to atomically validate+increment

coupons · tier 1 · 100% conf
securityhigh
IF

supabase.auth.signOut() in server action after signInWithPassword verification

THEN

Use signOut({scope: 'local'}) OR use a separate verifier client with persistSession:false and skip signOut entirely

auth · tier 1 · 95% conf
securityhigh
IF

signInWithPassword verification inside server action disrupts main session cookies

THEN

Use separate anon client with {persistSession:false, autoRefreshToken:false} for password verification, then call updateUser on the main SSR client

auth · tier 1 · 95% conf
securityhigh
IF

spintax_spam_avoidance

THEN

Selam kapanis imza varyasyonu spam filtre koruma

outreach_writer · tier 2 · 90% conf
securitymedium
IF

Coupon validation (customer cart) requires SELECT access, but we don't want anyone browsing all coupon codes

THEN

Open SELECT policy (USING true) but server action still enforces domain logic (active, expiry, max_uses). Security by obscurity of codes + server validation.

security · tier 1 · 90% conf
securitymedium
IF

Wrong iyzico sandbox key copied — errorCode 1001

THEN

Sandbox dashboard → Firma Ayarları → API Anahtarları (LEFT box, not Cep POS). Real keys are exactly 40 characters.

payment · tier 1 · 90% conf
securitymedium
IF

User can spam order creation

THEN

SELECT COUNT(*) FROM orders WHERE user_id=? AND created_at > now()-60s; block if >=3

orders · tier 1 · 90% conf

Want these patterns applied to your site?

Connect your site and get personalized rules ranked for your tech stack and site type.

Scan your site free →