Cover poster reading Where is your .p12 file? beside a grid of certificate cards with three highlighted

Check Point Research published a report on November 5 about ARTEX, an AI penetration testing platform that criminals now run for their own ends. One operator pointed it at 10 gray-market shops that sell iOS app signing and gave the agents a short goal: "get a p12 certificate + password." Between October 14 and 29, the agents pulled more than 300 certificates and passwords out of those shops. Three of them passed every check the agents ran, which is what made them worth reselling.

Most iOS developers will never buy from a signing shop. The report still applies to them because of how the agents got in and what they went looking for: certificate libraries with plaintext passwords beside them, admin logins hardcoded in front-end JavaScript, and web APIs with no authentication. Plenty of small teams keep their .p12 files in a similar state, in a shared drive, a repo folder, a CI variable or a former contractor's laptop. This guide runs the agents' checklist against your own files, shows what each file can do if it leaks, and explains when revoking a certificate will hurt you more than the leak.

What the report actually found

ItemWhat Check Point reported
ARTEX panels seen2,557 systems hosting or having hosted one; 1,608 live and public during the research
Databases readable10 misconfigured instances exposed the full ARTEX database
Certificate campaignOctober 14 to 29, two consoles run in parallel
Targets10 gray-market iOS signing shops
ModelsDeepSeek v4.1 Flash and Kimi K3.1 Pro
UsageAbout 36 billion tokens, most of them cached input
Estimated cost$700 to $1,500
ResultMore than 300 certificates and passwords; 3 passed all checks

The evidence comes from those 10 exposed databases, so it is a slice of what ARTEX users do. Check Point does not name the shops or say whose certificates were inside them, and there is no list you can search for your team ID. The operators' messages were mostly progress questions, which means the agents did the work with little supervision. At an estimated $700 to $1,500, one person kept agents working on 10 targets for two weeks.

Check Point lists the ways in: hardcoded admin passwords in single-page app JavaScript bundles, missing authentication on web APIs, command injection, insecure direct object references, weak admin credentials and server-side template injection. In one case the agents moved from a low-privileged Linux user to root through overly permissive folder access. No named CVE appears in that list. These are ordinary web bugs on small admin panels.

The five checks the agents ran

Once inside, the agents hunted for a certificate library and then tested each identity in this order:

  1. Decrypt the key with the recovered password.
  2. Confirm the private key matches the certificate.
  3. Ask Apple's OCSP service whether the certificate is revoked.
  4. Check the expiry date.
  5. Look for a matching In-House .mobileprovision file.

The fifth check explains what the operator wanted, and Check Point also saw an instruction to prefer enterprise certificates over personal ones. The report does not say why the rest failed. It does show that a pile of stolen certificates is worth little until someone sorts it, and that sorting was automated too.

Why In-House certificates were the prize

A provisioning profile answers who may sign, which apps, on which devices, until when and with which entitlements. Apple's TN3125 describes the device part. Most profiles carry a ProvisionedDevices list. App Store distribution profiles have none, because an App Store distribution signed app can't run locally. In-House and Developer ID profiles carry ProvisionsAllDevices, which means they apply to every device.

That is why an In-House identity with a matching profile sells. Its holder can sign an app and hand it to anyone willing to install it, outside the App Store. Check Point says buyers use these certificates for anything from modified apps that bypass restrictions to apps with injected libraries that steal data.

Apple's TN3161 explains that a certificate holds only a public key and cannot sign code. Signing needs a digital identity, which is the certificate plus its private key, and a .p12 file is the usual container for that pair. A leaked .cer file is public data. A leaked .p12 is a leaked key, protected only by whatever password it was exported with.

What each file can do if it leaks

