← Docs

Security checks: the 25-point catalog

Every Jikida scan runs the same catalog, grouped into 25 modules and mapped to CWE, OWASP and ASVS. A surface pentest runs the checks it can see from outside your site; a deep pentest and a repo scan add the ones that need your code; the MCP server and CLI run them locally in your editor and CI. Pick a module to read exactly what it checks and how to fix each finding.

01 · CWE-798, CWE-540, CWE-200 · OWASP A02:2021, A05:2021 · ASVS V6, V14

Secrets & files

Committed keys and exposed config files are the fastest way an app is taken over. Jikida scans your repo and your live site for both.

Checks

  • .gitignore completeness. Confirm .env, *.pem, *.key, service-account JSON and *.db are ignored and not already tracked.
  • Committed secrets. Grep history and HEAD for keys: Stripe sk_live_, AWS AKIA…, GitHub ghp_, private keys and passwords.
  • Live file exposure. Request /.env, /.git/config, /config.php.bak and /.DS_Store — a 200 means the file is public.
  • Directory listing. Check that the server does not auto-index folders such as /uploads/ or /backups/.
  • Source maps in production. Confirm .map files are not shipped — they leak the original source and inline comments.

Fixes

  • Remove and rotate. Delete the secret, rotate it at the provider (removing from HEAD is not enough — it stays in history), then load it from an env var.
  • Purge history. Rewrite history with git filter-repo or BFG, then force-push. Every collaborator must re-clone.
  • Block file access. Deny dotfiles at the web server. In nginx: location ~ /\. { deny all; }. Serve only your public root.

02 · CWE-311, CWE-319, CWE-693 · OWASP A02:2021, A05:2021 · ASVS V1, V9

Network protection

Traffic that leaves the browser in clear text, or a firewall left open, exposes users and back-end services. Check both the edge and the transport.

Checks

  • TLS everywhere. Confirm HTTP redirects to HTTPS with a 301 and that no page loads over plain http://.
  • Certificate health. Check the certificate is valid, not expired, and covers the exact host — no self-signed or hostname mismatch.
  • Weak TLS versions. Disable TLS 1.0 and 1.1 and weak ciphers (RC4, 3DES). Serve TLS 1.2 and 1.3 only.
  • Open admin ports. Confirm database ports (3306, 5432, 6379, 27017) and SSH are not reachable from the public internet.
  • Mixed content. Look for images, scripts or fetch calls loaded over http:// on an HTTPS page.

Fixes

  • Force HTTPS. Redirect all HTTP to HTTPS at the edge and add HSTS: Strict-Transport-Security: max-age=31536000; includeSubDomains.
  • Close ports. Bind services to 127.0.0.1 or a private network, and put firewall rules in front of every host.
  • Modern TLS config. Adopt the Mozilla "intermediate" profile: TLS 1.2+, forward secrecy, and OCSP stapling.

03 · CWE-693, CWE-1021, CWE-79 · OWASP A05:2021 · ASVS V14.4, V14.5

Security headers

Response headers tell the browser how to defend the user. A few lines close whole classes of attack, from clickjacking to content sniffing.

Checks

  • Content-Security-Policy. Confirm a CSP is set and does not use unsafe-inline or a bare * for script-src.
  • Frame protection. Check X-Frame-Options: DENY or CSP frame-ancestors to stop clickjacking.
  • MIME sniffing. Confirm X-Content-Type-Options: nosniff is present.
  • Referrer leakage. Set Referrer-Policy to strict-origin-when-cross-origin or tighter.
  • Server banner. Remove version strings from Server and X-Powered-By that name your stack.

Fixes

  • Start with a strict CSP. Begin at default-src 'self', then add only the hosts you need. Move inline scripts to files or use a nonce.
  • Ship the core set. Add X-Frame-Options, X-Content-Type-Options, Referrer-Policy and Permissions-Policy to every response.
  • Test the result. Run a header scan after each deploy so a config change never drops a header silently.

04 · CWE-287, CWE-384, CWE-613, CWE-620 · OWASP A07:2021 · ASVS V2, V3

Auth & sessions

Login and session handling are where most account takeovers begin. Weak cookies, missing rate limits, and broken resets do the damage.

