Shopify GitHub Login and Password exposed all private source code might be available.
The iOS app Sello contained a Podfile with a hardcoded GitHub username and password for shopify-dep, which the author believed could give access to Shopify's source code.
Originally disclosed on HackerOne
- Triaged in 5 hours
- Fixed in 4 days
- Paid in 18 days
- Disclosed after 15 months
Summary by the researcher
Well this was from when I was young in my bug hunting adventure about 15 months back.
Time to start releasing my reports to help others :)
May you be well on your side of the screen,
-Eric
The report
Sello (com.shopify.Sello) https://itunes.apple.com/us/app/sello/id947038847?mt=8
ios Mobile Application
Versions 1.0.1, 1.1, 1.1.2, 1.1.3, 1.2,
Podfile left inside application exposes GitHub Password for Shopify.
username: shopify-dep password: 1910c92631a81a4c41dafbf96d537e3f24506b11
Impact: Access to all source code of all programs Shopify makes, which would not be good :)
source of file:
source "https://github.com/CocoaPods/Specs.git" platform :ios, "8.0"
ignore all warnings from all pods
inhibit_all_warnings!
target "Sello" do
pod "SHPShareKit", git: "https://shopify-dep:[email protected]/Shopify/ios-share-kit"
pod "HockeySDK"
pod "Reachability", "> 3.2"
pod "PureLayout", "> 2.0.6"
pod "pop", "~> 1.0"
pod "Intercom"
pod "GoogleAnalytics"
pod "Mixpanel"
pod "Branch"
end
target "SelloTests", exclusive: true do pod "OCMock", "3.1.2" end
Sello Also Exposes a series of other private credentials.
ApnsApplication:SELLO_IOS branch_key:key_live_cgmRq1Cqi0GTaTZt6ugtkghaCwjEkH8N FacebookAppID:825102250879029 FacebookDisplayName:Sello GoogleAnalyticsID:UA-49226624-4 GooglePlusClientID:833666260708-pd79q7hfldjboqnsdkjep0c09lbusg8s.apps.googleusercontent.com HockeyAppID:e220ee56ef6c7c0f9313dec065ab14d4 IntercomApiKey:ios_sdk-6c8980b1b197f9a4b741d8a99ea30eeb5eb7447c IntercomAppID:ztfy5avc MixpanelToken:b076cfff7bf5a6b04bb332efb07d339e MixpanelTokenDev:d2c21feef224fbb03b48e1e1acc3d0f5 ShopifyAppHost:https://app.shopify.com/
Please let me know how I can help with more details, good luck on your side of the screen :)
-Eric
Context
Shopify publishes a mobile app called Sello (com.shopify.Sello), distributed through the App Store at https://itunes.apple.com/us/app/sello/id947038847?mt=8. The researcher describes it as an iOS mobile application and lists the affected versions as 1.0.1, 1.1, 1.1.2, 1.1.3 and 1.2.
The issue is an information disclosure: a CocoaPods Podfile was left inside the shipped application, and that file contained a GitHub password for a Shopify account. The same file also carried a set of other private credentials used by the app.
Setup
No accounts, roles or special tooling are described. The precondition is simply that the app bundle is available for inspection, which it is for any App Store download. The researcher notes that the finding dates from about 15 months before the write-up, early in his bug hunting.
Finding it
The researcher found a Podfile inside the application. A Podfile is the dependency manifest used by CocoaPods, the iOS dependency manager; it lists the pods an app depends on and, for pods pulled from Git, the repository URL. It is a build-time file and has no reason to be present in a distributed app bundle.
This one was worse than a stray build artefact. One of the pod declarations embedded credentials directly in the Git URL, in the form https://user:[redacted]/.... That exposed a GitHub account password for the user shopify-dep.
Exploitation
Step 1: Extract the Podfile from the app bundle
The researcher does not show the extraction command. What he shows is the content of the file, which he presents as the source of the exposed credentials:
source "https://github.com/CocoaPods/Specs.git"
platform :ios, "8.0"
# ignore all warnings from all pods
inhibit_all_warnings!
target "Sello" do
pod "SHPShareKit", git: "https://shopify-dep:[redacted]@github.com/Shopify/ios-share-kit"
pod "HockeySDK"
pod "Reachability", "~> 3.2"
pod "PureLayout", "~> 2.0.6"
pod "pop", "~> 1.0"
pod "Intercom"
pod "GoogleAnalytics"
pod "Mixpanel"
pod "Branch"
end
target "SelloTests", exclusive: true do
pod "OCMock", "3.1.2"
end
The source line points at the public CocoaPods specs repository. The platform line pins iOS 8.0. inhibit_all_warnings! suppresses pod warnings. The Sello target pulls SHPShareKit from a private Shopify repository, https://github.com/Shopify/ios-share-kit, and authenticates to it with the shopify-dep account and its password inline in the URL. The remaining pods are ordinary public dependencies: HockeySDK, Reachability, PureLayout, pop, Intercom, GoogleAnalytics, Mixpanel and Branch. A separate SelloTests target uses OCMock 3.1.2.
The researcher records the account as:
username: shopify-dep
password: [redacted]
Step 2: Assess what the account reaches
The researcher states the impact directly: access to all source code of all programs Shopify makes. He hedges the consequence with "which would not be good :)".
Step 3: Note the other credentials in the same file
The researcher reports that Sello also exposes a series of other private credentials. He lists them as follows:
ApnsApplication:SELLO_IOS
branch_key:key_live_[redacted]
FacebookAppID:825102250879029
FacebookDisplayName:Sello
GoogleAnalyticsID:UA-49226624-4
GooglePlusClientID:833666260708-[redacted].apps.googleusercontent.com
HockeyAppID:[redacted]
IntercomApiKey:ios_sdk-[redacted]
IntercomAppID:ztfy5avc
MixpanelToken:[redacted]
MixpanelTokenDev:[redacted]
ShopifyAppHost:https://app.shopify.com/
These cover the APNs application identifier, a Branch live key, the Facebook app ID and display name, a Google Analytics tracking ID, a Google+ client ID, a HockeyApp ID, Intercom API key and app ID, Mixpanel production and development tokens, and the Shopify app host. The researcher does not demonstrate use of any of them; they are presented as additional exposure alongside the GitHub credential.
Root cause
The mistake is packaging a build-time dependency manifest into the distributed app, and putting a reusable password into that manifest in the first place. CocoaPods supports credentials in the Git URL, which makes it easy to commit them into a Podfile that is then treated as just another resource. Once the file is inside the .ipa, anyone who downloads the app can read it. The report does not describe any defence that was in place or why it failed;
Impact
Under the conditions the researcher describes, an attacker who downloads the app can read the Podfile and recover the shopify-dep GitHub password. With that account, the researcher says, all source code of all programs Shopify makes might be available.
Fix
What should be done follows from the finding: remove the Podfile and other build artefacts from the app bundle, stop embedding credentials in dependency URLs, and rotate the shopify-dep password and the other exposed keys and tokens, since they shipped in public app versions.
Variants to test
- Unzip an
.ipaand search forPodfile,Podfile.lock,.xcconfig,Info.plistand any.jsonor.plistconfiguration. A positive result is a build file containing a Git URL withuser:password@, or any key that looks live. - Grep the extracted bundle for
https://,@github.com,key_live_,ios_sdk-,UA-andapps.googleusercontent.com. A positive result is a credential that authenticates against the corresponding service. - Check the app's public repository history, if one exists, for the same
Podfilepattern. A positive result is a committed credential that still works.
Hunting notes
This kind of bug hides in shipped mobile binaries: build manifests, configuration files and test targets that were never meant to leave the build machine. The signal during recon is an app whose dependencies include private Git repositories, since those are the ones that need credentials in the Podfile. The researcher showed impact by naming the account, the repository it unlocks and the consequence for Shopify's source code.
What happened, in plain words
Shopify makes a mobile app called Sello for iPhones. Anyone can download it from Apple's App Store. When you download an app, you get a package of files that runs on your phone. Some of those files are meant to be there, like the pictures and the code that draws the screen. Others are leftovers from the workshop where the app was built, and those should never have been shipped.
In this case, a leftover file called a Podfile was inside the app. A Podfile is a shopping list that a developer writes while building an app: it names the ready-made pieces of software (called pods) that the app needs, and where to fetch each one. It is a tool for the build machine, not something the finished app needs. This particular Podfile contained a GitHub username and password written directly into a web address. GitHub is a website where developers store and share code, and a password there can unlock private code that is not meant to be public.
The researcher who found this was early in his bug hunting at the time, roughly 15 months before he wrote it up. The weakness is classed as information disclosure, which simply means private information was exposed to people who should not have it.
Context
Shopify publishes a mobile app called Sello, with the internal package name com.shopify.Sello. It was distributed through the App Store at https://itunes.apple.com/us/app/sello/id947038847?mt=8. The researcher describes it as an iOS mobile application, meaning it runs on Apple's iPhone operating system, iOS. He lists the affected versions as 1.0.1, 1.1, 1.1.2, 1.1.3 and 1.2.
The issue is an information disclosure: a CocoaPods Podfile was left inside the shipped application, and that file contained a GitHub password for a Shopify account. The same file also carried a set of other private credentials used by the app.
A quick word on the two main ideas before we go further:
- CocoaPods is a tool that helps iOS developers reuse code written by other people. Instead of writing everything from scratch, a developer lists the outside pieces they want, and CocoaPods downloads and connects them. Think of it like a recipe that says which shop-bought ingredients to buy rather than making everything at home.
- A credential is anything that proves who you are to a computer system: a username and password, a key, a token. It is like the key to a building. If someone else gets a copy, they can walk in as if they were you.
Setup
No accounts, roles or special tooling are described. The precondition is simply that the app bundle is available for inspection, which it is for any App Store download. The researcher notes that the finding dates from about 15 months before the write-up, early in his bug hunting.
In plain terms: you do not need to be a Shopify employee, you do not need a special login, and you do not need to break into anything. You only need to download the app the same way any member of the public would, then look inside the files it came with. That is what makes this kind of bug serious: the starting point is open to everyone.
Finding it
The researcher found a Podfile inside the application. A Podfile is the dependency manifest used by CocoaPods, the iOS dependency manager; it lists the pods an app depends on and, for pods pulled from Git, the repository URL. It is a build-time file and has no reason to be present in a distributed app bundle.
To unpack that: a dependency is a piece of software your app relies on, the way a cake relies on flour. A manifest is a list that says what is needed. Git is a system for tracking versions of code, and a repository (repo for short) is a project stored in Git, usually on a site like GitHub. A build-time file is one used only while the app is being assembled, on the developer's own computer, before it is packaged for the store.
This one was worse than a stray build artefact. One of the pod declarations embedded credentials directly in the Git URL, in the form https://user:[redacted]/.... That exposed a GitHub account password for the user shopify-dep.
A web address can carry a username and password at the front, before the @ sign, so that a tool can log in automatically without asking. It is convenient, but it means the password is written in plain text wherever that address appears. If that address ends up in a file that ships to the public, the password ships with it.
Exploitation
Step 1: Extract the Podfile from the app bundle
The researcher does not show the extraction command. What he shows is the content of the file, which he presents as the source of the exposed credentials:
source "https://github.com/CocoaPods/Specs.git"
platform :ios, "8.0"
# ignore all warnings from all pods
inhibit_all_warnings!
target "Sello" do
pod "SHPShareKit", git: "https://shopify-dep:[redacted]@github.com/Shopify/ios-share-kit"
pod "HockeySDK"
pod "Reachability", "~> 3.2"
pod "PureLayout", "~> 2.0.6"
pod "pop", "~> 1.0"
pod "Intercom"
pod "GoogleAnalytics"
pod "Mixpanel"
pod "Branch"
end
target "SelloTests", exclusive: true do
pod "OCMock", "3.1.2"
end
Line by line, in plain words:
source "https://github.com/CocoaPods/Specs.git"tells CocoaPods where to find its master catalogue of available pods. This is a public list, like a library catalogue.platform :ios, "8.0"says the app is built for iOS version 8.0.# ignore all warnings from all podsis a comment. Anything after a#is a note for humans and is ignored by the tool.inhibit_all_warnings!switches off warning messages coming from the pods, so the build output stays quiet.target "Sello" dostarts a block describing the main app, named Sello. Thedoopens the block.pod "SHPShareKit", git: "https://shopify-dep:[redacted]@github.com/Shopify/ios-share-kit"is the important line. It asks for a pod calledSHPShareKit, fetched from a private Shopify repository athttps://github.com/Shopify/ios-share-kit. The address includes the usernameshopify-depand its password before the@, so CocoaPods can log in to that private repository. This is where the password leaked.- The next lines,
pod "HockeySDK",pod "Reachability", "~> 3.2",pod "PureLayout", "~> 2.0.6",pod "pop", "~> 1.0",pod "Intercom",pod "GoogleAnalytics",pod "Mixpanel"andpod "Branch", are ordinary public dependencies. The~>parts are version rules, meaning roughly "this version or a compatible newer one". endcloses the Sello block.target "SelloTests", exclusive: true dostarts a second block for the app's automated tests, kept separate from the main app.pod "OCMock", "3.1.2"adds a testing tool called OCMock at exactly version 3.1.2.- The final
endcloses the tests block.
The researcher records the account as:
username: shopify-dep
password: [redacted]
Why this step matters: the whole finding rests on one file being readable by anyone who has the app. Once you can read the Podfile, the username and password are sitting there in plain sight, no guessing or cracking required.
Step 2: Assess what the account reaches
The researcher states the impact directly: access to all source code of all programs Shopify makes. He hedges the consequence with "which would not be good :)".
Some background helps here. On GitHub, an organisation is a shared account that groups a company's projects. A private repository is a code project that only invited people can see. A collaborator is someone who has been given access to a repository. If the shopify-dep account had been added as a collaborator so that the build could fetch one private repository, then the same account might also be able to read other private repositories belonging to the organisation. Source code is the recipe for a company's products, so being able to read all of it would be a serious loss of confidentiality.
Step 3: Note the other credentials in the same file
The researcher reports that Sello also exposes a series of other private credentials. He lists them as follows:
ApnsApplication:SELLO_IOS
branch_key:key_live_[redacted]
FacebookAppID:825102250879029
FacebookDisplayName:Sello
GoogleAnalyticsID:UA-49226624-4
GooglePlusClientID:833666260708-[redacted].apps.googleusercontent.com
HockeyAppID:[redacted]
IntercomApiKey:ios_sdk-[redacted]
IntercomAppID:ztfy5avc
MixpanelToken:[redacted]
MixpanelTokenDev:[redacted]
ShopifyAppHost:https://app.shopify.com/
What each line is, in everyday terms:
ApnsApplication:SELLO_IOSis an identifier for Apple's push notification service, the system that delivers alerts to a phone even when the app is closed.branch_key:key_live_[redacted]is a key for Branch, a service that handles links that open the right content inside an app. Thelivepart suggests it is the real, working key rather than a test one.FacebookAppID:825102250879029andFacebookDisplayName:Selloidentify the app to Facebook, for features like logging in with a Facebook account.GoogleAnalyticsID:UA-49226624-4is a tracking ID used to collect statistics about how people use the app.GooglePlusClientID:833666260708-[redacted].apps.googleusercontent.comis an identifier for signing in with a Google account.HockeyAppID:[redacted]identifies the app to HockeyApp, a service for distributing test versions and collecting crash reports.IntercomApiKey:ios_sdk-[redacted]andIntercomAppID:ztfy5avcare credentials for Intercom, a customer messaging tool built into apps.MixpanelToken:[redacted]andMixpanelTokenDev:[redacted]are tokens for Mixpanel, an analytics service. One appears to be for production (real users) and one for development (testing).ShopifyAppHost:https://app.shopify.com/is simply the web address of Shopify's own app.
These cover the APNs application identifier, a Branch live key, the Facebook app ID and display name, a Google Analytics tracking ID, a Google+ client ID, a HockeyApp ID, Intercom API key and app ID, Mixpanel production and development tokens, and the Shopify app host. The researcher does not demonstrate use of any of them; they are presented as additional exposure alongside the GitHub credential.
Why this step matters: the GitHub password was the headline, but the same file showed that many other keys had shipped to the public too. Each key is like a spare key to a different door. The report does not show what each one would let an attacker do, but the fact that they were readable at all is the problem.
Root cause
The mistake is packaging a build-time dependency manifest into the distributed app, and putting a reusable password into that manifest in the first place. CocoaPods supports credentials in the Git URL, which makes it easy to commit them into a Podfile that is then treated as just another resource. Once the file is inside the .ipa, anyone who downloads the app can read it.
A few terms: an .ipa is the file format of an iPhone app, essentially a zip archive with the app inside. Committing means saving a change into a code repository, which records it in the project's history. Secret scanning is an automated check that looks through code for things that look like passwords or keys and warns the team. The root cause, in one sentence: a file that should have stayed on the build machine, with a password written into it, was packed into the public app.
Impact
Under the conditions the researcher describes, an attacker who downloads the app can read the Podfile and recover the shopify-dep GitHub password. With that account, the researcher says, all source code of all programs Shopify makes might be available.
In plain words: the door was unlocked by simply downloading a free app. The researcher's stated worst case is that the private source code behind Shopify's products could be read.
Fix
What should be done follows from the finding: remove the Podfile and other build artefacts from the app bundle, stop embedding credentials in dependency URLs, and rotate the shopify-dep password and the other exposed keys and tokens, since they shipped in public app versions.
Rotating a credential means replacing it with a new one and cancelling the old, the way you change a lock after losing a key. Changing the password alone is not enough if the old one is still valid somewhere; it has to be switched off.
Variants to test
If you want to look for the same kind of mistake in other apps, here are three approaches. Each one starts from a file you already have on your computer.
- Unzip an
.ipaand search forPodfile,Podfile.lock,.xcconfig,Info.plistand any.jsonor.plistconfiguration. A positive result is a build file containing a Git URL withuser:password@, or any key that looks live. - Grep the extracted bundle for
https://,@github.com,key_live_,ios_sdk-,UA-andapps.googleusercontent.com. A positive result is a credential that authenticates against the corresponding service. - Check the app's public repository history, if one exists, for the same
Podfilepattern. A positive result is a committed credential that still works.
A little explanation of the tools named: to unzip is to unpack a compressed archive, which is what an .ipa really is. Grep is a command that searches text for a pattern, like using your browser's find function but across many files at once. Info.plist is a settings file that every iPhone app carries, and .xcconfig is a file of build settings. A positive result means you found something that looks like a real secret, not just a harmless mention.
Hunting notes
This kind of bug hides in shipped mobile binaries: build manifests, configuration files and test targets that were never meant to leave the build machine. The signal during recon is an app whose dependencies include private Git repositories, since those are the ones that need credentials in the Podfile. The researcher showed impact by naming the account, the repository it unlocks and the consequence for Shopify's source code.
Recon, short for reconnaissance, is the early stage of looking around and gathering information before trying anything. A binary here means the compiled app file rather than readable source code. The lesson for a beginner: when you look inside an app, pay attention to files that look like they belong to the workshop rather than the shop window, and when you find a secret, explain clearly what it unlocks and why that matters.
Glossary
- API: a way for one piece of software to talk to another, like a service counter where you make a request and get an answer.
- App bundle: the collection of files that makes up an installed app.
- APNs: Apple Push Notification service, which delivers alerts to a phone even when the app is closed.
- Binary: a compiled program file that the computer runs, as opposed to human-readable source code.
- Bug bounty: a programme where a company pays people for reporting security problems responsibly.
- Build-time file: a file used only while an app is being assembled, not needed by the finished app.
- CocoaPods: a tool that downloads and connects ready-made code libraries for iOS apps.
- Collaborator: a person or account given access to a code repository on a hosting site.
- Commit: to save a change into a code repository, recording it in the project's history.
- Credential: anything that proves identity to a system, such as a username and password, key or token.
- Dependency: a piece of software that another piece of software relies on.
- Dependency manifest: a file listing the dependencies a project needs and where to get them.
- Git: a system for tracking versions of code and collaborating on it.
- GitHub: a website that hosts Git repositories, public and private.
- Grep: a command that searches text for a pattern across files.
- Information disclosure: a weakness where private information is exposed to people who should not have it.
.ipa: the file format of an iPhone app, essentially a zip archive.- iOS: Apple's operating system for iPhone.
- Key: a secret string used to authenticate to a service, similar to a password.
- Manifest: a list that says what is needed.
- Organisation: a shared account on a code hosting site that groups a company's projects and people.
- Pod: a reusable code library managed by CocoaPods.
Podfile: the file where a CocoaPods project lists its pods and where to fetch them.- Private repository: a code project that only invited people can see.
- Recon: the early stage of gathering information before attempting anything.
- Repository: a project stored in Git, usually on a hosting site.
- Rotate: to replace a credential with a new one and cancel the old.
- Secret scanning: an automated check that looks through code for passwords and keys.
- Token: a secret string, often temporary, that a service issues to prove identity or grant access.
- Unzip: to unpack a compressed archive.
- Vulnerability: a weakness in software that can be used to cause harm or gain access.