Repository navigation
buttonmash 0.4.0: Playwright 1.64/1.65, method rules for the fence, fence findings - #4
Merged
Merged
Conversation
The range was ^1.49.1, which nothing tested below the locked 1.63.0. The suite and the Firefox and WebKit smokes pass on 1.64.1, and on a 1.65 build with the 1.65.0 browser revisions, so the floor moves to what was tested. 1.64.0 stays out of range: its Chromium aborts a preflighted cross-origin redirect whenever any route is registered (microsoft/playwright#43242, fixed in 1.64.1), and the fence always registers one.
Each frame's controls were judged inside the frame's own document, so a button in an iframe the page hid (visibility: hidden), made inert, or covered with an open modal looked reachable. A Playwright click on it waits until it times out (Chromium, Firefox and WebKit on 1.64.1 and 1.65; Chromium on 1.63), so each pick became a low driver-error finding. The document that holds an <iframe> now reports whether a user can reach it, with the same visibility, inert and top-modal checks it applies to its own controls. A frame inside an unreachable one is skipped too. A frame whose parent is on another origin is still offered, since that parent is never read. This closes the gap the 0.3.1 notes left open: a modal in the main document now hides the same-origin iframes outside it. Output order and frame prefixes are unchanged for pages whose frames are all reachable.
Requested in #3. blockedPathPatterns matches the path only, so a write that shares its path with a read (DELETE /things/:id next to GET /things/:id) could not be fenced without breaking the read. guardrails.blockedRequests takes rules with an optional method and an optional path regex; when a rule has both, both must match. Methods are upper-cased when the config loads, and a rule with neither part is a config error. The fence checks rules before the path guards, with the same exemption for scripts, styles, images, fonts and media. A rule that refuses GET also keeps the crawl, client-side navigations and link clicks off its path, and closes WebSockets to it; a rule for another method leaves those alone. Every request the fence refuses for a path, a rule or another origin is now recorded as an info finding in a new `fence` category, keyed without the page URL so one route is one finding with a count. Page loads from another origin group by origin. blockMedia noise is not reported, and a payment provider's pages stay with the billing guard, so a live checkout is still one finding.
When a browser build was missing, run printed `npx playwright install`. In a project that pins a different Playwright, npm gives buttonmash a copy of its own, and that command downloads browsers for the project's copy, so the next run failed the same way. run and doctor now print `npx playwright@<version> install --with-deps <engine>` for the Playwright buttonmash loads, and run takes the engine from the config file as well as the flag. doctor's browser check names that version when it passes. A launch that fails for another reason is reported as such instead of as a missing browser. doctor also applies guardrails.blockedRequests to its preflight fence, and the starter config from `buttonmash init` shows a commented rule.
Documents the Playwright floor and the install command doctor prints, guardrails.blockedRequests and the fence category, and that discovery skips iframes a user can't reach. Pins the action example at v0.4.0.
fetch() upper-cases only the standard methods (DELETE, GET, HEAD,
OPTIONS, POST, PUT). Any other method goes out as the page wrote it, so
`fetch(url, { method: 'patch' })` sends "patch", which a
`{ method: 'PATCH' }` rule did not match, while many servers still
route it as PATCH. The fence now upper-cases the request's method
before comparing it with the rules. Found by an automated security
review of the pushed branch.
A request cancelled before it finished is not a failed request. The requestfailed handler already ignored Chromium's net::ERR_ABORTED, but Firefox reports the same event as NS_BINDING_ABORTED and WebKit as "cancelled", so those engines turned it into a medium network finding. A hands-on Firefox run found one after a double-clicked link restarted its navigation. The new case in fence-noise aborts an in-flight fetch with an AbortController; before this change it failed on Firefox and WebKit and passed on Chromium.
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.
buttonmash 0.4.0: Playwright 1.64/1.65 support, a fence that can block by HTTP method (#3), findings for what the fence blocked, and discovery that skips iframes a user can't reach.
Playwright
^1.49.1to^1.64.1, the oldest version tested. 1.64.0 is left out: its Chromium aborts a preflighted cross-origin redirect whenever a route is registered ([Regression]: Chromium 155+ aborts a preflighted cross-origin redirect whenever any route is registered (net::ERR_ABORTED) microsoft/playwright#43242), and the fence always registers one.1.65.0-beta-1793900512000, whose browser builds match the v1.65.0 tag (chromium 1254, firefox 1572, webkit 2388). The lockfile stays on 1.64.1:playwright@1.65.0shipped without itsplaywright-core@1.65.0dependency, and for about an hour a fresh install of any caret range,buttonmash@0.3.1included, failed with ETARGET. Playwright has since deprecated 1.65.0 ("Broken release ... Use 1.64.1 for now") and movedlatestback to 1.64.1, which fresh installs resolve again. The next 1.65 release falls inside^1.64.1.httpCredentials, control names are computed in-page (notgetByRole), and the viewport is set directly. Actions now wait for an element to stop being inert, and discovery already skipped inert controls.npx playwright@<version> install --with-deps <engine>for the Playwright buttonmash loads, from bothrunanddoctor. A project that pins its own Playwright gives buttonmash a separate copy, and the old barenpx playwright installinstalled browsers for the wrong one.Fence (#3)
guardrails.blockedRequests: rules with an optional method and an optional path regex, both required to match when both are given.{ method: 'DELETE' }fences every delete while GET on the same path still loads. A rule that refuses GET also keeps the crawl and link clicks off its path and closes WebSockets to it. Methods compare in upper case, sincefetch()sends a non-standard-casedpatchas written (found by an automated security review of the first push, fixed in cc28e61).infofinding in a newfencecategory, keyed by route rather than page, with a count.blockMedianoise isn't reported, and a payment provider's pages stay with the billing guard, so a live checkout is still one finding.Discovery
Controls inside an iframe that is hidden, inert, or outside an open modal are no longer offered. A click on one times out in Chromium, Firefox and WebKit on every version tested, so each pick became a low
driver-errorfinding. This closes the gap noted in 0.3.1.Firefox and WebKit noise
A request cancelled before it finished (a link navigation a double-click restarted, a fetch the page aborted) was a medium
networkfinding in Firefox (NS_BINDING_ABORTED) and WebKit (cancelled). Chromium'snet::ERR_ABORTEDwas already ignored; now all three are. Found in a hands-on Firefox run.Verification
fence-noise,fence-browser,discover-visibility) also pass on the 1.65 beta in all three engines.fence-browser), config validation (config), the install command with an empty browsers directory (cli), and four iframe cases on all three engines (discover-visibility; all four fail with the frame check disabled).[{ method: 'DELETE' }, { method: 'POST', path: '^/api/admin/' }], the server received no DELETE and no admin POST, whileGET /api/workspaceandPOST /api/notesgot through. 0.3.1 let 9 DELETEs and 5 admin POSTs through. Same result in Firefox and WebKit, andreplayreproduced the run.fencefindings (DELETE x10 across two pages, admin POST x6, POST /logout x4, another origin x4), run still PASSED at exit 0, cards readable inreport.html.doctorwith an empty browsers directory printednpx playwright@1.64.1 install --with-deps webkit; running that command installed webkit-2370 anddoctorthen passed.buttonmash-0.4.0.tgz, installed into an empty project with no pin, resolved Playwright 1.64.1;doctorand a 30-action run from that install passed.Closes #3.
Upgrade notes
findingscounts can rise from the new info-levelfencefindings; nothing new fails a run atfailOn: high.