Checks

  • Cookie flags. Confirm session cookies set HttpOnly, Secure and SameSite=Lax or Strict.
  • Brute-force limits. Check that login, OTP and reset endpoints rate-limit by IP and account, and lock after repeated failures.
  • Session fixation. Confirm the session ID is regenerated on login and destroyed on logout.
  • Password policy. Look for a minimum length (12+), a breached-password check, and no silent truncation.
  • Reset token strength. Confirm reset tokens are random, single-use, and expire within an hour.

Fixes

  • Harden cookies. Set all three flags and a short idle timeout. Never store the session token in localStorage.
  • Add MFA. Offer TOTP or a passkey (WebAuthn) and require it for admin accounts.
  • Rate-limit auth paths. Add a fixed-window or token-bucket limit plus exponential back-off on failed logins.

05 · CWE-327, CWE-328, CWE-330, CWE-916 · OWASP A02:2021 · ASVS V6, V2.4

Cryptography

Home-made or outdated crypto fails quietly. The usual faults are old hashes, static IVs, and weak randomness.

Checks

  • Password hashing. Confirm passwords use bcrypt, scrypt or Argon2 — never MD5, SHA-1 or plain SHA-256.
  • Weak algorithms. Look for MD5, SHA-1, DES or ECB mode anywhere in the code.
  • Random source. Confirm tokens use a CSPRNG (crypto.randomBytes, random_bytes) — not Math.random() or rand().
  • IV and nonce reuse. Check that a fresh random IV is used per message and never hard-coded.
  • Encrypt-then-MAC. Confirm authenticated encryption (AES-GCM or ChaCha20-Poly1305) rather than raw CBC.

Fixes

  • Use a vetted library. Replace custom crypto with libsodium or your platform WebCrypto. Do not build your own primitives.
  • Upgrade hashes. Move to Argon2id for passwords and re-hash on next login. Store the parameters with the hash.
  • Fix randomness. Swap every predictable RNG for a CSPRNG when generating tokens, salts or session IDs.

06 · CWE-347, CWE-345, CWE-1270 · OWASP A02:2021, A07:2021 · ASVS V3.5

JWT security

JSON Web Tokens are easy to misuse. The classic faults are accepting <code>alg=none</code>, confusing algorithms, and never expiring a token.

Checks

  • alg=none. Confirm the verifier rejects tokens signed with alg: none or an empty signature.
  • Algorithm confusion. Pin the expected algorithm. An RS256 verifier that accepts HS256 can be forged with the public key.
  • Expiry and audience. Check that exp, iss and aud are validated, not just decoded.
  • Sensitive claims. Confirm no passwords or secrets sit in the payload — a JWT is signed, not encrypted.
  • Revocation. Look for a way to revoke a token before exp, such as a short lifetime plus a deny-list.

Fixes

  • Pin the algorithm. Pass an explicit allow-list to verify, for example algorithms: ['RS256'], and refuse everything else.
  • Short lifetimes. Issue access tokens that live minutes, with a rotating refresh token stored server-side.
  • Validate every claim. Reject a token whose exp has passed or whose aud and iss do not match your service.

07 · CWE-89, CWE-566, CWE-284, CWE-639 · OWASP A01:2021, A03:2021 · ASVS V4, V5

Database security

A database open to the world, or a rule set to allow everyone, exposes every row. Vibe-coded Firebase and Supabase projects fail here most.

Checks

  • Supabase RLS. Confirm Row Level Security is enabled on every table. A table with RLS off is fully readable through the anon key.
  • Firebase rules. Look for allow read, write: if true; — that opens the whole database to anyone.
  • Public exposure. Check the database is not reachable from the public internet and uses a strong, non-default password.
  • IDOR on records. Confirm a user cannot read another user's row by changing an ID in the URL or query.
  • Backup exposure. Check that dumps and .sql backups are not stored in a public bucket or web root.

Fixes

  • Enable RLS with policies. Turn on RLS, then add a policy such as auth.uid() = user_id so each user sees only their own rows.
  • Lock Firebase rules. Replace if true with if request.auth != null && request.auth.uid == resource.data.ownerId.
  • Scope every query. Filter by the authenticated user server-side. Never trust an ID from the client to pick the row.