File or assetWhat a thief getsWhat revoking breaks
Apple Distribution identity (App Store use)Can sign builds, but App Store delivery needs your account or API key as wellLive App Store apps keep working if your membership is valid. New uploads need a new certificate. Uploaded builds not yet submitted may be marked Invalid Binary.
In-House distribution identityCan sign apps for any device when paired with a matching profileUsers can no longer run apps signed with it. You must distribute a new version.
Developer ID identity (Mac)Can sign Mac software as youYou can't revoke it in your account. Email Apple. Once revoked, users can't install apps signed with it.
App Store Connect or APNs .p8 keyAccess to the Apple services that key is enabled forThe key becomes invalid and every service using it stops working.
.cer certificate aloneNothing useful, it is publicNothing to revoke on this basis

The table is drawn from Apple's certificates support page, its revoking privileges reference and its keys help page. The certificates page does not cover ad hoc distribution directly, but Apple states that profiles containing a revoked certificate become invalid, so ad hoc builds tied to that profile need a fresh one.

App Store users have the easiest position. The App Store re-signs your app during distribution, so your certificate only has to be valid when you submit. Your customers never depend on the identity sitting on your disk.

Step 1: find every copy

The script below walks a repository, lists signing files in the working tree and in git history, and flags passwords written into tracked files. It only reads, and it prints no key material. Run it on repos you own or are responsible for.

#!/usr/bin/env bash
# signing_audit.sh: list iOS signing files and what they contain.
# Usage: P12_PASS='your password' ./signing_audit.sh /path/to/repo
# Read-only. Prints no private key material and no password.
set -u
cd "${1:-.}" || exit 1
PATTERN='\.(p12|pfx|mobileprovision|provisionprofile)$|AuthKey_.*\.p8$'

echo "== Files in the working tree =="
FILES=$(find . -path ./.git -prune -o -type f -print | sed 's|^\./||' | grep -iE "$PATTERN")
echo "${FILES:-none}"

if git rev-parse --git-dir >/dev/null 2>&1; then
  echo; echo "== Files ever added in git history =="
  git log --all --diff-filter=A --name-only --format= | grep -iE "$PATTERN" | sort -u
  echo; echo "== Passwords written into tracked files =="
  git grep -nIE '(P12|CERT|CERTIFICATE|KEYCHAIN|MATCH)_?(PASS|PASSWORD)[A-Z_]*["'"'"']?[[:space:]]*[:=][[:space:]]*["'"'"']?[A-Za-z0-9/+!@#%^&*_-]{4,}' \
    | sed -E 's/(PASS[A-Z_]*["'"'"']?[[:space:]]*[:=][[:space:]]*["'"'"']?)[^"'"'"'[:space:]]+/\1[hidden]/' \
    | grep -v '\${{' || echo none
fi

read_p12() {
  openssl pkcs12 -in "$1" -nokeys -passin "pass:$2" -legacy 2>/dev/null \
    || openssl pkcs12 -in "$1" -nokeys -passin "pass:$2" 2>/dev/null
}
read_profile() {
  if command -v security >/dev/null; then security cms -D -i "$1" 2>/dev/null
  else openssl smime -verify -noverify -inform der -in "$1" 2>/dev/null; fi
}

echo "$FILES" | while IFS= read -r f; do
  [ -z "$f" ] && continue
  echo; echo "--- $f"
  case "$f" in
    *.p12|*.pfx|*.P12|*.PFX)
      if read_p12 "$f" "" | grep -q BEGIN; then
        echo "WARNING: opens with an EMPTY password"; PEM=$(read_p12 "$f" "")
      elif [ -n "${P12_PASS:-}" ] && read_p12 "$f" "$P12_PASS" | grep -q BEGIN; then
        PEM=$(read_p12 "$f" "$P12_PASS")
      else
        echo "Password protected (set P12_PASS to read it)"; continue
      fi
      echo "$PEM" | openssl x509 -noout -subject -enddate -fingerprint -sha1 ;;
    *.mobileprovision|*.provisionprofile)
      read_profile "$f" > /tmp/profile.$$.plist
      python3 - /tmp/profile.$$.plist <<'PY'
