Skip to content

cfrs v0.3.0-beta.12

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 04 Nov 15:39
· 1205 commits to main since this release

The twelfth prerelease of cfrs, for tests.

Binaries

File System
cfrs-x86_64-unknown-linux-musl, pod-netns-x86_64-unknown-linux-musl Linux x86-64
cfrs-aarch64-unknown-linux-musl, pod-netns-aarch64-unknown-linux-musl Linux ARM64
cfrs-armv7-unknown-linux-musleabihf, pod-netns-armv7-unknown-linux-musleabihf Linux ARMv7 (32-bit, hard float)
cfrs-arm-unknown-linux-musleabihf, pod-netns-arm-unknown-linux-musleabihf Linux ARMv6 (32-bit, hard float)
cfrs-i686-unknown-linux-musl, pod-netns-i686-unknown-linux-musl Linux x86 (32-bit)
cfrs-riscv64gc-unknown-linux-musl, pod-netns-riscv64gc-unknown-linux-musl Linux RISC-V 64
cfrs-loongarch64-unknown-linux-musl, pod-netns-loongarch64-unknown-linux-musl Linux LoongArch64
cfrs-powerpc64le-unknown-linux-musl, pod-netns-powerpc64le-unknown-linux-musl Linux POWER, little-endian

Each binary is static (musl). It needs no C library on the host. cfrs.1
is the manual page.

The image is ghcr.io/azathothas/cfrs:v0.3.0-beta.12 (also :beta).

Check a download

sha256sum -c SHA256SUMS --ignore-missing
gh attestation verify cfrs-x86_64-unknown-linux-musl --repo Azathothas/cfrs
cosign verify-blob --bundle SHA256SUMS.sigstore.json \
  --certificate-identity https://github.com/Azathothas/cfrs/.github/workflows/release.yml@refs/tags/v0.3.0-beta.12 \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com SHA256SUMS
sh scripts/rebuild.sh v0.3.0-beta.12   # rebuild and compare (x86_64, aarch64)

cfrs update from 0.3.0-beta.8 does the first three checks itself.

Breaking

A command or a script written for beta.11 must change for each item
below.

Output and exit codes:

  • cfrs doctor says fail where it said refused, in the text and in
    --json. Each JSON object has the key status; the old key verdict
    keeps the same value for one release. cfrs net doctor says ok,
    fail and unknown in place of OK, FAIL and ?.
  • --detach writes one JSON document on stdout. The human lines are on
    stderr.
  • cfrs status: proxy.kind is the kind of the dial (http, socks5,
    socks5h, with +unix or +exec, or direct). It was http for
    each proxy.
  • cfrs wait --timeout exits 124 at its time limit.
  • cfrs warp env with no proxy variables exits 69 (was 0) and prints
    nothing on stdout.
  • relay connect and relay stop with no pair exit 69 (was 64), and
    with a bad pair file 78 (was 64).
  • share --file with a missing file exits 78 (was 1). share --port 0
    and a directory as --identity exit 64 (were 1 and 69).
  • warp scan --timeout-ms outside 100 to 60000 exits 64 (was clamped).
    A bad CFRS_RESOLVE exits 78 for each command (was a warning).
  • A missing program on warp run --backend netns-raw exits 3 (was 127).