08 · CWE-732, CWE-522, CWE-829 · OWASP A05:2021, A08:2021 · ASVS V1, V14

Deployment & CI/CD

The pipeline handles your most powerful credentials. A leaked CI secret or an over-privileged runner can push a backdoor to production.

Checks

  • Secrets in CI logs. Confirm tokens are masked and never echoed in build output or error traces.
  • Pull-request trust. Check that workflows from forks cannot read repo secrets, for example via pull_request_target.
  • Pinned actions. Confirm third-party CI actions are pinned to a commit SHA, not a mutable tag like @v3.
  • Least-privilege tokens. Look for a workflow token scoped to read-only unless write is truly needed.
  • Environment separation. Confirm staging and production use different credentials and cannot cross-connect.

Fixes

  • Use the secret store. Keep credentials in the CI secret manager, mask them, and rotate on any suspected leak.
  • Pin and review. Pin actions to a SHA and require review before a new third-party action enters the pipeline.
  • Scope permissions down. Set permissions: contents: read by default and grant write per job only when required.

09 · CWE-250, CWE-269, CWE-1104 · OWASP A05:2021, A06:2021 · ASVS V14.1

Docker security

Containers built as root, from stale bases, or with secrets baked in, carry those faults straight to production.

Checks

  • Running as root. Confirm the image sets a non-root USER — a container as root widens any escape.
  • Secrets in layers. Check that no ENV or COPY bakes a key or .env into an image layer, where it stays forever.
  • Base image freshness. Confirm the base image is current and scanned — pin a digest, not a floating latest.
  • Exposed sockets. Look for the Docker socket /var/run/docker.sock mounted into a container — that equals host root.
  • Capabilities and privilege. Confirm containers do not run --privileged and drop capabilities they do not need.

Fixes

  • Drop to non-root. Add USER app and a read-only root filesystem. Grant back only the capabilities you need.
  • Multi-stage builds. Build in one stage and copy only artefacts to a slim final image, so no build secret survives.
  • Scan images. Run an image scan in CI and fail the build on known critical CVEs in the base or packages.

10 · CWE-346, CWE-1385, CWE-942, CWE-352 · OWASP A05:2021, A07:2021 · ASVS V13, V3

Protocols

CORS, WebSockets and postMessage all cross origins. A loose origin check hands your API or messages to any site.

Checks

  • CORS wildcard. Confirm the API does not return Access-Control-Allow-Origin: * together with Allow-Credentials: true.
  • Reflected origin. Check the server does not echo any Origin header back as allowed — that trusts every site.
  • WebSocket origin. Confirm WebSocket handshakes validate the Origin header and authenticate the connection.
  • postMessage target. Look for postMessage(data, '*') and receivers that skip an event.origin check.
  • CSRF on state changes. Confirm POST, PUT and DELETE require a CSRF token or a checked custom header.

Fixes

  • Allow-list origins. Match Origin against a fixed allow-list and reflect only known hosts. Never pair * with credentials.
  • Check message origin. On both ends, set an exact target origin and verify event.origin before trusting the payload.
  • Authenticate sockets. Validate the origin and a token at the WebSocket handshake, not after the connection opens.

11 · CWE-918, CWE-611, CWE-1321, CWE-444 · OWASP A03:2021, A10:2021 · ASVS V5, V12

Advanced attacks

SSRF, XXE, prototype pollution and request smuggling reach past the front door into internal systems. They need targeted checks.

Checks

  • SSRF. Confirm any server-side fetch of a user URL blocks internal ranges and the cloud metadata IP 169.254.169.254.
  • XXE. Check XML parsers disable external entities and DTD loading before parsing untrusted input.
  • Prototype pollution. Look for deep merges or JSON.parse paths that let __proto__ or constructor reach the object prototype.
  • Request smuggling. Confirm the front proxy and back-end agree on Content-Length versus Transfer-Encoding.
  • Deserialization. Check that untrusted data is never passed to native deserializers like PHP unserialize or Java readObject.

