Skip to content
Info disclosure Write-up Beginner

I found an Apple ID Enumeration Oracle in iCloud Keychain Escrow

The iCloud Keychain escrow service returned different authentication error messages depending on whether the supplied DSID or email address belonged to an active, locked, or non-existent Apple ID. An unauthenticated attacker could therefore enumerate Apple IDs and learn account states without any credentials.

medium.com

Published on medium.com

Cybersecurity

Fábio Luís @scanpt, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 7 min read.

Context

The target was escrowproxy.icloud.com, an Apple service that exposes an escrow API. One of the exposed API paths was /escrowproxy/api/get_records. The service authenticates clients with HTTP Basic Authentication, and the username field accepts a DSID, Apple's internal numeric identifier for an account. The researcher also found that the same authentication flow accepts email addresses as the username.

What the escrow feature normally does beyond this is not described in the report. The relevant behaviour is the authentication step: a client supplies an identifier and a password, and the service decides whether to accept it.

Setup

The report does not describe any special accounts or roles; testing used curl, base64 and a small PoC script. The preconditions are simply that the service is reachable and that the tester can send unauthenticated requests to the escrow API paths. The researcher tested three DSID states (active, locked, non-existent) and two email states (associated with an Apple ID, not associated with one), always with a deliberately incorrect password.

Finding it

While looking at escrowproxy.icloud.com, the researcher noticed something odd in how the service handled failed authentication. The expectation was a generic authentication failure. Instead, the response changed depending on the DSID supplied:

  • a valid DSID with the wrong password returned one error;
  • a locked account returned another;
  • a DSID that did not exist returned something completely different.

That difference was the start of the bug. After testing the behaviour more systematically, the researcher found that the same authentication flow could also be used with email addresses, making it possible to determine whether an email was associated with an Apple ID.

From the original on medium.com

Exploitation

Step 1: Compare responses for three DSID states

The researcher sent requests with the same invalid password but different DSIDs. For an active account, the service returned:

Text
Your Apple ID or password was entered incorrectly

For a locked account:

Text
This Apple ID has been locked for security reasons

For a DSID that did not exist:

Text
unknown ds error code: -20946

The password was wrong in every case; the only thing changing was the identifier. The authentication response itself was therefore revealing information about the account behind that identifier.

Step 2: Check whether the behaviour is reliable

To see whether this was just inconsistent error handling or something reliable enough to classify account states, the researcher repeated the requests several times with delays between them. The responses stayed consistent, which made the behaviour a pre-authentication account-state oracle: the input DSID is classified as active, locked or invalid according to which of the three messages comes back.

The interesting part was not that authentication failed, since it was supposed to fail. The problem was that an external client could tell why it failed.

Step 3: Look at the internal states in the responses

Some responses contained more than a user-facing error message. The researcher also saw strings such as:

Text
Authentication failed for usrId:<DSID>authentication against ds failed

along with internal-looking status values including:

Text
AccountDSLockedUnauthenticated

These distinctions made the oracle easier to classify: instead of treating every failed login as the same event, the API was exposing different states from the backend authentication flow to the client.

Step 4: Try email addresses as the username

DSIDs are internal numeric identifiers, so the researcher tried non-numeric usernames: email addresses. The behaviour differed depending on whether the address was associated with an Apple ID. In the testing, addresses associated with Apple IDs returned:

Text
AccountDSLocked

while addresses not associated with Apple IDs returned:

Text
Unauthenticated

This was more useful for enumeration than the DSID behaviour, because the input no longer needed to be an internal numeric identifier. An ordinary email address was enough, turning the endpoint into an email-to-Apple-ID existence oracle.

Step 5: Check the other endpoints

To see whether the behaviour was specific to get_records, the researcher checked the service and found nine relevant API endpoints:

  • get_records
  • recover
  • srp_init
  • srp_verify
  • generate_srp6_verify_password
  • store_record
  • store_records
  • delete_record
  • get_metadata

The same general differential authentication behaviour was present across the endpoints tested.

Step 6: Check for throttling