Behaviour:

  • A bare cfrs share exits 64. Give --mode upload or --dir.
  • share uploads have mode 0600.
  • The PIN cookie has Secure: a visit over plain http cannot unlock.
  • path: of an ingress rule is a regular expression with no anchor, as
    in cloudflared. path: /api also matches /x/api and /apix, and
    . matches each character. Write ^/api/ for a prefix and \. for a
    dot. An invalid expression is a config error (exit 78).
  • tunnel --check fails a config with no ingress rule.
  • With --leg-failover serial, the next leg starts after at most 130 s
    (quic) or 280 s (http2), not after 8 s.
  • Each unix socket that cfrs binds has one rule: a live socket is an
    error (69), a file that is not a socket is an error (64), a stale
    socket is removed (net switch, net proxy, relay connect,
    warp proxy).
  • Root with the HOME of another user writes no file there.
    CFRS_FOREIGN_HOME=allow writes anyway.
  • net ts-shims --out refuses a directory of another user, or one that
    other users can write.
  • cfrs net: a process of another user (also root) cannot use the
    switch unix socket, the control socket of the shim, an imported name or
    a shim listener.
  • cfrs net switch --listen tcp://... needs a token: set
    CFRS_SWITCH_TOKEN, or give --switch-token-file, to the switch and
    to each net proxy --switch tcp://.... With no token, the switch exits
    64.
  • cfrs pod: the default inbound directory is
    $XDG_RUNTIME_DIR/pod-netns-inbound, else
    $TMPDIR/pod-netns-inbound-<uid>; it was /tmp/pod-netns-inbound. An
    --inbound-dir of another user, or one that the group or others can
    write, is refused.

Library (cfrs crate):

  • StaticServer::respond gives a StaticResponse with a reader body
    (StaticBody), not a BufferedResponse. A large file gets 200, not
    413. StaticDir refuses dotfiles. A ResponseWriter can get more than
    one body() call for one response.
  • IngressRule::path is Option<PathPattern>, not Option<String>.
  • vnet::switch::serve and attach take a token argument.
  • cfrs::feature::MetricsEndpoint, metrics_response, METRICS_PATH
    and cfrs::util::metrics are removed. The library relay puts its
    default origin socket in a private directory of the user.

Fixed

This release has the fixes of the issues #212 to #258 and #279 to #309
(the QA findings), and the podssh study. Each commit names its issue.
The main groups:

  • Proxy and fetch parsers: request heads to the origin are checked;
    hop-by-hop headers stay on their hop; limits for header lines, interim
    answers, chunk sizes and trailers; a URL fragment is not part of the
    host; a built-in body of no known size is streamed.
  • Edge HTTP/2: limits for the handshake, a failed attempt and the
    configuration push. WebSocket: 502 before the dial, IPv6 relay hosts.
  • Egress: an unresolvable proxy host is an error, not a crash;
    socks5:// uses the resolver chain; Digest among other challenges.
  • Share and the PIN gate: no modulo bias in the PIN, a slot before each
    compare, no host detail in errors, a depth limit for YAML, each
    multipart field counts toward --max-request.
  • Update and install: the tag is checked before it goes into a URL; the
    new file is checked after its trial run; --force with no --version
    installs again; install.sh hides the token.
  • Instances: a name is checked before each path; a held lock is never
    removed; the record of --name has no secret; status, bug-report
    and wait write nothing; autostart --from keeps the secrets.
  • cfrs pod (seccomp backend): the doctor sets no_new_privs in its
    probe; getsockname and getpeername keep to the buffer of the
    caller; SO_ERROR gives the error of a failed connect; datagram
    lengths are checked before a read; recvfrom and recvmsg on an
    unconnected UDP socket give the real source address; a SOCKS5 user,
    password or name over 255 bytes is refused.
  • cfrs net: a port 0 listener prints the port that it bound; the
    switch drops a frame with a spoofed source address.
  • The tests skip, not fail, on a host that refuses bind(AF_INET) or has
    no loopback; a CI job runs them with bind(AF_INET) refused.

Changes for a tester

  • Update:

    cfrs update
  • cfrs serve --local ADDR serves the files on a local listener (TCP
    HOST:PORT, or unix:PATH) and makes no tunnel:

    cfrs serve --dir ./site --local 127.0.0.1:8080
  • A config of cloudflared with token:, url: or hello-world: works.
    A path: of cloudflared works as a regular expression.

  • cfrs doctor has a last line with the step to take. cfrs --help
    lists the commands by purpose; each command has examples in its
    --help and in its man page.

  • Each JSON document has schema and version.