Fixes

  • Contain SSRF. Allow-list destination hosts, resolve and re-check the IP, and block link-local and private ranges.
  • Disable XML entities. Turn off external entities and DTDs (LIBXML_NOENT off, disallowDoctypeDecl on) or use JSON instead.
  • Guard object merges. Reject dangerous keys, freeze the prototype, or use a Map instead of a plain object for untrusted data.

12 · CWE-89, CWE-79, CWE-78, CWE-943 · OWASP A03:2021 · ASVS V5.3

Injection

Injection is still the top web risk. Any place untrusted input meets a query, a shell, or the DOM is a target.

Checks

  • SQL injection. Confirm queries use parameters, not string concatenation. Flag "... WHERE id = " + input patterns.
  • Cross-site scripting. Look for user input written into HTML without escaping, and innerHTML or dangerouslySetInnerHTML on raw data.
  • Command injection. Check no user input reaches a shell via exec, system or backticks without strict validation.
  • NoSQL injection. Confirm query objects reject operator keys like {$gt: ''} passed from the client.
  • Template injection. Look for user input rendered as a template expression, not just as data.

Fixes

  • Parameterize queries. Replace concatenation with prepared statements: db.query('SELECT * FROM users WHERE id = ?', [id]).
  • Escape on output. Encode by context — HTML, attribute, JS or URL — and prefer textContent over innerHTML.
  • Avoid the shell. Call binaries with an argument array (execFile), never a string, and validate every input against an allow-list.

13 · CWE-362, CWE-367, CWE-366 · OWASP A04:2021 · ASVS V11.1

Race conditions

When two requests hit the same record at once, checks that looked safe can double-spend or over-issue. Concurrency needs its own review.

Checks

  • Check-then-act. Look for read-verify-write flows on balances, stock or quotas that are not atomic under parallel requests.
  • Double submission. Confirm coupon redemption, payment capture and vote actions cannot run twice concurrently.
  • Missing locks. Check that critical updates use a transaction with row locking (SELECT ... FOR UPDATE) or an atomic counter.
  • TOCTOU on files. Look for a file that is checked, then opened in a separate step, letting an attacker swap it in between.

Fixes

  • Make it atomic. Do the check and update in one statement: UPDATE accounts SET balance = balance - ? WHERE balance >= ?.
  • Lock or serialise. Wrap the critical section in a transaction with FOR UPDATE, or use a distributed lock keyed by the record.
  • Idempotency keys. Require a unique key per operation so a retried or duplicated request applies only once.

14 · CWE-434, CWE-22, CWE-646 · OWASP A01:2021, A03:2021 · ASVS V12

File upload

An upload form that trusts the client can drop a web shell or a path-traversal payload onto your server. Validate type, name, and storage.

Checks

  • Type validation. Confirm the server checks real file content, not just the extension or the client Content-Type.
  • Executable uploads. Check that .php, .jsp, .svg and double extensions cannot be uploaded to a served directory.
  • Path traversal. Look for a filename with ../ that could write outside the upload folder.
  • Malware scanning. Confirm uploads are scanned for malware before they are stored or shared.
  • Storage location. Check that uploads are stored outside the web root or on a separate host that cannot execute code.

Fixes

  • Validate and rename. Verify the magic bytes, generate a random server-side filename, and set a fixed extension you control.
  • Serve from a safe origin. Store uploads off the web root and serve them with Content-Disposition: attachment and nosniff.
  • Scan before use. Run a malware scan on upload and reject anything flagged, failing closed on scanner errors.

15 · CWE-350, CWE-290, CWE-16 · OWASP A05:2021, A07:2021 · ASVS V1.7

DNS & email

A missing SPF record lets anyone spoof your domain, and a dangling DNS record lets an attacker claim your subdomain.

Checks

  • SPF record. Confirm an SPF TXT record exists and ends in -all or ~all to limit who can send as your domain.
  • DKIM signing. Check outbound mail is DKIM-signed and the public key is published in DNS.
  • DMARC policy. Confirm a DMARC record with a policy of quarantine or reject, not just p=none.
  • Subdomain takeover. Look for CNAME records pointing to a de-provisioned service (an unclaimed bucket, Heroku app or Vercel project).
  • Open resolvers and zone transfer. Confirm the DNS server refuses AXFR zone transfers to the public.