import plistlib, sys
p = plistlib.load(open(sys.argv[1], 'rb'))
print('Name:', p.get('Name'))
print('Team:', p.get('TeamIdentifier'))
print('Expires:', p.get('ExpirationDate'))
print('App ID:', p.get('Entitlements', {}).get('application-identifier'))
print('Devices listed:', len(p.get('ProvisionedDevices', [])))
if p.get('ProvisionsAllDevices'):
    print('WARNING: ProvisionsAllDevices is set (In-House or Developer ID)')
PY
      rm -f /tmp/profile.$$.plist ;;
    *) echo "App Store Connect or APNs key: check it in your developer account" ;;
  esac
done
chmod +x signing_audit.sh
./signing_audit.sh ~/code/MyApp

# To read password-protected files you own:
P12_PASS='the password' ./signing_audit.sh ~/code/MyApp

Anything listed under "ever added in git history" counts as exposed to everyone who has ever cloned that repo, even if a later commit removed it. If the repo was ever public or shared with a contractor, treat that identity as leaked.

The script can only see one repo at a time, so finish the search by hand. Look in shared cloud drives, the attachments of old chat threads, password manager notes, CI secret stores, build servers, and the laptops of people who have left. Search for the extensions .p12, .pfx, .mobileprovision and .p8. Keep a short list of where each one lives, because you will need it again in Step 3.

Step 2: read what each file is

For a .p12 the script prints the subject, the expiry and a SHA-1 fingerprint. Apple puts your Team ID in the subject's OU field, so you can tell at a glance whether a file belongs to your team or came from somewhere else. That fingerprint matches the hex string in this command on your Mac:

security find-identity -p codesigning

If a .p12 opens with an empty password, the script warns you. Replace that file with one exported under a strong password, or better, remove it.

For a profile the script prints the name, Team ID, expiry, App ID and device count, and it warns when ProvisionsAllDevices is set. Apple says the format of provisioning profiles is not documented and may change, so treat this as a way to look at your files and don't build a product on top of it.

Step 3: compare your list with Apple's

Open Certificates, Identifiers & Profiles in your developer account and go through Certificates and Profiles. Match each entry against your list from Step 1 and ask three questions. Do you know who created it? Do you know which machine or service holds the private key? Is it still needed?

An unknown distribution certificate deserves attention straight away. Only the Account Holder or an Admin can create distribution certificates, so one you can't explain points to an account that had more access than you thought. Development certificates are less alarming, since they belong to individuals and carry the computer name in their title, but entries for people who have left should go.

Step 4: look at how the password travels

The certificate libraries in the report held .p12 files together with plaintext passwords. A password stored beside the file it protects adds almost nothing. The same layout shows up in repos as a certs/ folder with a README, or as a CI config holding P12_PASSWORD in plain text.

For GitHub Actions, GitHub's guide stores the Base64 encoded .p12, its password and the profile as secrets, then imports them into a temporary keychain during the job. GitHub-hosted runners are destroyed after the job. On self-hosted runners the keychain and profile may remain, so the guide adds a final clean-up step that runs even when the build fails. If you run your own Mac mini as a build machine, check that this step exists.

Step 5: check anything you host for installs

A second ARTEX campaign shows a risk that has nothing to do with certificates being stolen. While chasing a crypto wallet, agents found an unauthenticated API leaking AWS S3 credentials. Those credentials gave write access to a bucket serving 714 landing pages for enterprise-signed iOS apps. The agent reasoned about swapping the IPA in the manifest or replacing the page with a phishing page, then made a write and verified it. The bucket's owners later restored the original manifest.

If you distribute In-House or ad hoc builds from a website, your install flow is an HTTPS page, a manifest and an .ipa. Anyone who can write to that storage can point your users somewhere else, and your signature does nothing to stop that if they swap in an app signed with a different valid identity. Three quick tests cover the simplest of the holes the agents used:

  • Search your built front-end files for credentials: grep -RInE "passw|secret|admin_?token|aws_access" dist/ build/. Hits in compiled JavaScript are public by definition.
  • Call each admin or upload API without a session cookie and confirm you get a 401 or 403.
  • List who and what can write to the bucket or folder holding your manifest, and remove anything a web server does not need.

Revoke or rotate: the decision

