---
title: How to Fix the Shopify Security Warnings Your Scan Just Found | AMZ Global Experts
url: https://www.amzglobalexperts.com/blog/shopify-security-headers-fix-guide-2026
description: Missing HSTS, no CSP, insecure cookies — a practical, step-by-step guide to actually fixing the findings from a Shopify security scan, not just understanding them.
---A security scan is only useful if the findings turn into fixes. Most merchants who run our free [E-commerce Security & Trust Auditor](https://www.amzglobalexperts.com/tools/ecommerce-security-trust-auditor/) understand _that_ a header is missing without knowing exactly where to set it, or whether Shopify already handles it for them. This is the companion fix guide — one section per finding, ordered by severity.

1st Fix any exposed file before anything else — always
Report-only The safest way to test a new CSP before enforcing it
Cloudflare The most common layer for adding headers Shopify doesn't set natively
Every change Should trigger a re-scan — regressions are common after app installs

## Critical: Exposed Configuration or Backup Files

If the scan found a publicly accessible `.env`, `.git/config`, or backup file, treat it as an active incident, not a checklist item. Remove or block public access to the file immediately at the hosting or CDN level. Then check what the file actually contained — if it held API keys, database credentials, or tokens, rotate every one of them now, because you have no way to know how long the file was exposed or whether it's already been indexed by an automated scanner elsewhere.

## High: HTTP Doesn't Redirect to HTTPS

On Shopify's own `myshopify.com` domain and standard custom domain setup, HTTPS and the redirect are typically handled automatically. If your scan flagged this, the most common cause is a custom domain configured outside Shopify's standard DNS setup, or a proxy/CDN layer (like Cloudflare) with SSL mode set incorrectly. Check your domain's DNS and SSL/TLS mode — it should be set to "Full" or "Full (strict)," not "Flexible," which can create exactly this gap.

## High: Mixed Content Detected

This means your HTTPS page is loading at least one resource — an image, a script, a stylesheet — over plain `http://`. Search your theme code and any custom-installed apps for hardcoded `http://` URLs and change them to `https://` or protocol-relative URLs (starting with `//` ). This is most often introduced by an old app snippet, a legacy embed, or a manually pasted image URL from years ago that nobody's touched since.

## High: Cookies Missing the Secure Flag

If your store is already fully HTTPS (which it should be), the Secure flag should be automatic for cookies Shopify's own platform sets. A finding here usually points to a third-party app or custom script setting its own cookie without that flag — check the third-party scripts your scan inventoried and look at each vendor's documentation for how to configure secure cookie behavior, or contact their support if it's not user-configurable.

### Re-Scan After You Fix These

Confirm each fix actually resolved the finding — the scan takes about 60 seconds and requires no login.

[Re-Run the Scan →](https://www.amzglobalexperts.com/tools/ecommerce-security-trust-auditor)

## Medium: No HSTS Header

HSTS (Strict-Transport-Security) tells browsers to always use HTTPS for your domain, even if a visitor types `http://` or clicks an old HTTP link. If you're behind Cloudflare or a similar CDN, this is usually the fastest header to add — most CDN dashboards have a one-click HSTS toggle under SSL/TLS settings. Start with a shorter max-age like 6 months before committing to the full year-long value, since HSTS is difficult to reverse once a long duration is cached by visitors' browsers.

## Medium: No Content-Security-Policy Header

This is the finding most merchants avoid fixing because a strict CSP can break third-party apps, pixels, and embeds if scoped incorrectly. The safe sequence:

1 Inventory every third-party script actually running Use the third-party script list your scan already generated as your starting allowlist — analytics, pixels, chat widgets, popups.
2 Deploy in report-only mode first Use Content-Security-Policy-Report-Only instead of the enforcing header — this logs what would be blocked without actually blocking anything.
3 Review the report-only violations for a week This catches scripts, fonts, or embeds you forgot about in step 1 before you ever risk breaking them.
4 Switch to the enforcing header Once the report-only version runs clean for a week, move to the real Content-Security-Policy header.

## Medium: Cookies Missing SameSite

SameSite reduces cross-site request forgery exposure. As with the Secure flag, this is typically a third-party app issue rather than something Shopify's core platform is missing — check whether the app has a setting for this, or whether it's simply using an outdated cookie implementation you should flag to their support team.

## Low: Missing X-Frame-Options or X-Content-Type-Options

These are the easiest headers to add and rarely conflict with anything. If you're on Cloudflare or a similar edge layer, add them as custom response headers at that level — `X-Frame-Options: SAMEORIGIN` and `X-Content-Type-Options: nosniff` — rather than trying to inject them through Shopify's theme layer, which doesn't control raw HTTP response headers.

## Low: No security.txt File

This is a five-minute fix with outsized goodwill: add a plain-text file at `/.well-known/security.txt` with a contact email for security researchers to responsibly report anything they find. Without it, a researcher who discovers a real issue has no sanctioned channel to tell you — and may post publicly instead.

## Checkout Domain Consistency

If your scan flagged an unexpected checkout domain, first confirm it's genuinely wrong and not simply Shopify's standard checkout subdomain, which won't always match your primary storefront domain exactly. If it truly points somewhere unexpected, add reassurance messaging (a secure-checkout badge, payment logos) right at that domain transition — customers are trained to hesitate at unfamiliar domain switches, even legitimate ones.

## Third-Party Script Bloat

A high script count isn't inherently a security failure, but it is a supply-chain risk surface — every script is a trust boundary you don't fully control. Go through the inventory your scan produced and remove anything genuinely unused: old A/B testing snippets, a chat widget nobody staffs anymore, a duplicate analytics install from a previous agency. This connects directly to page speed too — see our [Page Speed Checker](/tools/page-speed-checker/) once the script list is trimmed.

Finding Where to fix it

Exposed file Hosting/CDN — remove access immediately, rotate any leaked credentials
No HTTPS redirect DNS / CDN SSL mode (check for "Flexible" misconfiguration)
Mixed content Theme code / app snippets — find and fix hardcoded http:// URLs
Missing HSTS / CSP / X-Frame-Options CDN edge layer (e.g. Cloudflare custom headers) — Shopify theme layer can't set these
Cookie flags (Secure / SameSite) Third-party app settings/support — rarely a Shopify core issue
No security.txt Simple static file — five-minute fix

**The pattern to notice:** most of the highest-severity findings (HSTS, CSP, frame options) live at the CDN/edge layer, not inside Shopify's theme editor — if you don't already have Cloudflare or an equivalent proxy in front of your custom domain, that's usually the missing piece, not a Shopify limitation.

## Frequently Asked Questions

Can I add security headers directly in Shopify without a developer?

Shopify manages most core infrastructure headers automatically on Shopify's own domains, but headers like a custom Content-Security-Policy or Permissions-Policy typically require either a Shopify Plus-level configuration, a proxy/CDN layer such as Cloudflare in front of your custom domain, or a developer-implemented solution. Confirm which headers Shopify already sets before assuming a gap is your responsibility to fix.

Will adding a strict CSP break my Shopify apps and tracking scripts?

It can, if the policy doesn't explicitly allow the domains your installed apps, pixels, and chat widgets load from. Start with a report-only CSP to see what would be blocked before enforcing it, and build an allowlist from that data rather than guessing at a strict policy up front.

I found an exposed file in a scan. What do I do first?

Treat it as urgent. Remove the file from public access immediately, then check whether it contained credentials, API keys, or other sensitive data — if it did, rotate those credentials right away, since you can't know how long the file was exposed or who may have already accessed it.

How often should I re-run a security scan?

After any theme change, new app installation, or custom domain/checkout configuration change, since these are the most common points where a header, cookie setting, or exposed path can silently regress. A quarterly baseline scan is a reasonable minimum even without changes.

## Related Reading

- [E-commerce Security & Trust: The Silent Conversion Killer Most Shopify Audits Miss](/blog/ecommerce-security-trust-auditor-shopify-2026.html)

- [Shopify Revenue Leak Audit: Find Where Your Store Loses Sales](/blog/shopify-revenue-leak-audit-find-where-store-loses-sales.html)

## Related Tools

- [E-commerce Security & Trust Auditor](/tools/ecommerce-security-trust-auditor/)

- [Page Speed Checker](/tools/page-speed-checker/)

- [Shopify Speed & SEO Optimization](/tools/shopify-performance-seo/)

## FAQ

### Can I add security headers directly in Shopify without a developer?

Shopify manages most core infrastructure headers automatically on Shopify's own domains, but headers like a custom Content-Security-Policy or Permissions-Policy typically require either a Shopify Plus-level configuration, a proxy/CDN layer such as Cloudflare in front of your custom domain, or a developer-implemented solution. Confirm which headers Shopify already sets before assuming a gap is your responsibility to fix.

### Will adding a strict CSP break my Shopify apps and tracking scripts?

It can, if the policy doesn't explicitly allow the domains your installed apps, pixels, and chat widgets load from. Start with a report-only CSP to see what would be blocked before enforcing it, and build an allowlist from that data rather than guessing at a strict policy up front.

### I found an exposed file in a scan. What do I do first?

Treat it as urgent. Remove the file from public access immediately, then check whether it contained credentials, API keys, or other sensitive data — if it did, rotate those credentials right away, since you can't know how long the file was exposed or who may have already accessed it.

### How often should I re-run a security scan?

After any theme change, new app installation, or custom domain/checkout configuration change, since these are the most common points where a header, cookie setting, or exposed path can silently regress. A quarterly baseline scan is a reasonable minimum even without changes.

