RIKKY ROY KOGANTIAtlas of curiosityKyrodigm

Notebook / Building apps

Website security and visitor privacy

Check public builds for secrets, keep private pages out of shared caches, and protect visitors from harmful scripts, account takeover, and unsafe AI access.

Five ways visitor data can be exposed

A key in the published build
Check scripts, source maps and downloadable files. Keep keys that read private data or spend money on the server.
A third-party embed
Check what leaves the browser on a fresh visit. Video, maps and analytics may send data before anyone signs in.
A shared cache
Open a private page with one test account, then check another account and signed-out access. Include downloads.
A second hostname
Check that preview URLs and direct hostnames protect the same private pages and files as the main domain.
A password reset or support request
Test account recovery and session revocation. Give users a known place to verify alerts and report suspicious contact.

Scope. These are engineering checks for static websites and signed-in web apps. Even a site without accounts has a public build, hosting logs, and people who can publish. Use the web legal guide to check when privacy notices, visitor choices, or breach notices are required.

All website and web app references

What to check before launch

Start with three checks. Inspect the actual build for private files and keys. Follow a fresh visit to see which providers receive data. If anyone signs in, verify that one test account cannot see another’s records, including through the cache.

  • Secrets and the public build
    • Inspect what you deploy. Check HTML, JavaScript, downloads, source maps, and preview builds for exposed keys. Check hidden files in the upload folder for .env and .dev.vars. Build and key checks.
    • Check what each key can do. Keep keys that can read private data, spend money, or publish changes on the server or in the release system. Keys and leak response.
    • Verify dependencies. Check what you install, record the versions you deploy, and know how to contain a bad release. Dependency checks.
  • Publishing access and private previews
    • Secure publishing. Require MFA, preferably passkeys or security keys, for people who control the domain, repository, host, or release.
    • Check direct access. Verify HTTPS and test while signed out. Check the main site, hosting provider URLs, previews, and direct file links for any route that skips your access rules. Direct access checks.
  • Visitor data and outside scripts
  • Accounts, recovery, and official support
    • Test the recovery path. Verify what happens when a user loses access, changes a recovery method, or revokes a compromised session. Protect sensitive changes with fresh verification.
    • Make support verifiable. Give users a known place on your site to check alerts and report scams. Support should never ask for a password or one-time code. Account takeover and scam checks.
  • Private pages and files
    • Enforce access on the server. Check the signed-in user’s access to the exact record, file, or action. Protect session cookies and use separate accounts to test the boundaries.
    • Test after the cache is warm. Load a private page, then check from a different account and signed out. Include downloads and offline caches if used. Authorization and caching checks.
  • Forms, uploads, and payments
    • Validate inputs on the server. Limit sizes and rates. Keep private uploads behind access checks, and safely render visitor-provided content.
    • Verify payment events. Confirm the provider’s message, amount, and ownership before granting access. Test repeated and late events. Input and payment checks.
  • AI features and coding agents
    • Inside the site. Limit the data and actions an AI feature can access. Put permission and approval checks in your backend.
    • While building. Give coding agents a scoped workspace with test data. Review changes to dependencies, access rules, and deployment configuration. AI security checks.
  • Abuse limits and recovery
    • Cap costly operations. Limit repeated sign-ins, verification texts, uploads, exports, and paid API calls. Watch for unusual usage and spending.
    • Rehearse recovery. Know who can revoke sessions and keys, pause a feature, roll back the site, and restore data. Abuse and recovery checks.

Engineering references checked November 21, 2026. Use OWASP ASVS for a broader application review and the OWASP API Security Top 10 for services.

How to verify each check