The researcher sent 50 sequential requests to see whether repeated requests would trigger throttling. The result was:

Text
50 requests50 × HTTP 4010 × HTTP 4290 × HTTP 403

No throttling was observed during that test. The report notes that this does not prove the service had no rate limiting under every condition, but it showed that the oracle remained usable across repeated sequential requests without being blocked during the testing.

Step 7: Reproduce with curl

The basic behaviour could be reproduced with curl and base64:

Bash
curl -sk -X POST \  -H "Content-Type: application/x-apple-plist" \  -H "Authorization: Basic $(echo -n 'DSID:WrongPassword' | base64)" \  -d '<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN""http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict>    <key>c</key>    <string>g</string></dict></plist>' \  "https://escrowproxy.icloud.com/escrowproxy/api/get_records"

The request posts an Apple property list body to /escrowproxy/api/get_records and sends Basic credentials built from a placeholder identifier and a wrong password. The password stays invalid; changing only the identifier is enough to produce the different authentication responses.

The researcher also wrote a small PoC script while testing. The original report covered active DSIDs, locked DSIDs, invalid DSIDs, registered email addresses, unregistered email addresses, multiple escrowproxy endpoints, and repeated requests to check for throttling.

Root cause

The service returned different authentication errors depending on the backend state of the identifier: active account with a wrong password, locked account, non-existent DSID, and, for email addresses, associated versus not associated with an Apple ID. Some responses also carried internal-looking status values such as AccountDSLockedUnauthenticated and strings such as Authentication failed for usrId:<DSID>authentication against ds failed.

In other words, the backend authentication flow distinguished several states, and those distinctions reached the unauthenticated client instead of being collapsed into a single generic failure. The report does not describe the code or configuration that produced this, so the exact implementation mistake is not stated.

Impact

This was not an account takeover. There was no authentication bypass, and the vulnerability did not provide access to an Apple account. The issue was the information exposed before successful authentication.

For DSIDs, an attacker could distinguish active, locked and invalid identifiers. For email addresses, the behaviour could be used to infer whether an address was associated with an Apple ID. That information can be a building block for more targeted attacks: confirming that an email address is associated with an Apple ID makes Apple-specific phishing more targeted, and distinguishing active accounts from invalid identifiers gives an attacker information that should not normally be available without authentication.

The report is explicit that this was an enumeration and account-state disclosure issue, not an account takeover vulnerability.

Fix

Apple updated the production service. The researcher re-tested the affected cases on July 2, 2026. After the fix, all the previously distinguishable scenarios returned the same response:

Text
errorCode: -3001errorMessage: Authentication failedHTTP 401

The cases tested were:

  • valid DSID with an incorrect password;
  • locked DSID;
  • non-existent DSID;
  • email associated with an Apple ID;
  • email not associated with an Apple ID.

The previous differential responses were gone, and the behaviour was verified across the affected endpoints tested originally. The oracle was no longer observable. On July 7, Apple Product Security confirmed the verification of the fix, and Apple later added Fábio Luís (@scanpt) to its Web Server Security Acknowledgements for July 2026.

The researcher's view of the correct behaviour is that an unauthenticated client should not be able to distinguish an active account with a wrong password, a locked account and no account at all. A single response such as Authentication failed removes the oracle; the backend can still know why authentication failed, but the client does not need to.

Variants to test

  • Other Basic Auth endpoints that accept identifiers. Send the same wrong password with a valid identifier, a locked identifier and a non-existent identifier. A positive result is three different error bodies or status codes, or internal status strings such as AccountDSLockedUnauthenticated appearing in the response.
  • Non-numeric usernames. Replace the numeric identifier with an email address or username and compare responses for registered and unregistered values. A positive result is a consistent difference between the two, which turns the endpoint into an existence oracle.
  • Sibling endpoints on the same service. Repeat the comparison on the API paths the service exposes, as was done here across nine relevant endpoints. A positive result is the same differential behaviour on paths beyond the first one found.
  • Throttling checks. Send a batch of sequential requests and count the status codes. A positive result for the oracle is a batch that stays usable without 429 or 403 responses, as in the 50-request test here, though that does not prove there is no rate limiting.
  • Error strings from the backend. Look for internal state names, user identifiers or backend flow messages in failure responses. A positive result is any internal value that lets a client classify the account state before authentication.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 15 min read.

