Post the login form from the sandbox and replay every collection body - #6
Closed
OmerFarukOruc wants to merge 1 commit into
Closed
OmerFarukOruc wants to merge 1 commit into
OmerFarukOruc wants to merge 1 commit into
Conversation
On a login page the sensor posts twice: the sensor_data payload, then a follow-up json body. Only the first was replayed, and clicking submit in the sandbox did nothing, so a run never produced the form navigation the edge expects. - HTMLFormElement submits for real. submit() posts the entry list, requestSubmit() fires a cancellable submit event first, and a click on a submit control goes through it, so a page that calls preventDefault and posts by XHR is not double-posted. - solve replays every collection post the script made, keeping each body's own framing, then tops up with fresh payloads to the requested rounds. - A form navigation carries the header block and wire order of the browser family the fingerprint was picked from. Both are chosen in one place so they cannot drift from each other or from the fingerprint. - request gains redirects, omit_referer and omit_origin, and reports the attributes of every set-cookie line the edge sent. - The sandbox html cap no longer cuts before the last script the page loads, which was hiding the sensor on large pages.
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.
On a login page the Akamai sensor posts twice: the
sensor_datapayload, then afollow-up json body. Only the first was replayed, and clicking submit in the
sandbox did nothing, so a run never produced the form navigation the edge
expects.
What this changes
Forms submit.
HTMLFormElement.submit()posts the entry list.requestSubmit()fires a cancellablesubmitevent first, and a click on asubmit control goes through it, so a page that calls
preventDefault()andposts by XHR is not double-posted. The submitting button joins the entry list
the way a browser builds it.
solvereplays what the script actually sent. Every collection post thesensor made is replayed with its own framing (
text/plainforsensor_data,application/jsonfor a collection body), then fresh payloads top the run up tothe requested round count.
sensor::classifyis the single place that decideswhat a captured body is.
Header fidelity for form navigations. A form post carries the header block
and wire order of the browser family the fingerprint was picked from.
session::plan(user_agent, form)is the only place that choice is made, and itreads the family from
wre_net::is_firefox, which is built on the samefamily_ofthat selects the TLS and H2 profile. The header policy cannot driftfrom the fingerprint.
requestop. Gainsredirects(0 returns the first hop),omit_refererand
omit_origin, and reportsset_cookies: the name, domain, path,same_site,secureandhttp_onlyof everySet-Cookieline the edge sent,including ones the jar rejected. Parsing lives in
wre_net::jarnext to thecookie model.
The sandbox html cap no longer hides the sensor.
Page::loadnevertruncates before the end of the last script the page loads, so an obfuscated
sensor sitting past the cap on a large page still reaches the document.
Tests
cargo test --workspaceis green. New coverage:submit event sends nothing (both arms)
Pageandbrowser layers
{"body":...}collection post round-trips as json throughsolveSet-Cookieattribute parsing, including a line that carries no cookieWorth a reviewer's eye
FIREFOX_FORMandFIREFOX_FORM_ORDER, includingte: trailersand itsposition before
priority, are not backed by a capture in this repo. They areworth checking against a real Firefox navigation before anyone relies on them.
XMLHttpRequestnow exposesstatusatHEADERS_RECEIVEDbut withholds thebody until
LOADING, since a browser has no body at readyState 2.