Fixes

  • Publish the trio. Add SPF, DKIM and DMARC. Start DMARC at p=none with reports, then ramp to quarantine and reject.
  • Remove stale records. Delete DNS records that point to services you no longer own, and audit CNAMEs regularly.
  • Lock down the zone. Disable public zone transfers and restrict record changes to a small, audited set of accounts.

16 · CWE-1104, CWE-829, CWE-494 · OWASP A06:2021, A08:2021 · ASVS V14.2

Supply chain

Most of your code is other people's. A malicious or vulnerable dependency, or a typosquatted package, ships straight into your build.

Checks

  • Known CVEs. Run an audit (npm audit, pip-audit, OSV) and flag dependencies with known critical vulnerabilities.
  • Typosquatting. Check package names for look-alikes of popular libraries added by mistake or by an attacker.
  • Lockfile integrity. Confirm a committed lockfile pins exact versions and hashes, and installs use it (npm ci).
  • Postinstall scripts. Look for dependencies that run install scripts, a common malware entry point.
  • Unmaintained packages. Flag dependencies with no releases for years or a single unverified maintainer.

Fixes

  • Pin and verify. Commit a lockfile, install with integrity hashes, and reproduce builds from the pinned tree.
  • Patch or replace. Update vulnerable dependencies promptly. If unmaintained, swap for a supported alternative.
  • Generate an SBOM. Produce a software bill of materials in CI and scan it on every build to catch new advisories.

17 · CWE-312, CWE-295, CWE-919 · OWASP MASVS · ASVS V6, V9

Mobile security

Mobile apps ship to the user's device, so anything embedded can be extracted. Hard-coded keys and skipped TLS checks are the usual faults.

Checks

  • Hard-coded secrets. Confirm no API keys or credentials are compiled into the app binary, where they can be pulled from the package.
  • Insecure storage. Check tokens sit in the Keychain or Keystore, not in plain UserDefaults, SharedPreferences or a flat file.
  • TLS validation. Confirm the app does not disable certificate checks or accept any host, and consider certificate pinning.
  • Exported components. On Android, look for activities or receivers exported without permission that leak actions to other apps.
  • Debug artefacts. Confirm the release build strips logging, debug flags and test back-doors.

Fixes

  • Move secrets server-side. Fetch scoped tokens from your back-end at runtime rather than embedding a long-lived key in the app.
  • Use platform storage. Store secrets in the Keychain or Android Keystore and require device authentication to unlock them.
  • Pin certificates. Enforce TLS validation and pin your certificate or public key so a rogue CA cannot intercept traffic.

18 · CWE-359, CWE-532, CWE-311 · OWASP A09:2021 · ASVS V8, V7

Compliance & GDPR

Handling personal data carries legal duties. The common gaps are excess collection, no consent, and personal data in logs.

Checks

  • Data minimisation. Confirm you collect only the personal data you need and delete it when its purpose ends.
  • Consent and cookies. Check that non-essential cookies and trackers load only after clear opt-in consent.
  • PII in logs. Look for emails, tokens, card numbers or IPs written to application logs in clear text.
  • Right to erasure. Confirm there is a working path to export and delete a user's data on request.
  • Encryption at rest. Check that personal and sensitive data is encrypted in the database and in backups.

Fixes

  • Redact logs. Filter personal data before it reaches the log sink, and set a short retention on log storage.
  • Build erasure in. Add data-export and delete endpoints, and cascade the delete across backups and third parties.
  • Document processing. Keep a record of what you collect, why, and for how long, and gate trackers behind consent.

19 · CWE-778, CWE-223, CWE-117 · OWASP A09:2021 · ASVS V7

Monitoring & detection

You cannot respond to what you cannot see. Missing logs and no alerting turn a small breach into a long one.

Checks

  • Security event logging. Confirm logins, failures, privilege changes and admin actions are logged with a timestamp and actor.
  • Alerting. Check that spikes in failed logins, 5xx errors or new admin accounts raise an alert, not just a log line.
  • Log tampering. Confirm logs ship off-host to a store the application cannot rewrite or delete.
  • Uptime and change watch. Look for monitoring that catches downtime, a defaced page or an unexpected content change quickly.
  • Log injection. Confirm user input written to logs is encoded so it cannot forge fake log entries.