What happened, in plain words

A security researcher, Fábio Luís (@scanpt), was looking at an Apple web service called escrowproxy.icloud.com. The report does not describe what the escrow feature does beyond the login step. The service has an API, which is a set of web addresses that programs (rather than people clicking in a browser) can talk to.

The service asks callers to log in using a very old and simple login method called HTTP Basic Authentication. In this method, the caller sends a username and a password with every request. The username here can be a DSID, which is Apple's internal number for an account, or an email address.

The researcher sent requests with deliberately wrong passwords and noticed that the error message changed depending on which account identifier was used. A real, active account gave one message. A locked account gave another. An identifier that did not exist gave a third. Later, email addresses gave yet another pair of different answers depending on whether the address was linked to an Apple ID.

That means anyone on the internet, without logging in, could ask the service whether an email address has an Apple ID, or classify a DSID as active, locked or invalid, and get a reliable answer. This is called an enumeration oracle. It is not a break-in: nobody got into an account. But it leaks information that should only be visible after a successful login.

The researcher reported it to Apple on March 29, 2026. Apple fixed it, and on July 2, 2026 the researcher re-tested and found that every case now returned the same generic failure. Apple confirmed the fix on July 7, 2026 and credited the researcher in its Web Server Security Acknowledgements for July 2026.

From the original on medium.com

The service and the login step

The target was:

escrowproxy.icloud.com

One of the exposed API paths was:

/escrowproxy/api/get_records

Think of an API path as a specific counter in a large building: the building is the server, and each path is a window where you can make one particular kind of request. The report does not say what get_records does.

The service used HTTP Basic Authentication. In Basic Authentication, the client puts the username and password together with a colon, encodes the result in base64 (a way of turning any text into plain letters and digits so it can travel safely in a header), and sends it in an Authorization header. A header is a small labelled line of extra information attached to a web request, like the address block on an envelope.

The username could be a DSID. A DSID is Apple's internal numeric identifier for an account, so it is not something an ordinary person normally sees or types.

The researcher's idea was simple: keep the password deliberately wrong, and change only the identifier. If the service is well behaved, every wrong login should look identical from the outside. If it is not, the differences will show up.

What the escrow feature normally does beyond this login step is not described in the report. The part that matters here is the login check: a client supplies an identifier and a password, and the service decides whether to accept it.

Finding it

While looking at escrowproxy.icloud.com, the researcher noticed something odd about how the service handled failed authentication. The expectation was a generic authentication failure, the same boring error for everyone. Instead, the response changed depending on the DSID supplied:

  • a valid DSID with the wrong password returned one error;
  • a locked account returned another;
  • a DSID that did not exist returned something completely different.

That difference was the start of the bug. After testing the behaviour more systematically, the researcher found that the same authentication flow could also be used with email addresses, which made it possible to determine whether an email was associated with an Apple ID.

Step 1: Compare responses for three DSID states

The researcher sent requests with the same invalid password but different DSIDs. For an active account, the service returned:

Text
Your Apple ID or password was entered incorrectly

For a locked account:

Text
This Apple ID has been locked for security reasons

For a DSID that did not exist:

Text
unknown ds error code: -20946

What each block means:

  • The first message is the response for an active account with a wrong password.
  • The second message says the account exists but has been locked for security reasons. That is a different state of the same account.
  • The third message is not a user-facing message at all. It is an internal error code, -20946, leaking out of the system, and it tells the caller that no such identifier exists.

The password was wrong in every case; the only thing changing was the identifier. So the authentication response itself was revealing information about the account behind that identifier. This is the core of the bug: the failure message became a question-and-answer service about accounts.

Step 2: Check whether the behaviour is reliable

A single odd response could just be a fluke, a temporary glitch, or inconsistent error handling. To find out whether this was reliable enough to classify account states, the researcher repeated the requests several times with delays between them. The responses stayed consistent.