Find exposed keys and contain leaksCheck the files a visitor gets, the services the keys can reach, and who can revoke them.
  • Separate browser settings from privileged credentials. A public client identifier or a provider-approved publishable key can appear in the browser under the provider’s documented restrictions. Keep database admin credentials, payment webhook secrets, and privileged AI keys on the server. Settings such as Astro’s PUBLIC_SUPPORT_URL or Vite’s VITE_SUPPORT_URL can hold a public link. Values exposed to the browser can end up in the built files even when .env is in .gitignore. Check generated JavaScript and any settings rendered into HTML. Astro environment variables · Vite environment variables · Gemini key guidance.
  • Check the upload folder for private files. Inspect the folder your host will serve, such as dist/, including hidden files and subfolders. Fail the deploy if it contains .env, .dev.vars, variants like .env.production, or other private configuration. Scan the same folder for secrets embedded in generated files. Static deployment checks.
  • Put paid or privileged requests behind a permission check. Use browser → your backend → provider for these calls. Your backend checks the user, allowed action, and usage limit before making the call. Use separate test and production credentials. Prefer short-lived service credentials where supported and give each service only the access it needs.
  • Look beyond Git. Scan repository history, generated assets, public source maps, deployment logs, and build artifacts. Check preview deployments and old build links too. Use secret scanning and push protection where available. Give each live key a named owner and a revocation path. GitHub secret scanning.
  • If a privileged key leaks. Revoke it at the provider promptly. If you need to keep the service running, issue a restricted replacement, switch callers to it, then verify the old key is disabled. Review provider access logs and charges, and preserve evidence before cleanup. Remove the exposed value from public files, builds, caches, and logs you control. Visitors may still have copies of earlier files. GitHub leaked-secret response.
Verify frameworks, packages, and build toolsKnow what runs in the build, on the server, and in the visitor’s browser.

The November 2026 Microsoft Agent Framework incident involved malicious versions published under a legitimate package name. A compromised dependency can affect a developer machine or build job before any code reaches the website. November 18 GitHub advisory · Mandiant’s build-pipeline guidance.

  • Verify the package and its publisher. Check the exact package name, publisher, and registry against the maintainer’s official docs. Do the same for framework plugins, editor extensions, and tool connectors an AI agent suggests. Review the added code and what it will run before allowing installation. A coding model can suggest a package name that never existed. USENIX study of package suggestions.
  • Keep install and build access separate from deploy access. Build from a committed lockfile and review changes to direct and indirect dependencies and their install scripts. Install and test in an isolated environment without production credentials or private data. Protect the deployment step separately and scope its credentials to the release job. GitHub Actions secure use · Mandiant’s build-pipeline guidance.
  • Record what was deployed. Keep resolved framework, server runtime, and package versions against each release. Include code the browser loads separately, such as a vendor script or tag-manager change. Practice using a vendor advisory to identify which releases, previews, or servers still run an affected version. Verify a fix against the live release after rebuilding and deploying. OWASP software supply chain guidance.
  • Rehearse a compromised-package response. Pause affected builds and isolate the machine or build runner that ran the package. Check which credentials and sessions it could reach, revoke affected access, and preserve evidence. Determine whether a compromised build was deployed. Rebuild from reviewed versions in a clean environment, then verify the recovered build and disable any affected browser-side script. Mandiant’s containment guidance.
Protect the domain, builds, and preview URLsA brochure site still has a publishing pipeline and public files.
  • Control who can publish. Use phishing-resistant MFA where supported for domain, DNS, repository, and hosting accounts. Keep recovery options secured and review who can change deployment settings. Separate preview settings and data from production. CISA phishing-resistant MFA guidance.
  • Check alternate access routes. Use your hosting dashboard to list default hostnames, preview URLs, and direct storage links. In a signed-out browser, verify that private pages, files, and admin or debug tools are blocked on each route. Search indexing controls leave a URL reachable. If a CDN or access proxy enforces protections your site relies on, restrict the server behind it to approved traffic and disable unused public entry points. Cloudflare origin protection · Cloudflare Workers preview access.
  • Retire old web entrances. Keep a list of the public domains, provider-generated hostnames, previews, and API versions you still use. Before retiring a hosted service, remove or repoint its DNS records to a resource you control. Retire unused previews and API versions after intended clients have moved. Verify that old URLs now redirect to a controlled destination or no longer serve the old content. Microsoft’s guidance on dangling DNS · OWASP API inventory guidance.
  • Check browser security headers on real responses. Use HTTPS and redirect HTTP. Choose a Content Security Policy (CSP) that limits what the browser can load. Exercise the intended pages with report-only first where useful, then verify the enforced policy. Configure framing restrictions, a referrer policy, and X-Content-Type-Options: nosniff. Consider HSTS after confirming affected hostnames are ready for HTTPS. Check errors, redirects where relevant, and dynamic routes as well as the homepage. CSP guidance · HSTS.