For App Store only teams, the decision is easy. If you think an identity leaked, revoke it. Go to Certificates, select it, click Revoke and confirm; you need the Account Holder or Admin role. Live apps are unaffected. Afterwards, regenerate affected profiles and check App Store Connect for builds that were uploaded but not submitted, since those may turn into Invalid Binary.

For In-House apps, revoking is the expensive option, and Apple says so. Apple's deployment guide says revoking a distribution certificate invalidates every app signed with it, and advises doing it "only as a last resort", when you are sure the private key is lost or you think the certificate has been compromised. A key you can confirm was exposed meets that bar. Use this order:

  1. Find out whether your account lets you create a replacement while the old certificate stays active. Apple's support page limits most distribution certificate types to one per team, so check before you plan an overlap.
  2. Build and sign a new version of every In-House app with the replacement, and get it to users.
  3. Revoke the old certificate.
  4. Tell users that the old app will stop launching. Devices cache the OCSP answer for a period set by Apple's server, currently three to seven days, and they only learn of the revocation when that cache expires.

Revocation reaches devices slowly. A device that recently checked the certificate may keep launching apps signed with it for several days after you revoke, and that includes any app a thief signed with your key. Devices also need to reach ocsp.apple.com for the check to happen.

For a suspected Developer ID compromise, you can't revoke it from your account. Apple asks you to email product-security@apple.com. For a .p8 key, revoke it in Keys and replace it wherever it is used. Apple only lets you download a key once, so a .p8 file found in an old folder is a live key until you prove otherwise.

If a third party holds your identity

Uploading a .p12 to a signing service also puts you at odds with Apple's Developer Program License Agreement. Section 2.6 says that, except where the agreement allows it, you agree not to rent, lend, sell, redistribute, or upload to or host on any website or server the Apple Certificates. Section 2.1 makes you responsible for safeguarding your credentials and bars sharing account access with anyone who is not an authorized developer on your team.

Section 2.9 does allow a Service Provider, with a binding written agreement, acting only on your behalf. The same section says you may not use a Service Provider to submit an app to the App Store or use TestFlight on your behalf. Read those sections yourself if a contractor or vendor holds any of your signing material, and take legal advice if the answer matters. This article is not legal advice.

If you paid a signing shop to install an app on your own device, the risk sits with the app. Its certificate may have been resold, and the report says some buyers inject data-stealing libraries. Delete the app, then change any password you used inside it.

Keep the key off shared disks

The cheapest fix is having no .p12 file to lose. Cloud-managed certificates sign apps during the Xcode Organizer archive and distribution workflow in Xcode 13 or later, as long as Xcode finds no local signing certificate. Admins and Developers need an extra permission in App Store Connect to use them. With Xcode Cloud, Apple manages both the key and the certificate and you never get direct access to either.

If you sign locally, the manual certificate signing request process keeps the private key on your Mac, and it never needs to leave unless you export it. The trap is that the key is easy to forget about until you migrate to a new machine and find it missing, so keep one encrypted backup in a place only the signing owner can reach.

For In-House teams, the calendar gives you a free chance to rotate. Apple says distribution profiles expire 12 months after issue and the distribution certificate is valid for 13 months. Put both dates on a calendar with an owner's name, and treat each renewal as the moment to clear out old copies from Step 1.

What was tested

The script was run on Linux against made-up files: a self-signed certificate packed into two .p12 files, one with an empty password and one without, a fake profile signed with OpenSSL, a dummy .p8 file and a throwaway git repo. It found all of them and hid the planted password. It was not run against a real Apple certificate or on macOS, where it uses security cms to read profiles instead of OpenSSL. Try it on a copy of a repo first, and expect to adjust the password pattern for your CI files.

If you use Claude Code on iOS projects and want signing work to stop for a human, Claude Code + Xcode: The Production iOS Workflow Kit is a set of Claude Code templates, rules and agents from this blog's author. It has a release safety rule, an /ios-release command and human approval gates that cover signing. It does not audit your certificates for you, and its page says signed archives and App Store submission remain your responsibility.

Sources