That consistency is what turns a curiosity into a pre-authentication account-state oracle. An oracle, in security, is any system that answers a yes/no or multiple-choice question for you. Here the input DSID is classified as active, locked or invalid according to which of the three messages comes back, and this happens before any successful login.

The interesting part was not that authentication failed, since it was supposed to fail. The problem was that an external client could tell why it failed.

Step 3: Look at the internal states in the responses

Some responses contained more than a user-facing error message. The researcher also saw strings such as:

Text
Authentication failed for usrId:<DSID>authentication against ds failed

along with internal-looking status values including:

Text
AccountDSLockedUnauthenticated

What these show:

  • The first string contains the internal user identifier (usrId:<DSID>) and mentions ds. This is the kind of text a developer would expect to see in a server log, not in a reply to an anonymous stranger on the internet.
  • The second is an internal status name, AccountDSLockedUnauthenticated. It reads like a label from the backend's own list of account states.

These distinctions made the oracle even easier to classify. Instead of treating every failed login as the same event, the API was exposing different states from the backend authentication flow to the client. The backend knew several things about the account; the mistake was passing those distinctions out to the caller.

Step 4: Try email addresses as the username

DSIDs are internal numeric identifiers, which limits how useful the oracle is: an attacker would first need to know a DSID. So the researcher tried non-numeric usernames: email addresses.

The behaviour differed depending on whether the address was associated with an Apple ID. In the testing, addresses associated with Apple IDs returned:

Text
AccountDSLocked

while addresses not associated with Apple IDs returned:

Text
Unauthenticated

What this means:

  • AccountDSLocked was returned for addresses that do have an Apple ID.
  • Unauthenticated appeared for addresses that do not.

Two different answers to the same wrong-password question, split by whether the email exists as an Apple ID. This was more useful for enumeration than the DSID behaviour, because the input no longer needed to be an internal numeric identifier. An ordinary email address was enough, which turned the endpoint into an email-to-Apple-ID existence oracle. An ordinary email address was enough to ask whether it was associated with an Apple ID.

Step 5: Check the other endpoints

A single affected path might be a one-off mistake. To see whether the behaviour was specific to get_records, the researcher checked the service and found nine relevant API endpoints:

  • get_records
  • recover
  • srp_init
  • srp_verify
  • generate_srp6_verify_password
  • store_record
  • store_records
  • delete_record
  • get_metadata

The same general differential authentication behaviour was present across the endpoints tested.

Step 6: Check for throttling

An oracle is more useful if you can query it repeatedly without being stopped. Many services use throttling, also called rate limiting: after too many requests in a short time, the server starts refusing them, often with HTTP status 429 ("Too Many Requests") or 403 ("Forbidden").

The researcher sent 50 sequential requests to see whether repeated requests would trigger throttling. The result was:

Text
50 requests50 × HTTP 4010 × HTTP 4290 × HTTP 403

Reading that block:

  • 50 requests is the total sent.
  • 50 × HTTP 401 means all fifty came back with status 401, which is the standard "Unauthorized" code for a failed login.
  • 0 × HTTP 429 means none were refused for being too many.
  • 0 × HTTP 403 means none were refused as forbidden.

No throttling was observed during that test. The report notes that this does not prove the service had no rate limiting under every condition, but it showed that the oracle remained usable across repeated sequential requests without being blocked during the testing.

Step 7: Reproduce with curl

The basic behaviour could be reproduced with curl and base64. curl is a command-line tool for sending web requests; base64 is the encoding used by Basic Authentication.

Bash
curl -sk -X POST \  -H "Content-Type: application/x-apple-plist" \  -H "Authorization: Basic $(echo -n 'DSID:WrongPassword' | base64)" \  -d '<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN""http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict>    <key>c</key>    <string>g</string></dict></plist>' \  "https://escrowproxy.icloud.com/escrowproxy/api/get_records"