What to report

  • cfrs pod --backend seccomp with a UDP program (DNS, QUIC, STUN): is
    the source address of each answer right?
  • A config file copied from cloudflared that does not do the same in
    cfrs.
  • live.yml prints the median time of 20 small requests over the URL and
    over cfrs connect (#206).

Limits

  • cfrs pod --backend seccomp: recvmmsg gets the AF_UNIX address of
    the socketpair as the source.
  • cfrs net: a datagram socket of the shim has no same-user check.
  • path: does not decode %XX before the match (cloudflared does).
  • The token of a TCP switch goes over the connection as plain text: use
    a tunnel on a network that others can see.

The licenses of the crates in the binaries, with their texts: THIRD-PARTY-LICENSES.md.

The commits of this release

WARP and the virtual network

  • warp stack: no Nagle on the TCP sockets (a128955)
  • warp API: a second host, and CFRS_WARP_API (de6fdc6)
  • warp: replace a MASQUE session through the relay before the relay limit (f820078)
  • warp: four gaps of #278, and the rules for --l4 (#140) (db6dbe6)
  • warp proxy: the UDP relay is on the address of the control connection (#278) (cabf6ac)
  • warp ssh-config: --host is one pattern with no space or control character (#252) (1e4b7e9)
  • warp env: no proxy variables exits 69 (#255) (cd24b78)
  • pod-netns doctor: the seccomp probe sets no_new_privs (#299) (4915178)
  • pod-netns: refuse a SOCKS5 user, password or name over 255 bytes (#304) (d871001)
  • vnet: a listener prints the bound address, not the requested one (#300) (8410146)
  • pod-netns: the default inbound directory is private to the user (#306) (ddda6a9)
  • vnet: the shim and switch sockets take the same user only (#308) (afbe2d4)
  • vnet: the switch drops a spoofed source address, a TCP switch needs a token (#309) (da8e595)
  • pod-netns tests: the AAAA test of a pinned name has no search domain (739167e)

Relay

  • relay connect: a close with an error code or a lost link exits 69; 15 s after the end of stdin; the close code in the log (podssh #84, #17) (8214194)
  • relay leg: replace the edge connection before the relay limits (b33a2cf)
  • relay node: one gate for the frames of each session (ed463f3)
  • relay: a pool of hosts, failover, and a token cache (4d6b3d9)
  • relay node: expiry warnings and the next pair (b65829e)

Tunnel and commands

  • tunnel: the first registration of a leg tries again when the edge asks for a retry (9040b5b)
  • agent rules: local worktree branches for parallel agents; no session link in commits (14bb9bc)
  • edge HTTP/2: a budget of small DATA frames that holds the whole window (podssh T-408) (727a9f0)
  • report: the program of CFRS_ERROR_PROGRAM gets no secret of cfrs (podssh) (7b22897)
  • state: no file in a directory of another user (podssh #118) (690c566)
  • serve, share: no FIFO, socket or device is served (podssh #105) (5400bd0)
  • net, relay: one rule for a unix socket path (podssh, issue 202) (35697cc)
  • instances: status, ps, stop, logs and wait make no directory; wait --timeout exits 124 (podssh) (e2dc2e1)
  • edge: each HA connection starts at another region (f8ed17d)
  • cli: commands by purpose, a Start here block, and hints for an unknown word (a4262de)
  • doctor: a last line with the step to take (8bd9d64)
  • cli: one line for a server in the foreground with no terminal (adbedc7)
  • cli: --token-file, TUNNEL_TOKEN_FILE, relay connect --token-file, warp license - (aab3de0)
  • tunnel: the arguments of cloudflared (ba0facc)
  • status: the kind and the source of the proxy that cfrs dials (e9d3317)
  • doctor, net doctor: one vocabulary: ok, fail, unknown (e3fcab0)
  • shim: refuse a shim directory, a library and a file of another user (#247) (920ecab)
  • update: --force with no --version installs the same version again (#275) (ea75147)
  • update: a release tag must be a tag before it goes into a URL (#227) (7992c61)
  • update: check the new file after its trial run, and set mode 0755 (#236, #270) (8d51dfa)
  • instances: a name is checked before each path (#260) (1be15ad)
  • detach: the record of a foreground --name has no secret (#262) (90917ff)
  • instances: never remove a lock that another process holds (#264) (58763d0)
  • autostart: --from keeps the secrets; an entry has no --detach (#265) (841ea1b)
  • instances: status, bug-report and wait write nothing in the run directory (#266) (e283b29)
  • detach: stdout of --detach is one JSON document (#263) (f0423a8)
  • report: mask hides Authorization values and hex tokens (#267) (39e3160)
  • instances: the test of a held lock holds it in the test process (#264) (3dbed13)
  • exit: five paths get the code of their class (#249) (2bf5f0b)
  • cli: invalid values are errors, not silent (#252) (8cfa13a)
  • cli: one shape for errors and a lint of each help screen (#253, #254) (45dfa9c)
  • update: the hint of --version names a tag that has a release note (f268104)
  • config: token: of a file gives the named tunnel (#269) (c619777)
  • share: uploads have mode 0600 (#233) (978f91d)
  • share: count each multipart field toward --max-request (#232) (8e67d16)
  • share: a bare cfrs share is a usage error (#250) (1c91698)
  • share: no host detail in errors; a random name for a full stem (#234) (988a441)
  • share: escape next; weak ETags; idle clock at serve; no-store (#271) (dfa45bf)
  • config: url:, hello-world:, a check of an empty ingress, a regex path (#269) (0d89344)
  • config: a test that each serde field is in its key list (#241) (282ac30)
  • egress: a proxy host that does not resolve is an error, not a crash (#259) (d719f44)
  • proxy: check the request head and keep hop-by-hop headers on their hop (#226, #235) (04dbda4)
  • edge_h2: limits for the handshake, a failed attempt and the configuration push (#272) (7d280e1)
  • proxy: the trailer of a chunked origin answer has a cap (#244) (091d362)
  • proxy, fetch: 256 header lines, and a check of the framing of an origin answer (#238) (5f985a4)
  • proxy: a built-in body of no known size is streamed, not buffered (#243) (6909d9c)
  • egress: socks5:// uses the resolver chain, Digest among other challenges, show a proxy URL with no password (#274) (c3cdd96)
  • share: no fetch_update (#214) (93013ed)
  • serve: --local ADDR serves the files with no tunnel (#307) (f7f0a0b)
  • tunnel: the serial limit of a leg attempt is the budget of the leg (#293) (204362b)
  • ingress: path: is a regular expression, as in cloudflared (#289) (1979959)

Documents

  • maintenance: v0.3.0-beta.11 is published; the batch of issues 164 to 210 is closed (2d01095)
  • docs: the region of each HA connection (90aee18)
  • docs: fix false statements, and test the paths and the gaps (1a8949e)
  • docs/decisions.md: the rulings with dates, and the questions for the owner (0c65f4c)
  • SECURITY.md: what the relay can see, and the relay secrets (4eb90c7)
  • docs/development.md: the rules for tests and for random failures (3083b85)
  • README: Install, Quick start and Update first; Build, Fuzz and Rebuild last (9770fb7)
  • maintenance: batch 4 is on main; the breaking changes, the waiting issues (449ec1e)
  • docs/reports: the issues of aerrand-agent that GitHub deleted (25146a5)
  • docs/reports: four comments of aerrand-agent on other issues (6df21cd)
  • docs: the documented values of the code, and tags with a release note (4ea495a)
  • docs/HANDOFF.md: the state of batch 5, the QA archive and the next steps (ec62882)
  • maintenance: the breaking changes and the open items of batch 5 (264ac96)
  • maintenance: Open work names HANDOFF.md, batch 5 and the QA filing (c286a00)
  • maintenance, HANDOFF: all batches are on main; the next steps are the release and the closes (a9ac71a)

Build, tests and CI

  • secrets: allow the test proxy URL of the error program test (0c50778)
  • tests/docs.rs: rustfmt (5f6c830)
  • cliff.toml: group the changelog by the area of the subject (4aed4f7)
  • live.yml: net doctor says ok, not OK (360f488)
  • secrets: allow the example proxy URLs of the archived reports (bf06067)
  • live.yml: register, read and delete a WARP device through the second API host (1051003)
  • install.sh: hide the token, check the version, mktemp copy, no draft (#270) (ac5a78f)
  • ci, tests, scripts: five small issues of group 1 (5f219bb)
  • ci: the package lists go outside the checkout (13915e2)
  • ci: green again on Rust 1.99, rustdoc, the secret scan, fuzz and live (99b29ed)
  • live: read the route line of warp tun --detach from stderr (#263) (f81da37)
  • live-throughput: a failed latency request prints the count and the tunnel log (33be2ab)
  • tests: skip, not fail, on a host with no AF_INET bind or no loopback (#217) (1c23eaf)
  • tests: five new tests skip on a host with no AF_INET bind (#217) (784d425)
  • live: the autostart step waits for the name of its quick tunnel (issue 119) (b384136)
  • release: v0.3.0-beta.12 (3b6e173)

Other

  • json: schema and the version in each JSON document; dir in ps --json (98b7446)
  • help: the examples of each command in its --help and its man page (0cb6cc0)
  • watch-issues: keep a copy of each issue (3ff88fc)
  • decisions: release unattended again; crates.io not now; a WARP API live check; MASQUE replacement before the relay cut (2ae2a47)
  • preflight, net, feature, relay: four issues of group 6 (581e187)
  • packaging: the defects that a later publish would show (6080d99)
  • decisions: serve --local, recv interception, same user and a token for the vnet sockets, the filing of the QA findings (8e74531)
  • netns-raw: a program that cannot run gives a message and exit 3 (#251) (657dbb1)
  • static: refuse dotfiles; resolve the index; open, then check (#276) (94ca1de)
  • static: stream a file, no whole-file read (#276) (7fe48eb)
  • yaml: a depth limit of 64 levels (#231) (3d3c4c7)
  • gate: take a slot before the PIN compare; reset on success (#228) (1444d39)
  • gate: a PIN from getrandom with no modulo bias (#240) (07e5c67)
  • gate: a Secure cookie; refuse an unlock from another site (#229) (f3c2c56)
  • fetch: a chunk size that overflows is an error (#225) (fa9983e)
  • ws, ws_relay, transport: 502 before the dial, IPv6 relay hosts, IPv6 sockets (#273) (a513d02)
  • fetch: a limit for interim answers (#237) (a59a4dc)
  • fetch: a fragment is not part of the host, and the URL has no control character (#242) (15f3614)
  • trust: a root that rustls refuses is counted and named (#239) (a82d195)
  • fuzzing: a target for the request head to the origin (#272) (3d6370d)
  • HANDOFF: the share and the parser batches are on main (764cdd9)
  • feature: StaticServer streams a file of any size (#296) (114eb2d)
  • seccomp: getsockname and getpeername keep to the length of the caller (#301) (c45754c)
  • seccomp: SO_ERROR gives the error of a failed connect (#302) (f4349b2)
  • seccomp: check the datagram lengths of the program before a read (#303) (24d43ea)
  • seccomp: recvfrom and recvmsg give the source of a datagram (#305) (c9939da)
  • seccomp: a recvfrom with no source buffer stays in the kernel (#305) (861419d)
  • gate: the PIN test checks that a wrong code is refused (#218) (3b0d57b)