Securing your app, together

Merchants install your app because they trust it, and because they trust the Shopify App Store. There are bad actors out there who are motivated to exploit that trust. Alongside the rest of the industry, we are seeing the number of attacks increasing across the app ecosystem as AI gets better at finding vulnerabilities. Security is the most important thing you can work on right now. We’re asking every app developer to act on the steps below this week.

  • Scan your app using one prompt in the AI Toolkit for Shopify-specific vulnerabilities, such as unauthenticated routes, cross-shop data access and unverified webhooks. In early access, most partners found something they didn’t know about.

  • Move to expiring access tokens. Short-lived tokens limit the damage if a token leaks. This will soon be required for all public apps, so start now. Get started.

  • Use vulnerability scanners to ensure all endpoints of your app are secured.

  • Treat all rendered data, whether pulled from metafields or your own servers, as untrusted, ensuring inputs are thoroughly escaped and sanitized.

  • Check your Dev Dashboard to look at your API requests and ensure you do not see any suspicious activity. You can use our Client IP filter to look at traffic coming from different originating IP addresses. Learn more about the dev dashboard capabilities here

  • Protect every account that touches your app. Turn on two-step authentication for your Partner account, hosting, CDN, code repositories and email. Remove access for anyone who no longer needs it.

  • Keep your emergency contact current. Make sure your emergency developer email in the Partner Dashboard reaches someone who can act quickly.

  • Review and apply the security best practices in Shopify Dev Docs.

What we’re doing alongside you

We’re tightening the boundaries for storefront app code, adding IP address restrictions so your keys only work from your servers, and raising App Store security requirements. We’ll share details and timelines with you before any change takes effect, so you have time to prepare. We’ll keep investing in platform protections, developer tools and guidance that make secure development the default.

If you ever suspect a security issue with your app, notify us immediately at partner-security-reports@shopify.com. You are accountable to fix the problem and notify affected merchants, and we’ll support you through it.

For general security inquiries, contact Shopify Support.

The developers who build on Shopify are a big part of why merchants succeed. Let’s make sure every app is secure.

Update Oct 27th 2027

We have released a series of security improvements today to further address app security moving forward including a reiteration of the timeline for migrating to expiring access tokens. Read the full post here: Security update: Offline token dates, new security features - Shopify developer blog

The AI security toolkit is a good start, but it has a long way to go. Steps 1 and 3 (unauthenticated routes, cross-shop access, vulnerability scanners) are the right target, but they’re opt-in and only cover the repo you point them at.

I’ve been repeatedly targeted by those attacks myself and roughly understand their methodology. I don’t think IP restrictions, expiring access tokens or anything similar would help in the context of the most recent attacks happening. Those only help if we’re strictly talking about leaked access tokens ← which still can definitely happen!

These people are using extremely sophisticated attacks: they scrape internal dashboards and app code, then hit every endpoint they manage to discover with different parameters. They often pose as real merchants, using .myshopify.com URLs taken directly from the app’s reviews.

Let’s say they hit an endpoint like /api/update-theme-widget (which seems to be their main target recently, to inject JS). The request reaches Shopify from the app’s own server, using the app’s own valid token, so it passes both IP restrictions and expiring tokens. The only thing that helps here is proper verification: check the session token or HMAC and take the shop from the signature, never from a request parameter. That’s exactly what stops them from posing as merchants.

It gets even worse with internal dashboards, because those are often separate from the app, and in my case I’ve noticed they’re being targeted as well! In most cases the AI toolkit won’t look at those, since they’re separate projects. They don’t verify HMAC and instead have their own auth, which might be open to exploits.

I believe Shopify should interview partners who have recently been targeted and gather as much information as possible on these attacks. Then they should build their own in-house “attack system” that periodically attacks apps in the same sophisticated way. To avoid affecting merchants, a fake store A could try to reach fake store B’s data. It should also hunt for internal dashboards the same way the attackers do (app JS bundles, subdomains, public certificate logs), because otherwise Shopify won’t even know those dashboards exist. On a successful breach, it would either notify the developer or temporarily delist the app, and a person could review each breach before approving that. With Shopify’s AI expertise, this feels very doable :slight_smile:

I’m not sure how these attacks are spread across the ecosystem. But if the top apps are being hit first, this is only gonna get worse as the attackers work their way down the thousands of active apps. Most of those are likely not actively maintained, yet they’re still installed on hundreds of merchant stores. Every step in this post needs the developer to act, and apps nobody maintains won’t.

Can the IP address restriction be re-considered? A lot of PaaS don’t have fixed IP addresses (they are probably using Kubernetes and different outbound hosts) . This will break a lot of apps hosted on PaaS such as Heroku , DigitalOcean App Platform, Cloudflare workers etc

@Blair, this is a good initiative, but some security-related tools that support many apps, like the shopify_app Ruby gem, are really lacking in terms of support.

That gem provides the crucial authentication/verification process and other facilities for Rails-based apps, but the documentation has become a mess. It has accumulated cruft to the point I can’t tell what a canonical setup is supposed to look like anymore.

It’s a collection of guides that mention classes that aren’t really needed anymore, old references, side notes, edge cases, etc., with no clear order and some contradictory statements.

We just migrated several apps from Rails 8 to 8.1. It was a breeze. But upgrading even a minor version of shopify_app, on the other hand, is always stressful. You just never know if you’re doing the right thing because you don’t know if the setup you have is the setup the devs assume you have at that point.

Complexity breeds security issues. That gem needs a documentation overhaul to provide the canonical setup for supported Rails versions (8 and 8.1), with clear guides/tracks for people using either Hotwire or an SPA framework. The current docs should be entirely archived (too much baggage there).

Second, there are several unaddressed issues open for months, including questions about the expiring token migration. It makes it hard to rely on the project to raise security or other concerns.

Good feedback on this and understood re: not having fixed IP addresses. We are considering that as a part of our design and have some ideas for alternatives such as using ASN’s

Have you also taken into consideration using mTLS as an alternative of ip filtering?

It’s way more reliable and allows much greater flexibility

We’re still waiting for answers from Shopify.

Proposed workflow

  1. App developer generates a public/private key pair.
  2. Developer registers the public key in Shopify’s Dev Dashboard.
  3. The app server signs each API request using its private key.
  4. Shopify verifies the signature, timestamp and request uniqueness before accepting the request.
  5. Developers can revoke or rotate keys directly from the dashboard.

@Blair

Treat all rendered data, whether pulled from metafields or your own servers, as untrusted, ensuring inputs are thoroughly escaped and sanitized.

What is the recommended way to do this for metafields that a theme app extension renders from Liquid?

  1. How do we safely render a text metafield that contains HTML? Merchants put HTML in text metafields and expect it to render. For metafield values, Liquid has escape and strip_html, but both remove the markup. Is there a sanitize_html filter or something similar for metafields?
  2. Is metafield_tag supposed to render safe HTML for rich_text_field metafields, even when the metafield value is untrusted?

@Anton, to answer your questions:

  1. If the output needs to support formatting, use a rich_text_field instead of a single_line_text_field or multi_line_text_field. There is no sanitize_html filter in Liquid. If merchants enter HTML into one of those plain-text fields when they shouldn’t, remove the tags with strip_html and then apply escape: {{ product.metafields.custom.content.value | strip_html | escape }}.
  2. metafield_tag is the supported way to render a rich_text_field. It builds HTML from the structured value and escapes text content, but this does not make the source value trusted. If rich text isn’t required, use the narrowest metafield type appropriate for the value.

Let me know if you require further clarification on this.

@Paige-Shopify Thanks. Let’s say an app stores merchant formatted text in a rich_text_field and the theme app extension renders it with metafield_tag. Other apps with product write access can write that metafield too, so the value is untrusted.