Line by line:

  • curl is the program being run.
  • -X POST says this is a POST request, the kind normally used to send data to a server.
  • -H "Content-Type: application/x-apple-plist" is a header telling the server that the body is an Apple property list, a data format Apple uses for configuration and structured data.
  • -H "Authorization: Basic $(echo -n 'DSID:WrongPassword' | base64)" builds the Basic Authentication header. The part inside $( ... ) takes the text DSID:WrongPassword, encodes it with base64, and pastes the result after the word Basic. The -n stops echo from adding a newline, which would corrupt the encoding. Here DSID stands for the identifier being tested and WrongPassword is the deliberately wrong password.
  • -d '...' is the body of the request: an XML property list containing a dictionary with one key, c, set to the string g.
  • The final argument is the URL: https://escrowproxy.icloud.com/escrowproxy/api/get_records.

The request posts an Apple property list body to /escrowproxy/api/get_records and sends Basic credentials built from the identifier and a wrong password. The password stays invalid; changing only the identifier is enough to produce the different authentication responses.

The researcher also wrote a small PoC script while testing. PoC stands for proof of concept, a small program that demonstrates the issue. The original report covered active DSIDs, locked DSIDs, invalid DSIDs, registered email addresses, unregistered email addresses, multiple escrowproxy endpoints, and repeated requests to check for throttling.

Root cause

The service returned different authentication errors depending on the backend state of the identifier: active account with a wrong password, locked account, non-existent DSID, and, for email addresses, associated versus not associated with an Apple ID. Some responses also carried internal-looking status values such as AccountDSLockedUnauthenticated and strings such as Authentication failed for usrId:<DSID>authentication against ds failed.

In other words, the backend authentication flow distinguished several states, and those distinctions reached the unauthenticated client instead of being collapsed into a single generic failure. The likely design issue is that the error path forwarded backend state to the response rather than mapping every failure to one message.

A useful comparison is a receptionist. If you ask for someone who is not there, someone who is there but busy, and someone whose office is locked, a good receptionist says "I cannot help with that" every time. A careless one says "nobody by that name", "she is in a meeting" and "her office is locked", which tells a stranger a lot about the building.

Impact

This was not an account takeover. There was no authentication bypass, and the vulnerability did not provide access to an Apple account. The issue was the information exposed before successful authentication.

For DSIDs, an attacker could distinguish active, locked and invalid identifiers. For email addresses, the behaviour could be used to infer whether an address was associated with an Apple ID. That information can be a building block for more targeted attacks: confirming that an email address is associated with an Apple ID makes Apple-specific phishing more targeted, and distinguishing active accounts from invalid identifiers gives an attacker information that should not normally be available without authentication.

Phishing, in short, is a fake message designed to make someone hand over a password or click something harmful. It works better when the sender knows the target really has an Apple account, because the fake message can be written to look relevant.

The report is explicit that this was an enumeration and account-state disclosure issue, not an account takeover vulnerability.

Fix

Apple updated the production service. The researcher re-tested the affected cases on July 2, 2026. After the fix, all the previously distinguishable scenarios returned the same response:

Text
errorCode: -3001errorMessage: Authentication failedHTTP 401

Reading that block:

  • errorCode: -3001 is the error code in the response after the fix.
  • errorMessage: Authentication failed is a generic message that says nothing about the account.
  • HTTP 401 is the standard "Unauthorized" status for a failed login.

The cases tested were:

  • valid DSID with an incorrect password;
  • locked DSID;
  • non-existent DSID;
  • email associated with an Apple ID;
  • email not associated with an Apple ID.

The previous differential responses were gone, and the behaviour was verified across the affected endpoints tested originally. The oracle was no longer observable. On July 7, Apple Product Security confirmed the verification of the fix, and Apple later added Fábio Luís (@scanpt) to its Web Server Security Acknowledgements for July 2026.

The researcher's view of the correct behaviour is that an unauthenticated client should not be able to distinguish an active account with a wrong password, a locked account and no account at all. A single response such as Authentication failed removes the oracle; the backend can still know why authentication failed, but the client does not need to.

Variants to test