Review scripts that run on sign-in, account, and checkout pagesA script added by an analytics tool, ad network, or tag manager can affect what visitors see or send.
  • Inventory scripts by page. Load a deployed preview and inspect the scripts it downloads, including ones loaded by a tag manager. Record the owner and purpose. Drop unnecessary scripts from sensitive pages. Restrict who can publish tag-manager changes and remove unused tags and integrations. OWASP third-party JavaScript guidance.
  • Limit what trusted vendors can affect. Code loaded directly into a page runs with that page’s access. Where practical, isolate the feature in a separate-origin frame with only the capabilities it needs. For stable, versioned third-party files, Subresource Integrity lets the browser check that the downloaded file matches the version you approved. Use CSP to limit loads and know how to disable a vendor or roll back if something changes. Subresource Integrity standard · OWASP CSP guidance.
  • Review the checkout the visitor actually sees. Prefer a provider-hosted checkout where it fits. If a page runs payment scripts or embeds a payment frame, ask your provider or acquiring bank which PCI DSS checks apply to that integration. Review who can change the scripts and how unexpected changes to checkout would be detected. PCI SSC guidance on payment pages and e-skimming.
Run a privacy audit on a site without accountsFollow a first visit, a contact request, and an optional embed from the browser to the services that receive the data.

Example. A small portfolio has an email link and a click-to-load video. Start with these checks and skip flows your site does not offer.

  • First visit. In a fresh browser session, open the Network panel, reload, and note the domains the page contacts before any click. Check cookies and local storage too. In the hosting dashboard, verify which request or security logs are kept, who can see them, and when they expire. Include private preview sign-in logs if you run previews. Chrome DevTools Network.
  • Contact. For an email link, check the destination mailbox, who can read or forward messages, and when old messages are removed. If you offer a form, trace a synthetic submission in a test environment through notifications, the form provider, and any connected spreadsheet or CRM. Check whether spam protection sends requests before submission. Keep the fields you need and link the relevant privacy notice at the form.
  • Optional embeds. Compare browser requests before and after activating the video or map. If you offer a choice to leave it off, reload after declining and confirm the provider stays unloaded. Give visitors a useful fallback such as a plain link.
  • Retention and migration. For each data flow, record what is received, why, by whom, how long it is kept, and who handles deletion or access requests. Check copies in old site builders and inboxes when replacing a site. Compare the written notice with those findings. Canadian privacy regulator’s principles · When privacy laws apply.
Verify privacy choices, recordings, and logsCheck what the browser and the server send, where it goes, and when it is deleted.
  • Test the choice end to end. Separate essential session and security features from analytics, ads, and optional embeds. With a fresh browser, check initial load, rejection, acceptance, preference changes, and a return visit. Inspect both browser requests and server-side events. Where a recognized opt-out signal applies, verify that the relevant sharing or sale controls also respect it. A cookieless tool can still send personal information. Global Privacy Control · California opt-out guidance · Canadian OPC behavioural advertising guidance.
  • Check the data before it leaves. Exclude sensitive pages from session replay by default. Verify masking with test data before sending forms or events to any vendor. Check request paths and query strings, referrers, error reports, screenshots, and exported network logs for credentials or private content. Use synthetic data in shared diagnostics, and keep real logs and recordings access-limited with a retention period. OWASP logging guidance · Chrome network log exports.
  • Test deletion across providers. Follow a sample record into storage, search, email, exports, and enabled analytics or AI tools. Verify what is deleted immediately, what expires later, and how deletion and access changes are applied after restoring older data. Keep backups encrypted and accessible only to people who need them. See the legal and privacy guide for when deletion duties apply.
