SBSD is Akamai's second scoring channel. A property that uses it serves a
bundle script, and that bundle POSTs its own bodies back to the path it was
served from — separately from, and in addition to, the _abck sensor the
sensor/ examples solve. Where that path is varies by
property; see finding the bundle.
- API reference: https://docs.xhr.dev/api-akamai-sbsd.html
- The other channel:
src/akamai/sensor
The sensor lane is a conversation. SBSD is a single request:
_abck sensor |
SBSD | |
|---|---|---|
| transport | WebSocket, /akamai/session |
one POST, /akamai/sbsd/generate-session |
| shape | rounds until the cookie is accepted | a ledger of bodies, issued once |
| bound to | the origin | one document, for five minutes |
| your job | relay each submission through the browser | rewrite the page's own carrier POSTs |
You do not send anything new. The page already POSTs to the bundle's own path; the integration intercepts those requests and swaps the body for the next row of the ledger. Ordering is FIFO and is not negotiable.
/.well-known/sbsd is one convention, not the rule. The common alternative is
an obfuscated per-property path sitting right next to the _abck sensor script
under the same random prefix, with nothing in either path naming the channel:
hilton.com /78jHEHB-.../6LncB sensor
/.well-known/sbsd/953343??v=<uuid> bundle
aa.com /bJ21n/.../fQUZPAE/Q01H/JFVIT0YB sensor
/bJ21n/.../K0ciPAE/NQdp/VyRmPU8Y?v=<uuid> bundle
aircanada.com /OfdcKMrdr/.../AHckAWsB/Cz/dXI1ASFTwB sensor
/OfdcKMrdr/.../MWEsAWsB/Az/hjXWlQUFQY?v=… bundle
solver.ts discovers it rather than being told: what identifies the bundle,
wherever it lives, is the UUID v= on its src. That value seeds the
bundle's codec rather than versioning a file, so an ordinary ?v=3.5.6
cache-buster — and every site ships dozens — does not look like it. Carrier
POSTs then go to the same pathname, with a different query or none. Pass
sbsdPath to attach() if you meet a property that hides it better.
Two things this changes about how you survey a target:
bm_s,bm_so,bm_scandbm_lsoin the jar mean SBSD is running, even if you never saw a/.well-known/sbsdrequest. All three properties above set them; only one of the three uses the conventional path.- A site that looks unprotected at its apex may not be.
www.aircanada.com/is a region chooser and serves to anyone;/ca/en/aco/home.htmlbehind it is challenged.
And one that runs the channel without challenging: store.playstation.com
serves an SBSD bundle from an obfuscated path and sets bm_s, but its public
store pages render for an ordinary browser. There is no example for it because
there is nothing to assert — a run there passes with or without a solver.
One POST returns expectedCap rows — three, today — for the document that is
live at that moment:
Three things about it are worth internalising, because each one fails quietly:
- Rows are capacity, not a promise. The page emits as many carriers as it emits. If it emits four and you have three, that is a hard stop — abort the fourth. Letting the native body through hands Akamai a payload from an uninstrumented page alongside yours, which is worse than sending nothing.
- The ledger belongs to one document. The bodies are computed from a snapshot of the live page: its DOM, its cookies, its tab id. Replaying them against a second document, a second tab or a later load is a mismatch. The server will not issue one for a snapshot older than five minutes.
- The first carrier has to be held. The snapshot reads
sessionStorage.ak_bm_tab_id, which only exists once the bundle has run. So the request that triggers generation is also the one that waits for it. document.htmlispage.content(), not the served bytes. With nodomResourceInventoryin the request the server extracts one from the HTML you send, so it has to be the DOM the page is actually running — the bundle injects into the document after it is served.
The first document a protected property serves is a small Akamai bootstrap that
reloads itself once its SBSD carrier is answered. The real page — and the
_abck sensor script on it — only exists after that. So:
- install the router before the first navigation,
- let the SBSD lane answer the bootstrap,
- solve
_abckagainst the document you actually wanted.
attach() does the first two and hands you solveAbck() for the third.
solver.ts exports one function:
import { attach } from '#src/akamai/sbsd/solver.js';
const akamai = attach(page, {
host: process.env['host'], // as in .env; http/ws or https/wss both work
origin: 'https://www.hilton.com', // only this origin is intercepted
solverApiKey, // sent as x-api-key on both the POST and the upgrade
});
await page.goto(url); // SBSD is answered during this
// ... reach the real document, do whatever you came to do ...
await akamai.solveAbck(); // resolves when _abck reaches ~0~attach is synchronous and installs the route handler immediately, which is
the point — an SBSD carrier that fires before the handler exists is a native
payload already on the wire.
On a property that runs only SBSD, do not call solveAbck(); it rejects,
because no _abck sensor script was ever captured.
attach() takes two more options, both for the awkward cases:
| option | what it does |
|---|---|
sbsdPath |
pin the bundle's pathname instead of discovering it |
sensor |
'solver' (default) captures the _abck script and stubs it out, waiting for solveAbck(). 'page' leaves it alone and lets the page answer _abck itself — use it when SBSD is the only channel you need answered. |
sensor: 'page' is worth knowing about: the default replaces the sensor
script, so a page that was solving _abck on its own stops doing so the moment
you attach. If you only came for SBSD, say so.
| file | what it shows | status |
|---|---|---|
hilton.ts |
both channels on one page, then a real hotel search behind the challenge | solves end to end |
aa.ts |
the bundle on an obfuscated path, discovered rather than configured | solves end to end |
aircanada.ts |
SBSD only, on a property that does not gate on _abck |
solves end to end |
magazineluiza.ts |
both channels | solves end to end |
tractorsupply.ts |
both channels | solves end to end |
oakley.ts |
both channels, then a real sign-in with username=/password= from .env |
solves end to end |
united.ts |
both channels, then a two-step sign-in (united_username=/united_password=); answers SMS MFA from a file |
solves end to end |
npm run hilton
npm run aa
npm run aircanada
npm run magazineluiza
npm run tractorsupply
npm run oakley
npm run unitedThese three targets disagree about what the sensor is for, which is the most useful thing about having them side by side:
gates on _abck? |
what the example does | |
|---|---|---|
| hilton.com | yes | solves both |
| aa.com | yes — the URL is "Access Denied" without it | solves both |
| aircanada.com | no | answers SBSD, sensor: 'page' |
aircanada serves its booking page to an ordinary Chrome carrying _abck=~-1~,
and it keeps serving it: 35 rounds of solving the sensor moved neither the
cookie nor the page. There is nothing wrong there — that property is not
scoring on that channel at that URL, and ~-1~ is its steady state, not a
stuck solve. Check what a plain browser gets before deciding a target needs the
sensor lane; on a page like that, the default sensor: 'solver' replaces a
script that was doing no harm and waits for an acceptance that is not coming.
Two things about this target are not the solver's doing and cannot be worked around from the client side.
There is no --headless that works. hilton.com refuses a headless Chrome
however good the payloads are: the same run that reaches ~0~ on round 5
headed sits at ~-1~ past round 30 headless. That is also why this example is
not in the CI smoke suite — the runner has no display, and an example that
can only ever be advisory is worse than an absent one. sensor/comcast.ts is
the Akamai example CI gates on.
It is sensitive to the address you leave from, and the sensitivity is
cumulative. Not to whether you use a proxy — proxy= is optional here as
everywhere in this repo — but to how much that address has already been used.
Measured over one afternoon from a single desktop address: direct runs went
2/4, and after another handful of runs from the same address, 0/2. Through an
ISP proxy across the same window, 4/4. Nothing about the payloads changed.
So if it starts failing where it used to pass, suspect the exit before the solve. A fresh address is the cheapest fix; a residential or ISP proxy is the durable one, and a datacenter pool is not a substitute for either.
The other lanes in this repo all have a browserless variant. SBSD's used to be impossible for two reasons, and only one of them still holds.
What changed. document.runtime was a set of readings only a live document
could take — performance.memory, navigator.connection, speechSynthesis.
Every one of them is now optional and defaulted server-side, so the request no
longer needs a realm to measure. A browserless flow was measured working end to
end against aircanada.com: fetch the document, fetch the bundle, ask for a
ledger, POST the three rows to the bundle's own path. The ledger came back
complete, the carriers answered 200 / 200 / 202, and the SBSD cookies
(bm_s, bm_so) landed in the jar.
What still holds: the transport. Getting the document at all is the
problem, and it is not an SBSD problem. The same script against aa.com never
reaches a challenge — the edge answers a bare Node fetch with 403 before
any bundle is served, because the TLS and HTTP/2 fingerprint is Node's. So a
browserless SBSD flow works exactly where your HTTP client is one the property
already accepts, which is why there is no example here yet: aircanada serves an
ordinary client anyway, so passing on it proves nothing about the channel.
No Lightpanda flow either, for a smaller reason than before. Nothing in the
request needs it any more, but attach() drives the channel through Playwright
route interception, and the rows still have to reach the page's own carrier
POSTs. If Lightpanda grows the interception surface the same attach() should
work; sensor/comcast-lightpanda.ts already shows the _abck lane there.
solve() in the sensor lane sends the declared profile — the values written
down in src/profile.ts. The obvious thing to do for SBSD,
since the ledger request reads the live page anyway, is to read the identity
off it too. Do not.
Device-metrics emulation (Emulation.setDeviceMetricsOverride, which an
earlier identity.ts used) leaves the window emulated rather than real:
emulated availLeft: 0 availTop: 0 outerWidth: 1202
real availLeft: 51 availTop: 33 outerWidth: 1200
profile availLeft: 0 availTop: 34 outerWidth: 1200
On macOS availTop: 0 is impossible — the menu bar is always there — so a
payload built from the emulated readings describes a browser that cannot exist.
Nothing errors. _abck simply never leaves ~-1~, which is the same symptom as
a dozen unrelated causes.
So the ledger request carries only profile.id, the declared identity, and
reads from the live page only what nothing else can answer: its jar, its DOM
and the tab id the bundle stores. Every other reading the server defaults from
the profile. The two lanes then declare the same identity as each other, which
is the property that actually matters.
- One ledger per document, not per page. The bootstrap reloads itself, and
the document that replaces it is a new snapshot: its own HTML, cookies and
tab id.
solver.tsretires the ledger on every main-frame document and lets the next carrier ask for a fresh one. Carrying rows across the reload describes a visitor who was on neither document. - Two ledgers for one document — carriers fire concurrently, so a naive
if (!rows) rows = await generate()lets two of them both start a request. The second ledger replaces the first and the cursor walks into it, so the page submits row 0 of one snapshot and rows 1–2 of another. Memoize the promise, not the value;solver.tsdoes. bundle.scriptSrcmust include the query string. The?v=is not decoration — it seeds the bundle's codec. Send the rawsrcattribute.document.epochMsisperformance.timeOrigin, notDate.now(). It identifies the document, and one older than five minutes is refused.document.cookieHeaderisdocument.cookie, despite the name — the JavaScript-visible jar, not the HTTP header. ThehttpOnlycookies are deliberately not part of what the page can see.- 422
invalid-carrieron a fast machine — the snapshot beatak_bm_tab_id, which appears only once the bundle has run.solver.tswaits for it, bounded. This used to have a second cause — emptyspeechSynthesis.getVoices(), which made the examples desktop-only — and that one is gone: the counts are no longer part of the request, and the server defaults them from the profile. aa.com solves headless withgetVoicesstubbed to[]. - 422 with any refusal code — read the
receiptin the body, noterror.message: the message is the same sentence for every code, while the receipt names the input that could not be reconciled.solver.tsputs it in the thrown error for that reason.
{ "complete": true, "expectedCap": 3, "ordering": "sensor-emission-fifo", "runNonce": "b6278f3f-8160-4df7-ab42-b2aeb3bce4c6", "submissions": [ { "index": 0, "body": "...", "bytes": 965, "method": "POST", "resolvedUrl": "https://www.hilton.com/.well-known/sbsd" } ] }