Fixes

  • Centralise logs. Ship logs to an external, append-only store with a defined retention, separate from the app host.
  • Alert on the signals. Set thresholds on auth failures, error rates and admin changes, routed to a channel someone watches.
  • Watch the live site. Add uptime and content-change monitoring so a defacement or outage pages you within minutes.

20 · CWE-284, CWE-668, CWE-269 · OWASP A01:2021, A05:2021 · ASVS V1, V14

Serverless & edge

Functions and edge workers remove servers but keep the risks. Over-broad roles, leaked env vars, and public endpoints are the usual issues.

Checks

  • Over-privileged roles. Confirm each function has a scoped IAM role, not a wildcard Action: * that can touch every resource.
  • Environment secrets. Check secrets come from a secret manager, not plain function env vars visible in the console or logs.
  • Public endpoints. Look for function URLs or API routes exposed without authentication or a rate limit.
  • Injection at the edge. Confirm edge middleware validates input the same as origin code, since it runs before your app.
  • Event-source trust. Check that events from queues, webhooks or storage are verified before they trigger sensitive work.

Fixes

  • Scope IAM tightly. Give each function only the actions and resources it needs, and separate roles per function.
  • Use a secret store. Pull secrets at runtime from a managed store and keep them out of env vars and deploy logs.
  • Authenticate every trigger. Verify webhook signatures and require auth on function URLs, with a rate limit at the edge.

21 · CWE-1006, CWE-489, CWE-561 · OWASP A04:2021, A06:2021 · ASVS V1, V10

Source-code analysis

Static analysis reads the code to find faults no live scan can reach — dead debug routes, unsafe patterns, and risky data flows.

Checks

  • Dangerous functions. Grep for eval, exec, pickle.loads and raw deserialisers reachable from user input.
  • Tainted data flow. Trace request input to a sink (query, shell, HTML) to find paths that skip validation or escaping.
  • Debug and test routes. Look for debug endpoints, console.log of secrets, or test back-doors left in the code.
  • Hard-coded config. Confirm no credentials, IPs or feature flags are hard-coded where an env var should be.
  • Insecure defaults. Check for disabled TLS checks, permissive CORS, or auth toggled off "for now" in the code.

Fixes

  • Run SAST in CI. Add a static scanner to the pipeline and fail the build on high-severity findings. Run npx @jikida/scan --repo . locally first.
  • Remove debug paths. Strip debug routes and verbose logging from release builds, and gate any diagnostic behind auth.
  • Triage, do not mute. Fix or explicitly justify each finding. Suppress only with a documented reason, not a blanket ignore.

22 · CWE-1427, CWE-77, CWE-200 · OWASP LLM Top 10 · ASVS V5, V13

AI / LLM security

Language models blur data and instructions. Prompt injection, leaked system prompts, and unchecked tool calls are the new attack surface.

Checks

  • Prompt injection. Confirm untrusted content (a web page, a document, a user field) cannot override system instructions.
  • Output handling. Check that model output is escaped or validated before it is rendered, run as code, or used in a query.
  • Tool and agent limits. Confirm tools the model can call are scoped and that risky actions need confirmation or a permission check.
  • Data leakage. Look for secrets or other users' data in the context window that the model could repeat back.
  • Rate and cost limits. Check per-user limits so a prompt loop cannot drain your quota or budget.

Fixes

  • Separate instructions from data. Keep untrusted content in a clearly marked data channel and never concatenate it into the system prompt.
  • Treat output as untrusted. Validate and escape model output like any user input before it reaches a sink or a tool call.
  • Constrain tools. Give the model least-privilege tools, add allow-lists, and require confirmation for destructive actions.

23 · CWE-770, CWE-799, CWE-307 · OWASP A04:2021, A07:2021 · ASVS V11.1

Bot & DDoS

Automated traffic scrapes data, stuffs credentials, and floods resources. Rate limits and abuse detection keep the app standing.