Prove private pages, sessions, and caches stay privateUse separate browser profiles to check what two accounts and a signed-out visitor can see.
  • Use established session handling. Choose a maintained identity provider or framework library. For cookie-based sessions, set Secure, HttpOnly, and a SameSite setting that fits your sign-in flow. Keep cookies scoped to the host where possible, keep session tokens out of browser storage accessible to JavaScript where your architecture permits, and renew the session after sign-in or a privilege change. Verify the server ends access and token renewal when a session is revoked. OWASP session guidance.
  • Check every route to a record. Enforce access to the exact organization, account, or item on the server, including list views, links to files, staff tools, exports, and background jobs. Check database or storage rules for browser-accessible services. Issue private download links only after checking access. Know whether links already sent can still work until they expire. Use test accounts in different organizations and remove one member to verify offboarding. OWASP ASVS · OWASP API Security.
  • Apply permission changes to work in progress. If you have live dashboards, WebSocket connections, or queued exports, recheck access on the server before sending protected data or delivering a result. In a test environment, remove a member while their dashboard is open or their export is queued. Verify they stop receiving updates and cannot retrieve the export. OWASP WebSocket security · OWASP authorization guidance.
  • Test with a warm cache. Use Cache-Control: no-store for sensitive responses and configure the CDN and any service worker to avoid storing them. In two test browser profiles and while signed out, verify that the same account URL cannot show the first viewer’s data after that viewer loads it. Check personalized HTML, API responses, file downloads, and old offline copies after logout. A corrected header on a new response leaves any already-stored copies to be handled separately. HTTP caching standard.
  • Keep requests and redirects in bounds. Use your framework’s cross-site request forgery protections for cookie-authenticated changes. Keep GET requests read-only. Use CORS for the minimum browser origins needed, and enforce permissions on the actual API. Use exact OAuth callback URLs and restrict where the site can send a visitor after sign-in. OWASP CSRF prevention · OAuth Security BCP.
Protect recovery, connected apps, and official supportA scam can abuse a legitimate support, password reset, or permission flow.
  • Test loss and recovery of access. Offer passkeys where supported. Require fresh verification using an existing method before changing a recovery address or adding a new sign-in method. Send alerts through a previously verified channel. Test a lost device and verify that a compromised session can be revoked. Google’s November 2026 threat report describes intrusions involving stolen sessions and credentials. NIST account recovery guidance · Google Threat Intelligence, November 16.
  • Make genuine site messages easy to confirm. Keep official support and scam reporting discoverable on your domain, including when signed out. Let people open the site directly to verify an alert. Tell users that support will never request passwords, one-time codes, or running commands to verify their browser. Review support and admin reset procedures so a convincing message alone cannot authorize a reset. Canadian Anti-Fraud Centre on account takeover · FTC fake CAPTCHA alert.
  • Show and revoke connected apps. If users connect a calendar, inbox, or cloud drive, request only the permissions the feature needs and show what is connected. Revoke provider access where supported, remove stored tokens, and stop background jobs when a user disconnects. Verify that future syncs cannot read new data. A permission grant can survive a password change. FBI consent-phishing advisory · OAuth token revocation.
  • Verify what the user is about to approve. If the site moves money or grants powerful access, show the recipient, amount, or exact permission in the confirmation. For payout destination changes or new administrative access, verify the request through a previously established channel or require a second authorized reviewer where appropriate. Test that approval applies to the exact action shown. FBI business email compromise guidance.
