Repository navigation
Anisette v3, SMS two-factor codes, and no secrets in the log - #4
Merged
Merged
Conversation
Bumps upstream_repo to ac02e35 (AltServer-Windows branch sms-2fa): GrandSlam's "secondaryAuth" now gets an SMS code through the JSON endpoints from rileytestut/AltSign#62 and isideload, instead of being mistaken for an account without 2FA. README-NG documents it as Fix 7, experimental until it has signed in against Apple. Built for x86_64; not yet tried against Apple.
Bumps upstream_repo to 151d8a2 (AltServer-Windows sms-2fa). A sign-in on 2026-11-05 showed that an account without a trusted device can get trustedDeviceSecondaryAuth, whose validation answers an SMS code with 200 without accepting it. ALTSERVER_2FA=sms forces the SMS endpoints; 2xx answers with serviceErrors no longer count as success, and the log shows au, hsc and which SMS code to enter. README-NG's Fix 7 describes it. Built for x86_64; not yet tried against Apple.
Bumps upstream_repo to f76225d (AltServer-Windows sms-2fa). The 2026-11-05 SMS test validated the code, but new.ani.sidestore.io gives a new identity on every request, so the second sign-in came from another device and Apple asked for 2FA again. Anisette refreshes are now kept only when they return the same device, and the Device-Id is logged at each step. README-NG's Fix 7 describes it. Built for x86_64; not yet tried against Apple.
upstream_repo moves to 63e0b36 (AltServer-Windows ng-2026-11): - ed1317c removes the GSA token, the decrypted sign-in response, SRP byte dumps, SMS response bodies and anisette values from the log; - 63e0b36 makes ALTSERVER_2FA default to auto, which reads Apple's 2FA info and takes the SMS path for accounts without trusted devices, without requesting a second code.
A v1 anisette server hands out whatever identity it likes, and new.ani.sidestore.io hands out a new one on every request, so Apple sees a new device at every sign-in and asks for a 2FA code each time. An anisette v3 server instead provisions one identity, whose keychain identifier and adi.pb stay on this computer. src/AnisetteV3.cpp speaks SideStore's anisette-v3-server protocol, as omnisette's remote_anisette_v3.rs does: - GET /v3/client_info for the client info and User-Agent; - provisioning: Apple's lookup for the midStartProvisioning and midFinishProvisioning URLs, then the /v3/provisioning_session websocket (GiveIdentifier, spim, cpim -> ptm/tk, adi_pb), relaying the Apple requests as the device (MD-LU = SHA-256 of the identifier, Device-Id = the identifier as a UUID); - POST /v3/get_headers for the one-time password, machine ID and routing info; -45061 means provision again. The identity is kept in $XDG_CONFIG_HOME (or ~/.config) /AltServer/anisette-v3/<host>.json, mode 600 in a 700 directory, written to a temporary file and renamed. cpprestsdk's websocket client, already in the builder image, carries the websocket; HTTPS_PROXY is honoured for the anisette and provisioning requests. ALTSERVER_ANISETTE_PROTOCOL selects v3, v1 or auto (the default): v3 when the server answers /v3/client_info. A server that can't be reached is an error, not a reason to fall back to v1. The client info filter (ALTSERVER_CLIENT_INFO, Xcode sanitizer) is shared by both protocols. The v1 path no longer logs the anisette JSON or its values; the log shows the protocol, the client info and the first 8 characters of the device ID. Tested in the sandbox against new.ani.sidestore.io up to Apple's lookup, which the sandbox network policy blocks: auto selects v3, client info is read, a new identity is created. Websocket provisioning and get_headers are not yet tested end to end.
The default anisette server was armconverter.com, which predates the Mac anisette requirement. It is now https://new.ani.sidestore.io, which provides Mac anisette and speaks v3, so a user who sets nothing gets one stable identity. An empty ALTSERVER_ANISETTE_SERVER also means the default. README-NG: - Fix 5: mac-ani.jkcoxson.com now gets -80043; new.ani is the default. - Fix 7: verified with ALTSERVER_2FA=sms; documents ALTSERVER_2FA auto | sms | trusteddevice and "resend". - Fix 8 (new): anisette v3, ALTSERVER_ANISETTE_PROTOCOL, where the identity is kept. - Log output: what the log shows and never shows. - Running: no mac-ani; sanity checks for Fixes 7 and 8.
With gsa.apple.com allowed, the v3 client provisioned an identity through new.ani.sidestore.io's websocket and Apple's midStart/ midFinishProvisioning, saved it with mode 600, reused it on the next run, and Apple answered a made-up account with -20970 both times.
From the review of ng..ng-2026-11: - The proxy follows the URL: HTTPS_PROXY for https/wss, HTTP_PROXY for http/ws, and none for hosts NO_PROXY lists. Before, HTTPS_PROXY was used for every request, so a local v3 server at http://localhost failed on a host with a proxy set. - The provisioning websocket is closed on every failure (missing spim/ptm, parse errors, failed sends), not only when the server reports one. The session loop moves to RunProvisioningSession(). - A get_headers answer that isn't JSON (a 502 page) now says "answered HTTP 502 without JSON" instead of a bare JSON error. - A failed RAND_bytes stops instead of leaving an all-zero identifier. - /v3/client_info is cached per server, so auto detection and the first fetch no longer request it twice. - A path in the server URL is added to the identity file's name, so two servers on one host don't share an identity. A URL without a path keeps its file name, so existing identities stay valid. - README-NG: ALTSERVER_2FA=trusteddevice still uses SMS for au=secondaryAuth, which has no trusted device; only the v3 client uses a proxy. Rebuilt for x86_64 and aarch64; v3 provisioning, identity reuse and the log checks repeated on both.
jaakkopalvaila
force-pushed
the
ng-2026-11
branch
from
November 5, 2026 19:50
ef60469 to
947bb10
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Apple's sign-in changes since mid-October broke the fork:
-80045/-80046(fixed earlier by using Mac anisette), and since 2026-11-05 Apple refuses the sharedmac-ani.jkcoxson.comidentity with-80043. This brings the fork back to a working state for other users.Changes
src/AnisetteV3.*): provisions an identity once over the v3 websocket, saves it (~/.config/AltServer/anisette-v3/<host>.json, mode 600) and reuses it, so Apple sees the same device on every refresh.ALTSERVER_ANISETTE_PROTOCOL=auto(default) |v3|v1.https://new.ani.sidestore.io(Mac client info, v3).PUT /auth/verify/phone,POST /auth/verify/phone/securitycode, JSON).ALTSERVER_2FA=auto(default, reads the account's 2FA info fromGET /auth) |sms|trusteddevice. One anisette identity is kept through the whole sign-in.-d.upstream_repo→ jaakkopalvaila/AltServer-Windowsng-fixes5224db7.Review
The full diff (
5c32531..ng-2026-11, AltSign7358c74..5224db7) was reviewed for correctness bugs before this PR: 8 findings in the v3 client and README, all fixed in 947bb10 (proxy selection, websocket closed on errors, non-JSON errors,RAND_bytescheck,client_infocache, identity file name). desloppify found nothing to fix in the changed lines.Tests
hsc=200, Installation Succeeded; AltStore Classic throughaltserver.servicealso refreshed with the same identity, no 2FA. SMS 2FA verified earlier withALTSERVER_2FA=sms. The full log had no secrets.-20970, so the anisette passes).ALTSERVER_2FA=smsis the known-good fallback); armv7 and i386 at runtime.