Skip to content

buttonmash 0.4.0: Playwright 1.64/1.65, method rules for the fence, fence findings - #4

Merged
cj-vana merged 8 commits into
mainfrom
deps/playwright-1.65
Nov 5, 2026
Merged

cj-vana merged 8 commits into
mainfrom
deps/playwright-1.65

Conversation

@cj-vana

@cj-vana cj-vana commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

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

  • The range moves from ^1.49.1 to ^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.
  • The suite and the Firefox and WebKit smokes pass on 1.64.1 (the lockfile) and on 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.0 shipped without its playwright-core@1.65.0 dependency, and for about an hour a fresh install of any caret range, buttonmash@0.3.1 included, failed with ETARGET. Playwright has since deprecated 1.65.0 ("Broken release ... Use 1.64.1 for now") and moved latest back to 1.64.1, which fresh installs resolve again. The next 1.65 release falls inside ^1.64.1.
  • None of 1.65's breaking changes reach buttonmash's own code. Cookies go through storageState, basic auth through httpCredentials, control names are computed in-page (not getByRole), and the viewport is set directly. Actions now wait for an element to stop being inert, and discovery already skipped inert controls.
  • A missing browser now gets npx playwright@<version> install --with-deps <engine> for the Playwright buttonmash loads, from both run and doctor. A project that pins its own Playwright gives buttonmash a separate copy, and the old bare npx playwright install installed 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, since fetch() sends a non-standard-cased patch as written (found by an automated security review of the first push, fixed in cc28e61).
  • Every request the fence refuses (path guard, rule, another origin) is an info finding in a new fence category, keyed by route rather than page, with a count. blockMedia noise 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-error finding. 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 network finding in Firefox (NS_BINDING_ABORTED) and WebKit (cancelled). Chromium's net::ERR_ABORTED was already ignored; now all three are. Found in a hands-on Firefox run.

Verification

  • Gate (format, lint, build, coverage tests, Firefox and WebKit smoke, typecheck): passed on 1.64.1 for the head commit (387 passed, 1 skipped; smokes 16/16 each), and on the 1.65 beta for the release commit (385 passed; smokes 15/15). The tests the two later fixes touch (fence-noise, fence-browser, discover-visibility) also pass on the 1.65 beta in all three engines.
  • New tests: method rules, socket blocks, fence findings and their grouping (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).
  • Hands-on against a local fixture with the built CLI, compared with the 0.3.1 build on the same seed:
    • With [{ method: 'DELETE' }, { method: 'POST', path: '^/api/admin/' }], the server received no DELETE and no admin POST, while GET /api/workspace and POST /api/notes got through. 0.3.1 let 9 DELETEs and 5 admin POSTs through. Same result in Firefox and WebKit, and replay reproduced the run.
    • Four fence findings (DELETE x10 across two pages, admin POST x6, POST /logout x4, another origin x4), run still PASSED at exit 0, cards readable in report.html.
    • Hidden and inert frame buttons and a frame behind an open dialog were never picked; 0.3.1 picked them and logged 2 driver-error timeouts.
    • doctor with an empty browsers directory printed npx playwright@1.64.1 install --with-deps webkit; running that command installed webkit-2370 and doctor then passed.
    • The packed buttonmash-0.4.0.tgz, installed into an empty project with no pin, resolved Playwright 1.64.1; doctor and a 30-action run from that install passed.

Closes #3.

Upgrade notes

  • findings counts can rise from the new info-level fence findings; nothing new fails a run at failOn: high.
  • A seed recorded on 0.3.1 can replay differently on pages with hidden, inert or modal-covered iframes.

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.
@cj-vana
cj-vana merged commit ff07dcd into main Nov 5, 2026
7 of 8 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.

Request fence: block by HTTP method, and report blocked requests

1 participant