Validate forms, uploads, and payment messagesCheck what the server accepts and what the browser renders from visitors or providers.
  • Validate and render safely. Use server-side limits for types, sizes, formats, and permissions. Use prepared statements for database input. Escape text for the context where you display it. If you accept rich HTML, sanitize it with a maintained library. Apply the same checks to generated content. OWASP input validation · OWASP cross-site scripting prevention.
  • Keep files private by default. Limit file size and type, use controlled serving, and isolate untrusted files where appropriate. If the backend fetches a user-provided link, restrict destinations, redirects, and access to internal services. Use sample files and safe fixtures to verify that bytes are only readable by the intended account. OWASP file upload guidance · OWASP server-side request forgery prevention.
  • Isolate file previews. If visitors can preview uploads such as documents or SVG images, keep the preview on a separate, restricted origin without access to your signed-in app’s cookies. If your server converts files into thumbnails or previews, restrict the converter’s access to files, credentials, and the network. Keep authorization on private previews too. OWASP file upload guidance.
  • Verify messages from embeds and popups. If a sign-in or payment window sends a browser message back to your site, accept it only from the exact expected origin and window. Check the message format before acting. Confirm sign-in or payment with the provider through the normal verification flow before granting access or fulfilling an order. HTML standard on browser messaging.
  • Confirm payment on the server. Verify provider callbacks with the documented signature check. Confirm the expected price, currency, ownership, and status with the provider before fulfilling an order. Test declined, delayed, repeated, and out-of-order notifications, plus refunds and cancellations, in the payment sandbox. A repeat event should leave one correctly recorded outcome. Stripe webhooks · Stripe testing.
Limit AI features and coding agentsReview what each tool is allowed to read, send, change, and spend.
  • Keep AI access scoped to the current user. Filter search results and uploads by the user’s permissions before sending them to a model. Include chat history, shared caches, model logs, and stored search indexes in your privacy review. Verify the provider’s retention and training settings for the actual plan. Test with two synthetic accounts and inspect what each request includes.
  • Protect actions and rendered output. A webpage, support message, or uploaded file can contain instructions intended to mislead an AI feature. Enforce permissions in the backend for each proposed action. Validate the destination and show the exact action for confirmation before sending, exporting, buying, or deleting. Render generated text safely and check links before opening them. Log approvals and outcomes without copying private prompts into routine logs. OWASP AI agent security · OWASP prompt injection.
  • Constrain coding agents separately. Give the agent a scoped workspace and test data, with limited commands, network access, and connectors. Keep production credentials and private visitor records outside it. Review new packages, agent hooks, access rules, and build or release changes before merging. Require a separate approval for account permissions and production actions. GitHub guidance for coding agents · NIST Secure Software Development Framework.
Limit abuse and rehearse recoveryKnow what will stop an expensive action and what keeps working after you stop it.
  • Cap the work before it costs you. Rate-limit sign-in and reset requests, uploads, exports, and paid API or model calls at the backend. Apply request-size, time, and concurrency limits. If you send verification texts, limit sends per destination and across the service before contacting the provider. Alert when usage rises without a corresponding increase in successful completions. Keep a path for legitimate users who hit a fraud control. OWASP API Security · Twilio verification fraud controls.
  • Test a degraded mode. Use a CDN for public assets. Cap provider retries and plan what visitors can still do if a dependency is unavailable, such as read the last archive snapshot or practice a puzzle while scores are offline. Verify that a team member can pause an expensive or risky task without taking the whole site down. Deployment and recovery.
  • Verify a security fix reaches returning visitors. Check the fixed deployment in a fresh browser and from a tab left open on the previous version. If the site installs a service worker for offline use, also test an installed copy moving to the fixed version. Purge affected CDN copies where applicable. The server should reject access or unsafe actions even while older pages are still open. Service worker lifecycle.
  • Run one recovery drill. Assign an owner to stop affected sessions or keys, preserve evidence, roll back the site or disable a compromised script, and verify the recovery. Make sure known-good backups can be restored in isolation and that deletion and access rules still apply. Test who receives alerts for suspicious sign-ins, large exports, a change to publishing access, or unexpected spend. CISA recovery guidance · Monitoring · Breach-notice applicability.