Skip to content

Anisette v3, SMS two-factor codes, and no secrets in the log - #4

Merged
jaakkopalvaila merged 8 commits into
ngfrom
ng-2026-11
Nov 5, 2026
Merged

jaakkopalvaila merged 8 commits into
ngfrom
ng-2026-11

Conversation

@jaakkopalvaila

@jaakkopalvaila jaakkopalvaila commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

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 shared mac-ani.jkcoxson.com identity with -80043. This brings the fork back to a working state for other users.

Changes

  • Anisette v3 client (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.
  • Default anisette server https://new.ani.sidestore.io (Mac client info, v3).
  • Two-factor codes by SMS for accounts without a trusted device (PUT /auth/verify/phone, POST /auth/verify/phone/securitycode, JSON). ALTSERVER_2FA = auto (default, reads the account's 2FA info from GET /auth) | sms | trusteddevice. One anisette identity is kept through the whole sign-in.
  • No secrets in the output: GSA tokens, the sign-in plist, anisette values and codes are no longer printed, also with -d.
  • README-NG: Fixes 7 and 8, log output, settings, and no mac-ani in the examples.
  • AltSign: upstream_repo → jaakkopalvaila/AltServer-Windows ng-fixes 5224db7.

Review

The full diff (5c32531..ng-2026-11, AltSign 7358c74..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_bytes check, client_info cache, identity file name). desloppify found nothing to fix in the changed lines.

Tests

  • x86_64, home server (Ubuntu, netmuxd over Wi-Fi, iOS 27.0), real Apple ID: v3 provisioning, 2FA (auto chose the trusted-device path), second sign-in hsc=200, Installation Succeeded; AltStore Classic through altserver.service also refreshed with the same identity, no 2FA. SMS 2FA verified earlier with ALTSERVER_2FA=sms. The full log had no secrets.
  • x86_64 and aarch64 (final build): offline v3 provisioning, identity reuse, and secret checks with a made-up account (Apple answers -20970, so the anisette passes).
  • Not tested: automatic SMS selection on an account that has no trusted device (ALTSERVER_2FA=sms is the known-good fallback); armv7 and i386 at runtime.

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
jaakkopalvaila merged commit 8ab2136 into ng Nov 5, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant