Skip to content

v0.8.0

Choose a tag to compare

@github-actions github-actions released this 10 Nov 17:17
· 240 commits to main since this release

brainproxy 0.8.0

What's new: structured match-and-replace rules with a tester, sandboxed JavaScript hooks, server-sent event streams through the proxy and send, and replayed logins that need a one-time code, a browser or a passkey.

New

  • Match-and-replace rules (#116): structured locations next to the five raw ones: method, path, a query parameter, a request or response header by name, the status code, and WebSocket messages. Matchers are regex, literal and whole. A rule can be limited to engines (--applies-to proxy, send/Replay, fuzz, scan) and to hosts. rules test tries rules on a request or response and sends nothing; in the app it is in Settings › Match & replace. History keeps the request before the rules and the response after them. rules import reads what rules list prints.

  • Scripts (#119): a sandboxed JavaScript hook, run in the same sandbox as the request-signing script. It can supply a rule's replacement (rules add --script), act as a fuzz payload processor, or run a passive check of your own.

  • Server-sent events (#117): text/event-stream responses are relayed through the proxy as they arrive instead of waiting for the end. Their events are recorded in the project (sse commands, the app's Event streams view). send reads a stream for a bounded time.

  • Login replay (#118):

    • auth profiles can hold a TOTP secret (RFC 6238; --totp-secret-env reads it at each login and stores nothing), with {{totp}} in login steps;
    • auth record start also records what is done in the page (Chromium-based browsers, Linux and macOS). When plain requests can't repeat a login (single sign-on, a login built in JavaScript, a passkey), or with --in-browser, the steps are replayed in a headless browser;
    • --passkey records with a virtual authenticator; the passkey is kept with the profile and used at every replay.

    The login is made again when the session is lost.

Fixes

  • A response-body rule leaves 204, 304 and HEAD responses without a body. A rule that matches an empty body no longer adds a body to them.
  • The head of a relayed event stream gets response-header rules only, and keeps its framing headers.
  • A login form with a company, invite or similar code is no longer taken for a one-time code.
  • The app builds on case-insensitive file systems again.
  • Tests: fixed a BrokenPipe failure, a leaked process and a likely hang on macOS (#113).

Project format

Schema 19 → 20 (event stream tables). Projects are upgraded when opened; older versions can't open an upgraded project.

Dependencies

@vitejs/plugin-react 6.2.1 (#115), taiki-e/install-action 2.89.1 (#114).