Does that make rich_text_field + metafield_tag unsafe for non-app-scoped metafields? If yes, what is the safe way to render formatted text, since Liquid has no sanitize filter?

@Anton Yes. If the formatting must be preserved while preventing other apps from modifying the value, the practical solution is an app-owned rich_text_field rendered with metafield_tag. If the metafield must remain non-app-scoped, you can use metafield_text, but it renders the value as plain text and removes the formatting.

@Paige-Shopify Thanks, that’s clear. So rendering a non-app-scoped rich_text_field with metafield_tag is not safe. It would help to say this in the docs: the metafield_tag page shows {{ product.metafields.information.rich_description | metafield_tag }} as the basic example, with no warning.

One more on the same lines: product descriptionHtml. Writing it takes the same write_products scope as writing a non-app-scoped product metafield, so any app that can write those metafields can write the description too. Dawn and Horizon output product.description raw, and Liquid has no filter to sanitize it.

Should a theme app extension treat product.description (and descriptionHtml from the Storefront API) as untrusted too? If yes, what is the safe way to render it with formatting?

@Anton Yes. Since your app can’t control every write to the product description, I’d treat both product.description and Storefront API descriptionHtml as untrusted. You can pass product.description to JavaScript with {{ product.description | json }}, sanitize it, then render the sanitized result. You can take a similar approach to Storefront API’s descriptionHtml.

Because storefront performance matters, I’d say the ideal solution is to prevent unsafe input at the point of entry rather than require each renderer to sanitize it. I’ll submit a feature request to strengthen platform-wide protections against unsafe input. I’ll also share your feedback that the docs should make it clearer when values aren’t sanitized.

Thanks for shipping the IP allowlist (docs). One request: please make it part of the app configuration in shopify.app.toml, released with shopify app deploy.

Today it can only be set by hand in the Dev Dashboard, while everything else that defines how an app reaches the Admin API (scopes, redirect URLs, webhooks, [access.admin]) lives in the TOML. For agencies running one app per environment (dev, staging, prod) for many clients, that means:

  • no review: an allowlist change doesn’t go through a pull request like the rest of the config;
  • drift: when a server’s egress IP changes, someone has to remember to update every app by hand;
  • no automation: we create apps and release their config from CI, and there’s nothing there to set the allowlist with.

Something like:

[access.admin.ip_allowlist]
ranges = ["203.0.113.0/24", "2001:db8:1234::/48"]

Declaring it enforces it when the version is released, and removing it turns enforcement off, so the allowlist always matches the active version, rollbacks included. The Dashboard’s validation (100 entries, /16 and /32 limits, ranges starting at their network address) would fail shopify app deploy before anything is released, and deploy could warn when the “Run test” check finds recent traffic outside the ranges.

We have released a series of security improvements today to further address app security moving forward including a reiteration of the timeline for migrating to expiring access tokens. Read the full post here: Security update: Offline token dates, new security features - Shopify developer blog

1000% agree. We stopped using the Shopify Ruby libraries years ago because of this and have never looked back! They’re nothing but a bloated maintenance nightmare and nothing has improved since the 2023 (?) issue that outlined its many issues. Checkout my rubygems page for alternatives with more coming soon.

@zeroxtlt We made a separate follow-up changelog for shopify.app.toml: Secure your app with network access rules in shopify.app.toml - Shopify developer changelog

Let us know how that approach works out for you.

@Paige-Shopify

[network_access] covers the hosts the app talks to, but what I’m after is the IP allowlist for the app’s API credentials, the setting in the Dev Dashboard that decides which IPs can hit the Admin API with our tokens. Right now that one is Dashboard-only.

Could it live in shopify.app.toml and be released with shopify app deploy? Something like:

[access.admin.ip_allowlist]
ranges = ["203.0.113.10/32", "198.51.100.0/24"]

We have dev, staging and prod apps, so keeping it in the repo means one source of truth, changes reviewed in PRs, and no manual setup per app.