Checks

  • Rate limiting. Confirm expensive endpoints (login, search, export, signup) are rate-limited per IP and per account.
  • Credential stuffing. Check for defence against high-volume login attempts using leaked username and password pairs.
  • Resource exhaustion. Look for endpoints with no size or page limit that a single request can use to exhaust memory or CPU.
  • Scraping controls. Confirm public data endpoints have limits and detection for bulk automated collection.
  • CAPTCHA and challenge. Check that a challenge triggers on suspicious patterns without blocking normal users.

Fixes

  • Layer rate limits. Apply per-IP and per-account token buckets, with a global cap, and back-off on repeated abuse.
  • Add abuse detection. Score requests on velocity, IP reputation and behaviour, and step up to a challenge when a score is high.
  • Put a WAF at the edge. Filter known bad traffic and volumetric floods before they reach your origin.

24 · CWE-79, CWE-1004, CWE-451 · OWASP A05:2021 · ASVS V14.4, V3.4

Browser APIs

Powerful browser features can be turned against the user. Storage, permissions, and third-party scripts all need constraints.

Checks

  • Storage of secrets. Confirm tokens are not kept in localStorage, where any XSS can read them — prefer an HttpOnly cookie.
  • Permissions policy. Check a Permissions-Policy header limits camera, microphone, geolocation and other powerful features.
  • Third-party scripts. Confirm external scripts use Subresource Integrity (integrity) so a tampered file is rejected.
  • Clickjacking of features. Look for sensitive actions that can be framed and triggered without the user's intent.
  • Sensitive data in the DOM. Check that secrets or full card numbers are not placed into the DOM or browser history.

Fixes

  • Cookie over localStorage. Hold session tokens in an HttpOnly, Secure, SameSite cookie so scripts cannot read them.
  • Add SRI. Pin third-party scripts with an integrity hash and crossorigin, and self-host where you can.
  • Restrict features. Set a tight Permissions-Policy and frame-ancestors so features cannot be abused from a frame.

25 · CWE-451, CWE-346, CWE-693 · OWASP A05:2021, A08:2021 · ASVS V14, V1

Modern security

New platform defences close old gaps — but only when you turn them on. These are the controls a modern app should adopt.

Checks

  • Trusted Types. Check whether Trusted Types are enforced via CSP to shut down DOM-based XSS at the sink.
  • Cross-origin isolation. Confirm COOP and COEP headers are set where you use powerful APIs or need SharedArrayBuffer.
  • Cookie prefixes. Look for the __Host- prefix on session cookies to bind them to the exact origin and path.
  • Passkeys. Check whether WebAuthn passkeys are offered as a phishing-resistant login option.
  • Subresource and CSP reporting. Confirm CSP report-to is set so violations are collected and reviewed.

Fixes

  • Enforce Trusted Types. Add require-trusted-types-for 'script' to CSP and route DOM sinks through a vetted policy.
  • Adopt passkeys. Offer WebAuthn passkeys and prefer them over passwords and SMS OTP for a phishing-resistant login.
  • Turn on isolation. Set COOP same-origin and COEP require-corp, plus __Host- cookies, to harden the origin.

Four ways to run these checks

Each surface runs the relevant modules. Pick the one that fits where your code is — they share the same catalog and the same score.

Live site

Headers, TLS, exposed files, injection signals — from outside, like an attacker.

$ npx @jikida/scan yourdomain.com

Your code & repo

Committed secrets, open Supabase/Firebase rules, vulnerable deps, source-level bugs.

$ npx @jikida/scan --repo .

In your AI editor

Guard code the moment it is written — Claude Code, Cursor, Windsurf via the MCP server.

npx @jikida/init skill

In CI

Fail the build below a threshold so a risky change never ships.

$ npx @jikida/scan yourdomain.com \ --min-score 80

It advises you automatically

Once the skill or MCP server is installed, your AI editor does not wait to be asked. It steps in at the two moments a mistake is cheapest to catch:

As you write code

The moment it writes anything touching auth, a database query, an env var, a request body, a file path or an upload, it runs guard_code on that code, fixes the highest finding inline, and tells you it is clean — in the same turn.

Before you deploy

When you are about to deploy, ship, merge or make a repo public, it runs a pre-flight scan first and surfaces anything critical — a leaked .env or exposed key — before it goes live, not after. You stay free to proceed; you just decide with the facts.