If you want to look for the same class of bug elsewhere, these checks follow from the report:

  • Other Basic Auth endpoints that accept identifiers. Send the same wrong password with a valid identifier, a locked identifier and a non-existent identifier. A positive result is three different error bodies or status codes, or internal status strings such as AccountDSLockedUnauthenticated appearing in the response.
  • Non-numeric usernames. Replace the numeric identifier with an email address or username and compare responses for registered and unregistered values. A positive result is a consistent difference between the two, which turns the endpoint into an existence oracle.
  • Sibling endpoints on the same service. Repeat the comparison on every API path the service exposes, as was done here across nine endpoints. A positive result is the same differential behaviour on paths beyond the first one found.
  • Throttling checks. Send a batch of sequential requests and count the status codes. A positive result for the oracle is a batch that stays usable without 429 or 403 responses, as in the 50-request test here.
  • Error strings from the backend. Look for internal state names, user identifiers or backend flow messages in failure responses. A positive result is any internal value that lets a client classify the account state before authentication.

Timeline

  • March 29, 2026: reported the vulnerability to Apple.
  • July 2, 2026: re-tested the production service and confirmed that the differential authentication behaviour had been fixed.
  • July 7, 2026: Apple Product Security confirmed the verification of the fix.
  • July 2026: Apple published the credit as Fábio Luís (@scanpt) in its Web Server Security Acknowledgements.
  • August 2026: public disclosure.

Glossary

  • API: a set of web addresses and rules that programs use to talk to a service, as opposed to pages a person clicks through in a browser.
  • API path: the part of a URL that names one specific operation on a service, such as /escrowproxy/api/get_records.
  • Authentication: the process of proving who you are, usually with a username and password.
  • HTTP Basic Authentication: a simple login method where the username and password are joined with a colon, encoded in base64 and sent in an Authorization header with each request.
  • Header: a labelled line of extra information sent with a web request or response, such as the content type or the credentials.
  • Base64: an encoding that turns any text into plain letters, digits and a few symbols so it can travel safely inside a header. It is not encryption; anyone can decode it.
  • DSID: Apple's internal numeric identifier for an account.
  • Endpoint: a specific address on a server that accepts requests, essentially the same as an API path.
  • Escrow: a feature that keeps a protected copy of data so it can be recovered later, here encrypted keychain data stored by iCloud Keychain.
  • iCloud Keychain: Apple's feature for syncing passwords and keys across a user's devices.
  • Oracle: any system that reliably answers a question for an attacker, here whether an identifier exists, is locked, or belongs to an Apple ID.
  • Enumeration: systematically testing many inputs to learn which ones exist or are valid, such as checking a list of email addresses against a service.
  • Account-state disclosure: leaking whether an account is active, locked or non-existent.
  • Pre-authentication: happening before a successful login, so available to anyone on the internet.
  • Differential response: a reply that differs depending on hidden internal conditions, which is what creates the oracle.
  • HTTP status code: a number in a web response that summarises the result, such as 401 for a failed login, 429 for too many requests and 403 for forbidden.
  • 401 Unauthorized: the standard status for a request that failed authentication.
  • 429 Too Many Requests: the standard status for a request refused because of rate limiting.
  • 403 Forbidden: the standard status for a request the server refuses to allow.
  • Throttling / rate limiting: deliberately refusing requests after too many arrive in a short time, to stop abuse.
  • curl: a command-line program for sending web requests.
  • POST: an HTTP method normally used to send data to a server.
  • Property list (plist): an Apple data format, often written in XML, for structured configuration and data.
  • XML: a text format that uses tags to structure data.
  • PoC (proof of concept): a small script or set of requests that demonstrates a vulnerability.
  • Phishing: a fake message designed to trick someone into revealing credentials or clicking something harmful.
  • Account takeover: gaining control of someone else's account, which this issue did not allow.
  • Authentication bypass: getting past a login check without valid credentials, which this issue did not allow.
  • Root cause: the underlying reason a bug exists, as opposed to its visible symptoms.
  • Production service: the live system real users talk to, as opposed to a test environment.
  • Disclosure: making the details of a fixed vulnerability public.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.