Every byte from a command line, environment, file, kernel message and network peer is hostile until the component that acts on it has validated it. Parsing success is not authorization: a message must also be bound to its transport peer, transaction, protocol state and resource budget.
This is the whole security record: model, invariants, decisions, evidence and open gaps. It is a gap register, not a claim that the stack is bulletproof. The honest rating is strong deterministic coverage, incomplete high-assurance evidence. A gap is visible work, and a lane that did not run is "NOT RUN", never a pass.
- Local input: shell text, arguments, environment, files, descriptor layout; no privilege.
- Off-path network: forged traffic, cannot see the live exchange. Transaction entropy and exact reply identity stop it.
- On-path or same-link: observes, injects, replays, delays, reorders, truncates, suppresses. TLS authenticates HTTPS, NTS (RFC 8915) the time when an NTS server is reachable, and DNS over TLS the names when it is set; DHCPv4, plain DNS and plain SNTP do not, so their endpoint and nonce checks stop only off-path forgery.
- Hostile service: owns the connected endpoint and streams bytes and timing forever. Bounds and absolute deadlines contain it.
- Physical peripheral: a device plugged into a port while the machine is
on or booting (a stick, a keyboard that types, a hub, a network or audio or
camera function, a DMA-capable bus device). It speaks descriptors and
protocol bytes to the kernel and chooses the classes it claims. The policy
that holds against it is
moonwater device(an unknown device and every interface of a known one stay unauthorized until a rule or the owner lets them in); what it cannot hold against is what the kernel does before a device is authorized (reading its device descriptor, the hub's own work) and DMA, which is the IOMMU's (sec_dma). - Physical disk or image access: somebody who can read or replace what is on the disk or the stick the machine boots from while it is off.
- Supply chain and update: a changed source, firmware blob, trust anchor,
package or update image that the build,
setup updateorsetup update usbtakes in. - Compromised program: a program of a bowl, or one started by the shell, that has been taken over and now acts as its own user, with whatever doors (sockets, FIFOs, files, ioctls) the machine leaves open to it.
Attackers 1 to 4 are covered by the evidence below. 5 to 8 were added with the
air-gap work (2026-10-26) and are being audited in that order; the audit's
findings are logged in incident_response.md as they are fixed, and each
attacker gets its invariants here once there is a lane that proves them.
- Length arithmetic is checked before add, subtract, multiply, align, narrow, allocate or copy. Elapsed time never subtracts a newer clock reading from an older one without ordering them first.
- A parser consumes its whole declared object or fails; no unvalidated trailing framing survives success.
- Every loop over hostile data makes progress under a byte, item, depth or absolute-time bound.
- A datagram reply matches its family, peer, transaction and echoed request fields before it changes state, and, at the tight tier, is exactly the size of the one shape the client parses (the default reads the first 48 bytes of a longer SNTP reply, as ntpd and chrony do; an NTS reply is longer by design, is parsed whole at every tier and believed only when its authenticator opens, and one that fills its 1,280-byte room is cut and is noise).
- Security transactions use the initialized kernel CSPRNG or do not happen.
- Text is validated again at the sink that serializes or executes it.
- Failure publishes no partial output, keeps no stale authenticated state, leaks no descriptor across exec and leaves no secret live longer than needed.
- An ambiguous protocol spelling is refused, not read by whichever parser runs first. A budget (reply interval, greeting slot) is charged only for work that actually left; a refused send spends none.
- A side effect that selects state for a later call (an egress interface, a socket option) is part of that call's success.
- Two tiers. The default behaves as GNU wget and curl do.
MOONWATER_STRICTat the tight tier holds RFC 9110 and RFC 3986: 204/205 framing, an explicithttp://orhttps://for every URL, no redirect from public into private space, a whole-body deadline on streams. For time and names the tight net tier (MOONWATER_STRICT_NET2 and 3, thesec_net_hardenedandsec_net_lockedprofiles) defaults to NTS only and DNS over TLS only: no plain time is taken and no name leaves in the clear unless root's/root/ntp.ntsor/root/dns.tlssays otherwise (a written word wins over the tier). The cost is a machine that has no clock until an NTS server answers (TCP 4460 and UDP 123 to Cloudflare, Netnod or PTB, or the servers named), and whose wget, fetch,hostand zone question resolve nothing until then: the DNS over TLS certificate is judged against the clock, and NTS's own names are asked in plain, so the one bootstraps the other.nts_modesanddns_tls_modesare the two tables that choose, and CHECK_net (built at both tiers),ntsanddns_tlshold them. - The clock has a floor. A clock earlier than
MOONWATER_CLOCK_FLOOR(the date of the source, net.c, which the SNTP client namesSNTP_WALL_LEAST;tls_datesholds it not ahead of the machine's clock and within 120 days of the newest commit) or than/root/clock.good(the latest time the machine knew for certain) is unset, not wrong: certificates are not judged against it (wget says so in its own words, status 5, and namesmoonwater time sync),moonwater timesays so, and no NTP answer earlier than the floor is taken. Aclock.goodthat is not a plain file holding a decimal number of seconds between the floor and the end of the NTP window (2104) is ignored, so a damaged or planted one can only fail to help; deleting it is always safe. It is a lower bound nothing forged can move: an authenticated answer's own time (kept as the wall second it set and the boot second, so a later step of the wall clock changes nothing), or else the floor the boot began with plus the seconds since, never the wall clock; it is written every six hours of uptime and when the machine stops, forward only, never through a link, andwipe yeskeeps it. A program that cannot read/rootjudges by the build's floor. - NTS is asked first; plain SNTP is the marked fallback. The NTS-KE
connection is the TLS 1.3 client with ALPN
ntske/1(1.3 alone on offer) and the RFC 8446 exporter; the AEAD is AES-SIV-CMAC-256 on the tree's own AES. The one connection whose certificate is not judged by the clock is the key establishment, until an authenticated answer has been taken this boot: it is judged as of the floor withnotBeforenot asked (an RTC two years out reads every certificate expired), as chrony'snocerttimecheckdoes but with the floor fornotAfter. An authenticated answer is believed anywhere the window puts it; a step past two seconds on a set clock takes two NTS servers. With no NTS server reachable the pool is asked, marked plain inmoonwater ntp, never written to the floor, and refused when it puts the clock further from this boot's NTS time than 5 s and 1000 ppm;moonwater ntp nts onlyrefuses plain time altogether, a server named in/root/ntp.serverincluded. NTS-D1:AEAD_AES_128_GCM_SIVis not offered (RFC 8915 makes SIV-CMAC mandatory and every public server has it). NTS-D2: plain NTP stays the default fallback at the default tier, 1:1 with a machine without NTS; a network that blocks TCP 4460 costs one try and two minutes without another. - Cloudflare first by default (DNS-D2, the owner's order of 2026-11-16).
With no
moonwater dnslist, resolv.conf names 1.1.1.1 and 1.0.0.1 and then the lease's server, so Cloudflare is told every name the machine looks up where before the network's resolver was;moonwater dns autoputs the network's first again, and a list of one's own replaces both; the default list itself is the person's (moonwater dns default ADDRESS..., back to 1.1.1.1 and 1.0.0.1 withreset). A name of the network's own (one label, or under.local,.home.arpa,.internal,.lan,.localdomain,.homeunlessdns internal suffixeskeeps others,dns_name_internal) is asked of a server that is not a public one first, in the clear even withdns tls on(onlystill refuses it), so Cloudflare is not told those and its "no such name" does not end the walk. A server of the default list counts as public with the built-in ones, so a list of one's own does not make its resolver the one told the network's names.moonwater dns internal offroutes no name so; the switch, the suffixes and the default list are published for every lookup in/run/moonwater/dns.internal(root's to write, anyone's to read), and no file is the defaults. A lease's search domain is not routed so yet: the DHCP client does not read option 15.moonwater dnsnames resolv.conf another program's when it names anything Moonwater's own choice would not write. - DNS over TLS is off by default (DOT-D1).
moonwater dns tls onasks the resolvers known to offer it (1.1.1.1, 1.0.0.1, 9.9.9.9, 149.112.112.112: the ones resolv.conf names, or else all four) over TLS on 853 first and falls back to UDP within two seconds of the first try;onlysends no name in the clear, the network's own resolver included, so a name only that resolver knows does not resolve. The certificate is checked as for https, the resolver's address against an iPAddress name. A captive portal answers or drops 853 and a first lease arrives with the clock unset, both an ordinary first minute, which a default should not charge two seconds a lookup for. Only the HTTP client andhostfollow it; NTS, SNTP, a caIssuers fetch, hostid, logger and waterlink ask in plain (a clock cannot wait for names that need it, and a lookup inside a handshake opens no handshake). The word is kept in/root/dns.tlsand published in/run/moonwater/dns.tls, so a lookup by a user who cannot read/rootfollows it too. - TLS: SAN only, no common-name fallback. 120 Mozilla roots as keys,
distrust-afterdates enforced. DNSSEC out of scope: the resolver is a stub that trusts the network's DNS (DNS over TLS authenticates the resolver, not the answer's origin). - Certificate Transparency at the tight tier (
tls_ct_holds): a chain that ends at a public root has to carry its leaf's proof of being logged, as Chrome asks: the SCTs embedded in it (RFC 6962), each verified under the log it names insrc/net/ct_logs.inc(Chrome's list, regenerated by--harness ct_logsfrom the list its header names) over the precertificate -- the leaf's TBS without the SCT list, and the SHA-256 of its issuer's SubjectPublicKeyInfo -- and counted only from a log that is usable, qualified or read-only, or retired after the SCT was made, whose temporal interval holds the leaf's notAfter, and only if made by now. Counted SCTs come from two log operators at least, one from a log not retired, two for a leaf of 180 days or less and three for a longer one. Otherwise wget says the certificate "was not logged as Certificate Transparency asks", status 5. SCTs sent in TLS or in an OCSP staple are not read (every public certificate carries its own). The default and reference tiers do not ask, as GNU wget and curl do not. The table is a snapshot: logs Chrome adds after it are unknown here until it is regenerated, so a leaf logged only to newer logs is refused at the tight tier. - Revocation is stapling and CRLs, in tiers (
tls_revocation_holds). A checked connection offersstatus_request; the leaf is asked by the OCSP response its server staples (the leaf's CertificateEntry in TLS 1.3, a CertificateStatus after the Certificate in TLS 1.2, relaid into the same entry so one check reads both), and without a good staple, like every certificate above it, by the CRL its first whole-reason distribution point names, at each of itshttp:URIs in turn until one answers (Microsoft's first, www.microsoft.com, answers a plain GET with 403; its second, crl2.microsoft.com, serves the CRL). A staple has to be signed by the issuer or by a responder the issuer issued withid-kp-OCSPSigning, name the leaf by a SHA-1 or SHA-256 CertID, and be fresh within five minutes either way ofthisUpdateand anextUpdateit must carry; a CRL has to be the issuer's (Name, authority key identifier when both carry one,cRLSignwhen the issuer limits its key, signature), cover the certificate (issuingDistributionPointsharing a name with its distribution point, of its kind, not partial or indirect) and be fresh the same way. Revoked refuses in every tier, stale or not. A must-staple leaf (TLS Featurestatus_request, RFC 7633) without a good staple refuses in every tier. A source that gives no usable answer -- unreachable, too large, unparseable, stale, signed by no one it may be, about another certificate,unknown,tryLater-- is passed over at the default tier and refused at the tight one (MOONWATER_STRICT_NET >= STRICT_TIGHT, the hardened and lockedsec_netprofiles). A certificate that names no CRL and whose server staples nothing has no source to fail and passes in both. OCSP is never fetched, only stapled, so a responder URL alone is not a source: by decision, not omission. The CA/Browser Forum's Baseline Requirements have had every publicly trusted CA publish CRLs since 2024, Let's Encrypt stopped answering OCSP in 2025, and a request to a responder tells it which site this machine is visiting, which a CRL, fetched whole, does not. A CRL is fetched under the caIssuers rules (http:only, port 80 unless a harness serves it, a public address, one HTTP/1.0 GET, no redirect) inside one ten-second budget per handshake that nests in the handshake's own, held in memory for the process (no file: the fetch may run where none can be opened), refetched past itsnextUpdate, and a failed fetch is not tried again for five minutes.--no-check-certificateasks for nothing and reads nothing, and keeps refusing an unasked staple. - A refused certificate is status 5: wget exits 5, as GNU wget does, and says
which way it was refused in GNU's words (not trusted, owner does not match
hostname, has expired, is not yet activated, has been revoked -- GNU wget's
GnuTLS line) with the
--no-check-certificatehint, which still connects; where GNU wget has no line, a status that could not be checked where it is required saysERROR: Whether the certificate of 'HOST' is revoked could not be checked.with the same hint. Any other failed handshake is 4. The causes are kept apart from the handshake up (tls_conn.fault,TLS_UNTRUSTEDtoTLS_UNCHECKED,HTTP_UNTRUSTEDtoHTTP_UNCHECKED), a name that fails is named before the dates, and revocation is asked only of a path that passed everything else. - A secret on a command line (
wifi add SSID PASSWORD,link group NAME SECRET) is inpswhile the command lives and in the shell's history for good. The standard-input forms (wifi add SSID -,link group NAME -; a no-echo prompt at a terminal) keep it out of both, and are what a machine script uses (... - < /root/secret). The shell's history refuses the two argument forms (history_secret_line) after assignments and a list of wrappers (sudo,env,nice,timeout), in the first twelve words: a best-effort denylist, not a boundary. It does not seesudo -u root,env -u NAME,bash -c,ssh HOST moonwater, a function, an alias, a variable or a substitution, or the verb after twelve words, and a secret on such a line is kept like any other word. A pairing code (link NAME abc-def) is left in the history on purpose: it works once, for five minutes, and is read off the other machine's screen; a link key is public. The tight tier refuses both argument forms; a terminal user at the default tier is told to use-. - A Waterlink group's grants are its members' grants, taken back together
(
link_group_join, MW-2026-040). A machine paired through a group carries the group's grants copied into its own peer record; narrowing the group (link group NAME SECRET allow GRANT...with a bit dropped) clears the dropped bit from every member the group paired, under the peers lock, and writes the members before the group so a half-written change grants less, never more. A grant the group starts giving is not pushed onto members already paired (each is widened only by name); a peer paired by hand (group mark 0) is never touched. Before the fix a group grant was a pair-time snapshot that revocation did not reach, so a machine the operator had takenrunfrom kept running commands as root. A machine is never called by a wordlinkuses, theportverb included (MW-2026-041). - A greeting pairs by the groups file as it is, not as the listener last
read it (
link_group_held, MW-2026-070). The listener keeps a copy of/root/link.groupsthat it reads again at most twice a second, and that copy only says which keys a greeting may open. What the greeting may become -- whether the group is still joined under that secret, whether a code is still open, the grants a new member is given -- is read from the file under the peers lock, the lock every command that changes the file holds. Before the fix a member greeting in the half second afterlink group leave NAME forgetwas written back with the group's grants, for good, after the command had said it removed the group's machines; the same window let a narrowed group give a new member what it took back, an old secret open a re-keyed group and a code that was taken back pair. What a command does to the groups file now holds from the moment it returns. - OUT-D1, boot takes an install without asking only when it is the disk
the session started from (the settings an image boots with and the image on
the disk carry the same random medium), or the only disk with this build and
on a bus nothing is plugged into. Every copy of a public release says the same
build, so a stick somebody pushed in said it too, and its
/root/main.moonwater.shran as root. More than one disk with the build asks unless one is the session's own; one that is USB, Thunderbolt,removable, behind aremovablePCI port, or cannot be told is asked about (host_disk_external, fail closed); the tight tier asks about every disk but the session's own. Default not decided by the owner: a lone USB stick of this build on a machine with no install of its own is asked about (the safe side), andhost_lone_takenis the one line that flips it. The census holds the disk it found, so a second disk with copied partition identities cannot be mounted in its place. - Kernel defaults init writes before it starts anything
(
system_kernel_defaults, src/sh/system.c): the fourfs.protected_*switches,kptr_restrict,dmesg_restrict,io_uring_disabledandrandomize_va_space(what Debian and Arch ship; the tight tier raises fifos, regular,kptr_restrictandio_uring_disabledto 2, widens mmap's randomisation to the kernel's limit and sets Yama'sptrace_scope2; the locked tier sets Yama 3 andmodules_disabled, both until the next boot; the reference tier keeps the kernel's own). They were the network watcher's, written a moment after boot by whichever process was that, and not at all where it never started. The desktop image also writesvm.max_map_count1048576 (the kernel's is 65530; games and Proton map more), on every tier but the hardened and locked ones, which keep 65530: a count of mappings, not memory, and a tier that runs no games does not raise it. - Game controllers (
CONFIG_INPUT_UINPUT,CONFIG_INPUT_JOYDEV,CONFIG_MOONWATER_INPUT_GROUP, in kernel/profile/desktop). On the desktop image the input device nodes (/dev/input/event*,js*, and/dev/uinput) are mode 0660 in the input group, 104, which nobody is in by default. Only a bowl the person set up for Steam, or explicitly allowed, is given the group, at launch:/etc/moonwater/input-bowlsnames it with a lineinput ROOT, the Steam profile's install writes that line and its remove takes it away, and the launcher reads the file as root before it drops the user, bounded (over 4096 bytes grants nothing), by exact line (a second word, a control byte, a trailing byte or another root grants nothing). Every other bowl launches as before: no group, and no event, joystick or uinput node is reachable to it. This is the security consequence, and it is narrower than it was: a program in the Steam bowl can inject input events into the machine and read every key and pointer event, passwords included, and so can any program in a bowl someone allowed by hand. Steam Input needs both halves: the pad it makes (/dev/uinput) and the controller it reads (/dev/input/*). The desktop image only; the hardened, locked and server profiles turn the group off (CONFIG_MOONWATER_INPUT_GROUP=n, with#> overrides), and there the nodes stay 0600 root, and uinput is absent in the hardened and locked images. The grants file is in /etc, which a bowl sees read-only; a marker inside a bowl's own /var or root would be the bowl's to forge, and is not used. The mice nodes (/dev/input/mice, mouseN) are not in the group: mousedev is not changed here.protected_regularandprotected_fifosbind root as well: its>fileonto a file another user made in a sticky/tmpfails, which is the attack they close; the boot, install and desktop lanes run with them on.kptr_restrict1 anddmesg_restrict1 leave root's kallsyms, perf and dmesg (CAP_SYSLOG) alone. - The kernel's build configuration is part of the security record. The
kernel is built from
allnoconfig, where an option nobody names is off whatever its Kconfig default says, so a hardening option that every distribution takes for granted was not in the image until a profile named it (sec_baseline: stack protector, usercopy andFORTIFY_SOURCE, slab freelist hardening,VMAP_STACK, the x86-64 mitigations underCPU_MITIGATIONS,W^Xon riscv64, themmap_min_addrfloor). Every tier composes the baseline; the hardened and locked tiers add five kernel regions (sec_mem,sec_cpu,sec_surface,sec_dma,sec_lockdown), each a profile of its own at each level, and five userspace regions that setMOONWATER_STRICT_<REGION>. The Security tiers section below lists what each region does. The gate for a region issh test/run switches(what composes, what a region names) and a boot of the tier's image;build verify-configreports an option a tier asked for and did not get, and the build says so for every tier on all three architectures. - The pinned kernel source carries its own security fixes, and a tripwire
holds the pin to them. The image is built from one Linux tree (currently
7.3,
artifacts/linux-7.3.tar.xz,git archivecommitc03c1a14); Moonwater touches networking only through the read-onlymw_net_silent_gateRST/ICMP guard inkernel/kernel.c, which alters no free. A fetch that moves the pin forward must keep the fixes the pinned tree already carries: thekernel_cverow ofsh test/run kitreads the tarball (or the extracted tree) and fails if the IPv4 TCP connection-setup options (inet->inet_opt,ireq->ireq_opt) revert to a plainkfree()from thekfree_rcu()that the fix for CVE-2026-98432 installed (e3f33b0a1d89, shipped in 7.2.10 and 7.3). The verdict and a deferred KASAN reproduction recipe are inincident_response.md. - Mounts: the kernel module mounts
/procand/sysnosuid,nodev,noexecand/devnosuid,noexec, init mounts/dev/ptsnosuid,noexecand/dev/shmnosuid,nodev(noexecas well at the locked tier, which also addshidepid=invisibleto/proc)./is the initramfs's tmpfs root, 1777 as the kernel makes it: sticky, so another user cannot replace or remove a name root made there, but anyone can make a new name at the top. - The compositor's doors are root's (
WINDOWS_DOOR_MODE, MW-2026-020). The compositor runs as root and frees a window's row when every writer of its FIFO door (/run/moonwater/window.N, and the wake beside it) has closed, so a door the whole machine could write was a door any local program could hold open to keep a dead window's row forever and, after thirty-two, deny the machine a new window. The window table is the compositor'smemfd, reachable only through/proc/PID/fdof a root process, so no non-root program can map it and be a window; the doors are now0600, which every client (a program a desktop session starts, root, and the compositor) opens as root. An unprivileged window client, if ever wanted, is handed the door and the table as descriptors, never a world-writable FIFO. - Input a program makes is marked (
WINDOW_EVENT_VIRTUAL, MW-2026-202). The compositor sets the bit in a KEY, BUTTON, MOTION or WHEEL event's flags unless it read the event itself from an input device whose node resolves (by its device number,/sys/dev/char) under a real bus and notdevices/virtual(uinput's, uhid's), so a key a program types, the on-screen keyboard's keys and anything of unknown source are marked, and a window lets only an unmarked press change what only the person at the machine may. A Bluetooth LE keyboard, which bluez brings up through uhid, is marked too: nothing unforgeable tells it apart. - The image's own programs, built with the compiler's hardening, are a region
(
sec_build_hardened): locals zeroed (-ftrivial-auto-var-init=zero), frames probed (-fstack-clash-protection), call-used registers cleared (-fzero-call-used-regs=used-gpr) and the stack protector with a global guard (-fstack-protector-strong -mstack-protector-guard=global; lib.util.c seeds__stack_chk_guardfromgetrandomat the top ofmainwith its low byte zero, and__stack_chk_failsays so on standard error and dies of SIGABRT). The cost is in the profile (+5.7% on a shell start). The guard is one global, so a program with an arbitrary write can change it, which is the usual limit of a canary; the programs are not position independent (the Spark format has no relocations), so code is at a fixed address in every process. Held bystack_guard_check(lanestack: a frame that is not smashed returns, one that is dies with 134 and the line, two runs have different guards with a zero low byte) on all three architectures, andMW_HARDEN=1/MW_AUTOINIT/MW_CFLAGSintest/run, which build every lane's programs with the flags and found aPUREfunction that stored through a pointer (the redirect of2>/dev/nullwent to the wrong descriptor when locals were zeroed).pure_stores(kit) refuses the class: aPUREorCONSTdefinition that stores through a pointer parameter, or aCONSTone that reads through one. - OUT-D2, the data partition is mounted
nodevand notnosuid: it holds/root,/homeand the bowls; a bowl'ssudoandsuneed setuid. The locked tier mounts itnosuidas well, since it has no bowl and no one to runsu. Whose disk boot takes without asking is the control (OUT-D1). - OUT-D4, a word a disk's
/rootchose is spelled, not obeyed, when a root verb prints it.moonwater keyboard,timezone,ntpandstatusprint words read from/root(/root/keyboard,/root/timezoneand its mode,/root/ntp.serverand/root/ntp.nts.servers). Those sinks spell each word throughwriter_terminal_name, which escapes control bytes, tab and high bytes to\xNNin the formatter, so a disk (attacker 6) whose word carries a newline cannot forge a second[Moonwater]line and a bidi override cannot reorder one;plain_outkeeps a%sfield's own newline and tab on purpose, which is why the escape is per field and not in the stream. A legitimate code, zone name or hostname is ASCII and is unchanged. The other verbs that print a disk's or a device's word already route through an escaper (radio_displayfor SSIDs,usb_shown/usb_keyfor USB strings,link_name_goodfor peer names,name_validfor the machine name,host_plain_linefor an image's build). Found and fixed 2026-10-26 (MW-2026-030). - OUT-D5, a build from a stick is taken by its bytes, and nobody vouches for
them (attackers 5, 6 and 7;
moonwater setup update usbandsetup rollback, src/sh/host.c). What is checked before a stick's build is written over the disk the machine starts from: the command is root's, as every verb that changes the machine is, and at a terminal it asks for yes (a script says yes in its words); the stick is on a USB device the device policy lets in (host_stick_let: every device on its sysfs path authorized by the kernel and let in byusb_judge, its storage interface byusb_interface_let, so a device the policy holds is not mounted even in the moments the kernel has it configured; a disk on no USB bus is not the policy's); the image is a PE32+ EFI application whose header names this machine, that runs as far as its own sections say and that names a build, its build read from its bytes and never from a file name (host_image_fit), judged when the sticks are looked at, again once mounted for the write, before anything on the system partition changes (the update's first step), and again as the copy on the disk; the copy is the stick's bytes but for the settings slots, read back from the disk unmounted; the install written is the one the question was about, its partitions resolved again after the answer by the identities in its GPT and its system partition, once mounted, held to that identity and that disk by the device the mount holds (host_system_mount,host_mounted_is; the name resolved before the question was what was mounted, so a disk swapped in under it while the answer waited was written, MW-2026-199); and where the stick carries a SHA-256 beside the image (build.sh --usb-updatewrites one) the image is that sum. The sum is the stick's word about its own bytes: it catches a copy that went wrong, not a stick made to lie. Who made the build is not checked. Moonwater has no signing key for its images (the kernel is not signed, and Secure Boot has to be off to start it), so nothing is verified against one: anybody with root and a stick can put any image that passes the checks above on the disk, assetup installandsetup updatealways could with whatever image the session started from. The disk keeps its data and its settings (OUT-D1 is unchanged: the new build boots the disk as its own because it carries the disk's medium), and the build it had is kept as\EFI\moonwater\previous.efi, whichsetup rollbackstarts again by the same written-beside, synced, read-back and renamed steps (a loader that cannot be read is not kept and does not stop the write: previous.efi is left as it was, the disk starts from the default settings, and both are said); a build that does not start at all is got past by the firmware startingprevious.efifrom its boot menu or shell, or by a stick. One more file is written to the system partition, and only bymoonwater splashandsetup install:\EFI\moonwater\splash.ppm, the picture the image's EFI stub draws before the kernel starts (host_splash_place, kernel/patch/splash-stub.c). It is root's to write, it is a binary PPM of at most 1 MiB and 1024 pixels a side that was parsed whole first (splash_parse, src/moonwater/splash.c), what is written is a header this wrote and the checked pixels and never a person's bytes as they came, and it goes by the image's steps (beside its name, synced, read back, renamed, read back from the disk unmounted). The stub reads it through the firmware's file protocol from the volume the image came from, checks it with the same parser before a pixel is drawn, and is silent about a file that is missing, cut short, too long or of another shape: such a file is no picture and the machine starts as it does without one. So whoever can write that partition can put a picture on the screen at start and nothing more; they could write the image itself already. An update and a rollback do not touch it. No firmware variable is written and nothing is flashed: the firmware's own logo, the one shown before any loader runs, is left as it is on every machine, and no file is written to a maker's logo directory (the one such route there is, Lenovo's\EFI\Lenovo\Logo, is only read when two undocumented variables of that firmware are set, which Moonwater does not do). - OUT-D3, unprivileged user namespaces stay as the kernel has them: bowls
need them, no tool here creates one otherwise, and
user.max_user_namespaces0 would take them from the test harnesses on the same kernel; a kiosk tier that wants them off sets it.unprivileged_bpf_disabledhas no knob: the image has nobpf(2)(the classic socket filters the DHCP client uses are separate). - Two switches for bowls,
moonwater security packagesandsudo. They are kept in the security list of the image's settings and published in /run/moonwater/security beside TLS's five (switch ids 6 and 7; TLS_SWITCHES is 7, so a TLS client reads the file past them), andsecurity_switch_on(host.c) answers them for bowl.c and the command's root check.packages(the programs of a bowl may run the package manager of their distribution) is on at the default tier, as it always was, and off at the bowl's tight tier (MOONWATER_STRICT_BOWL2 and 3:sec_bowl_hardened,sec_bowl_locked, andsec_hardenedandsec_locked, which put every region there), which refusespackages on: it only tightens, and off is meant to take from a compromised bowl program (attacker 8) the one tool that installs more programs.sudo(themoonwatercommand through sudo or su in a bowl, by a process that is root only inside the bowl's user namespace) is off at every tier and can be turned on at the default tier only; a tight build refusessudo onand reads one kept by another build as off. It is off because on trusts root in a bowl as root of the machine for the command's verbs, and root in a bowl is whoever can start one, the user and not a second account, so on hands every such user the machine's settings: it is for a machine with one user. It cannot hand over privilege. The root check is the command's manners, and whatever changes the machine is the kernel's to allow (capable(), in the first user namespace): a process that owns its mount namespace can plant a file of its own at /run/moonwater/security and read sudo as on, and gains nothing the kernel would not give it anyway. The reader takes the file only as a regular file, not through a link, that a group and others may not write, owned by root or by the overflow uid (which is how root's file looks from a user namespace that does not map root, a bowl's), no longer than the overlay and read whole; anything else is the tier's default, never sudo on. A bowl has a /run of its own, so packages is asked before a bowl's namespaces are made, and the command inside a bowl sees the switch only when the bowl carries the file in. An older build that boots settings with either switch turned publishes the entry and refuses the file whole, since its reader knows five ids, so its TLS refuses every checked certificate until a build that knows the switch sets it back. What asks the switches is a change of its own: bowl.c before a bowl's program runs a package manager, and the root check before it takes a bowl's root. Until it lands a switch is kept, published and listed and enforces nothing, and that effect is a gap no row holds. The switches and their reader are held bymoonwater_cli(defaults, a turn and back, the published entries, a second run, nobody, nine files that do not count, the tight build's lines and refusals) and byCHECK_bowl'sswitches_askedat both tiers (sh test/run cli bowl). - BOWL-D1, who a bowl's programs are against attacker 8 (
bowl_become_user, src/bowl.c; MW-2026-010). A bowl's programs run in a user namespace. At the default tier the user's inside id 1000 is mapped to the launcher's outside id, which is 0 when root launches the session (the Canvas terminal, the console, the/bowls/binlaunchers, the KDE session): a program of the bowl is then the machine's root to the kernel (every file it makes is root's, every file root owns is its own, a signal it sends is root's) and the fast view keeps the host's/rootand/run/moonwater. This was deliberate (6b81fbd2, so a desktop's home, devices and runtime directory "need no other mode") and is 1:1 with before, but under attacker 8 a taken-over browser or KDE component is unconfined root (it reads/root/link.key, writes/root/main.moonwater.shto be run as root, signals any root process). The hardened bowl tier (MOONWATER_STRICT_BOWL >= STRICT_TIGHT,sec_bowl_hardenedand the locked tier) drops a root-launched fast launch to a real unprivileged kernel id 1000 before the namespace, in the device groups a compositor needs (video,render,input,audio,tty, notdiskorkmem), withNO_NEW_PRIVSand only the namespace's capabilities (which reach nothing the machine owns, since root is unmapped), binds a home the user owns over/rootand gives it its own/run/user/1000; it fails closed.bowl setup,bowl --root,bowl udev,bowl busand a barebowl ROOTconsole shell stay root in the bowl's own tree. Held bylane_desktopunderMOONWATER_BOWL_TIER(three confinement rows and the existing weston draw rows). Default not decided by the owner: whether to make the dropped id the default (it moves a session's config from/rootto/home/user), which is the behaviour change6b81fbd2deferred. - The clients' network half runs apart (
net_apart,src/net/net.c). wget (--spidertoo), fetch,host, the NTS key establishment and every SNTP or NTS time query the machine's NTP child makes as root (nts_ke_apart,sntp_query_apart), the zone question the machine asks at boot as root (locale_auto_ask) and the plain lookups of hostid, logger, a Waterlink service and NTS's time server (net_resolve_v4_apart) parse TLS, X.509, HTTP, NTP and DNS from whoever answers, so that half runs in a forked child; bowl's downloads exec wget and get it too, and a DNS over TLS lookup or a revocation list a fetch needs is made inside the same child. The child keeps the answer's pipe, the output it was handed (wget's file or standard output, or nothing) and standard error, and closes the rest; readsresolv.conf, the DNS over TLS setting and the clock's floor (clock.good) before it may not (the anchors are compiled in, the clock is the vDSO, a revocation list is held in memory); becomes nobody when it is root (a user namespace that maps no nobody,unshare -r, keeps its root, which owns nothing outside it); is not dumpable, dies with the client (PR_SET_PDEATHSIG) and gains nothing through exec (NO_NEW_PRIVS); then a seccomp filter kills it at any call but IPv4 TCP and UDP sockets (no unix, netlink, packet, raw or IPv6), their connect, bind, sendto and recvfrom,SO_RCVTIMEO,SO_SNDTIMEOandTCP_NODELAYto set andSO_ERRORto read, ppoll, the clock, getrandom, write, writev, close, memory that is never executable, exit, andriscv_hwprobeon RISC-V; a time query's child may alsorecvmsgand setSO_TIMESTAMPNSandSO_TIMESTAMPING. A redirect, a caIssuers fetch or a revocation list is another socket in the same child. The client opens and publishes the output and makes every decision that touches a file, and believes the child's answer only as far as it can check it: a statushttp_runcan return, an errno, a URL, head and body no longer than they may be, lengths that add up; the zone question's answer is read again through the zone table, so what root writes and logs is the table's spelling. It fails closed: a kernel that will not take the filter (one without seccomp, a container whose filter refuses it, qemu-user) fetches nothing (HTTP_CONFINE; wget exits 1, "cannot confine the download"); a child that dies or answers what cannot be believed isHTTP_APART(wget exits 4 and names the signal); a child killed by SIGPIPE or SIGXFSZ died writing the output, and the client dies of the same signal, sowget -O - | headis still 141.hostsays "cannot confine the lookup" (DNS_CONFINE) or that the confined lookup died (DNS_APART), and an NTS key establishment that cannot be confined is no time from that server. The NTS state comes back only asnts_ke_replycould have made it (one to eight cookies of 1 to 256 bytes, a name or nothing for the time server, a port not zero), and the keys are wiped from every copy but the caller's. A time query's answer is believed assntp_query_atcould have made it: a status it returns, a samplesntp_reply_samplecould have taken (delay within 2 s, an offset inside the NTP window and inside the asked bound once synchronised), and for NTS only the cookies, each 1 to 256 bytes;moonwater time syncsays when the query could not be confined (SNTP_CONFINE) or died (SNTP_APART). DHCP has its own filter (dhcp_confine, DHCP-D2), which also fails closed. A new client is a task handed tonet_apart, andsecurity_hygienefails any call into the HTTP/TLS engine, the NTS key establishment or the resolver over TLS that is not inside one. - Root is not a wall: hardening against a hostile root is out of scope.
- Ring 0: no
crypto_,tls_or X.509 code is in the include graph ofsrc/moonwater/core.c;net.cis userspace only. - Residual: DHCPv4, plain DNS and plain SNTP cannot defeat an on-path peer. C cannot prove ownership or bounds; guard pages, sanitizers, fuzzing, fault injection and three architectures compensate. Limits stop one connection from growing without bound, not a distributed flood.
- ARP probe: a new lease is installed only after three probes, 200 ms apart, find nobody else on the address (+0.6 s to a first lease; renewals and rebinds skip it). A probe that cannot be sent refuses the lease. Once the address is in, two ARP announcements 100 ms apart (RFC 5227 spaces them two seconds) refresh the neighbours' caches.
- DHCP-D1, the replies of an acquisition come off a packet socket, so
rp_filteris on: 2 (loose) at the default tier and 1 (strict) at the tight one, witharp_ignore1,arp_filter1,arp_announce2 andarp_notify1. A UDP socket never got the OFFER of a server the machine has no route to yet with eitherrp_filterset, nor a reply unicast to the offered address. The packet socket sees frames before netfilter andrp_filter, so what IP and UDP would have refused is refused bydhcp_unframe(version, header length, total length, fragments, protocol, both checksums unless the kernel vouches for the UDP one, ports, UDP length) and the destination must be the broadcast address or the one offered; a locked classic BPF prefilter keeps only UDP to port 68 that is not a later fragment. The IP source only binds the exchange to its OFFER's sender, as the UDP peer did. Renewals and rebinding hold an address and stay on UDP. - DHCP-D2, no filter, no exchange: the confined child refuses to run when
seccomp will not install its filter (a kernel without
SECCOMP_FILTER, which every Moonwater kernel has bybuild_essentials, or qemu-user): no lease rather than hostile packets parsed unfiltered. Itssendtoandwritemay name only the client socket and the answer pipe, since a packet socket that can be written sends any frame. Callers that are not the watcher's child (the checks) are not confined. - DHCP-D3, a REQUEST is let finish: link news, the wake pipe or the end of the twelve-second budget while a REQUEST is in its ACK window waits up to two more seconds for the answer, the news unread until then (and through the conflict probe after it). When the grace runs out the address is given back with a DHCPRELEASE broadcast from 0.0.0.0 (ciaddr the address, the server named, no parameter list). A window that ended unanswered gets no grace and nothing is released for it.
- FW-D1, a closed port is silent off loopback at the tight net tier
(
net.ipv4.moonwater_silent): a TCP segment to a port nothing listens on is answered with a reset and a UDP datagram to a closed port with an ICMP port unreachable, which tells a scanner the port is closed and is work done per packet for whoever sent it. The switch (an int,mw_net_silent_gateinkernel/kernel.c, written 1 by the network watcher atSTRICT_NET2 and 3, left at the kernel's 0 at the default tier) has the four "no socket" ends of the receive paths drop the packet with no answer unless it came in on a loopback device: TCP skips the no-sockettcp_v{4,6}_send_reset, UDP skips the port-unreachableicmp_send/icmpv6_send, and the packet is dropped with the reason it would have carried after answering. Loopback keeps answering, so a connect to a closed port of127.0.0.1,::1or the host's own address (routed overlo) is still refused at once; the check is by device, not by address. It is not a firewall: a port with a listener is reached as ever, and nothing is added to the path of a packet for an open port (the checks sit only on the cold no-socket paths, past the checksum). Honest limits: a reset or an error for a packet that matches an existing socket or TIME-WAIT is untouched, as is every other ICMP, neighbour discovery, Packet Too Big and the ICMP errors of forwarded traffic, so the host still answers an echo and an ARP or ND and goes on being visible, and an open port's reply still stands out against the silence of the closed ones. The switch is written only by the network watcher when it starts, so a tight-tier machine whose watcher never ran keeps answering, and a value set by hand is undone the next time the watcher starts; it is one int in the first network namespace's table (ipv4_tableis registered forinit_net), so a namespace of its own neither sees nor flips it, while a packet reaching the host over a veth from another namespace is silenced by that one int like any other. AMOONWATER_STOCKkernel has no such file. The observable is that a scan stops moving/proc/net/snmp'sTcpOutRstsandIcmp/Icmp6OutDestUnreachs(TcpInSegs,UdpNoPortsandUdp6NoPortsstill count the packet): proved between two guests on a private link bysh test/run firewall. - Bad URL spellings:
http:andhttps:without//are refused in every tier (a host namedhttpsis not worth a plaintext connection to the wrong place); the tight tier refuses every leading scheme token (ftp:21). - WIFI-D1, TKIP and WPA1 are never joined: a group cipher of TKIP (the WPA/WPA2 mixed setting) or a pairwise set with no CCMP is refused before anything is sent, in words that name the fix ("set the access point to WPA2 or WPA3 with AES (CCMP)"); any other cipher is refused as not offered.
- WIFI-D2, what a join asks for (
wifi_join_plan): WPA3 (SAE, group 19) whenever the access point offers it and the saved secret is a password (a key of 64 hex digits is a PSK and cannot do SAE), with management frame protection required; WPA2 (PSK-SHA256 when it is offered with protection, else PSK) when it is not, with protection whenever it is offered. A network that offers both is tried as WPA2 after WPA3 only when the exchange came to nothing for a reason that is not the password. What the join reads it from is both frames the kernel keeps of the access point (its latest, which a probe response from anybody can be, and its last beacon), taking what either offers: a forged frame can then add an offer, which costs a join a forger could stop anyway, but not take one away. Message 3 of the handshake carries the access point's own RSN element and RSN extension element under the MIC; one that matches neither frame the join chose it from is refused unanswered (WIFI_REFUSE_ELEMENTS, 802.11-2020 12.7.6.4, as wpa_supplicant does), so a stripped offer is caught at the handshake. - WIFI-D3, protection is asked for as required: the kernel takes no
optional form from a driver with no connect of its own (mac80211's kind), so
a join that sees protection offered asks for
NL80211_MFP_REQUIRED, and the kernel then drops unprotected deauthentication and disassociation frames. The IGTK (BIP-CMAC-128, key ids 4 and 5) is installed as the GTK is: only on a link that asked for protection, only from a frame whose MIC checked, once per key (zero bytes are a key;igtk_installed), before the group handshake is answered or its replay counter consumed, and dropped on a roam. - WIFI-D4, what a network teaches is kept (
/root/wifi.rules, 0600, written beside itself): an access point of a saved name that offered protection makes every later access point of the name without it refused (WIFI_REFUSE_PMF_GONE), and one joined with WPA3 makes WPA2 refused (WIFI_REFUSE_SAE_GONE): a twin that offers less is what a forged deauthentication or an offline password guess needs. The choice of access point ranks such twins last. Both are forgotten bywifi removeand bywifi addwith another password (its owner saying the network changed), and kept by an add with the same one, which a machine script makes at every boot. Trust on first use: the first join of a network has nothing to hold it to but message 3. - WIFI-D5, the tight tier (
MOONWATER_STRICT_NET >= STRICT_TIGHT, whichsec_net_hardenedandsec_net_lockedselect): every secured join has protected management frames, so a WPA2 network without them is refused (WIFI_REFUSE_NO_PMF) whatever the saved network says, and WPA2 is joined only for a network saved withmoonwater wifi add SSID - wpa2(WIFI_REFUSE_WPA2), with no fall back from WPA3 to WPA2 without it. The owner'swpa2changes nothing below the tight tier. Default not decided by the owner: whetherwpa2should lift the protection requirement too (one line inwifi_join_plan). - WIFI-D6, SAE's password element and side channels: hash-to-element
(12.4.4.2.3: PT by two simplified SWU maps of RFC 9380, Z = -10, square roots
by the fixed exponent (p + 1) / 4, choices by mask) whenever the access point
says it takes it in its RSN extension element, which every 6 GHz network and
every one set to it alone does; hunting and pecking otherwise, as every WPA3
station has: each pass is worked out whole, at least 40 of them (255 at
most) whatever pass lands, the test for a square and the choice of the root
and of the pass by mask and fixed exponent, the Dragonblood advice. What the
password still decides: the HMAC's block count (its length), and, below 2^-40,
more than 40 passes. The secret scalar multiplications are
crypto_point_scalar_private; the peer's commit is checked for range, the curve and reflection before any multiplication. Not built: password identifiers, groups other than 19 (a refusal of group 19 ends the join), SAE-PK, the extended-key suites (AKM 24 and 25), FT. A network that offers hash-to-element is never hunted for: the extension element of message 3 is held to what was seen, so stripping it from the beacon is caught. - WIFI-D7, the station runs apart (
radio_join_apart, src/sh/host.c): the scan, the choice, WPA3's exchange, the association, the four-way handshake and, for as long as the link stands, the keeper's rekeys run in a station process that is nobody with CAP_NET_ADMIN and CAP_NET_RAW and no other capability (the rest dropped from its bounding set, nothing ambient), not dumpable, killed with its broker, with no new privileges and under a seccomp filter (radio_filter_build): netlink sockets of the route and generic families, the EAPOL packet socket (datagrams of type 0x888e) and nothing else, a netlink group joined or left and extended acks as its only options, never executable memory, no file, no exec. The scan elements, SAE commits and EAPOL-Key frames any station in range sends are read there. What it needs of the machine's state (what a saved network taught, the access points to try last, a scan's age, the WPA3 budget) it asks of its broker as fixed-size questions by number; the broker is root, detached, holds the keeper's lock, does the one thing each question names to the one file it names, logs only its own literal for a numbered line, and believes only a status a join can return. Every password the joining process holds is wiped from the broker's copy at once and from the station's once its join is done. It fails closed: a kernel that will not take the filter joins nothing (WIFI_REFUSE_CONFINE, said bymoonwater wifi); a station that ends without a status isWIFI_REFUSE_APART. - The mDNS reader runs apart (
discovery_mdns_read_apart, src/net/discovery.c, the network's discovery; the Waterlink listener is its caller, src/waterlink/nearby.c): every host on the link may send the listener mDNS, and reading it walks names, compression pointers and records of the sender's lengths. The listener is root and keeps the link's key, so the reading (discovery_mdns_read) is done by a child that is nobody, not dumpable, dies with the listener, holds only its end of a socket of whole messages and stdio, and is killed at any call but reading a packet from that socket and sending the reading back. It is a fork of the listener, so before it confines itself or reads it forgets what its caller names, which for the listener is the link (link_secrets_forget, MW-2026-188): the key, the cookies' secret, every session's keys and frames, the groups' keys and the datagrams last opened;security_hygieneholds it to that order. A packet shorter than a DNS header is not sent to it. The listener believes the fixed-size reading only with every count and length inside its array; a reader that dies or answers what cannot be believed is ended and started again. It fails closed: a reader that cannot be confined reads nothing, and the listener hears no machine nearby (the link without discovery). With LAN listen off nothing heard is greeted, and with LAN announce off too the listener holds no socket on 5353 at all. - USB-D1, a device plugged in is let in by a rule (attacker 5,
moonwater device, src/sh/host.c). The kernel holds the switches and the policy turns them: each device's and each interface'sauthorized, each root hub'sauthorized_defaultandinterface_authorized_default, and usbcore'sauthorized_defaultfor a controller that arrives later.device lockkeeps every device plugged in at the time as an allow rule (VID:PID/SERIAL;VID:PID/-#HASH, the serial's xxh64, for one too long to keep;VID:PID/-@PLACEfor one with no serial, the place being the root hub's serial (its controller's bus address), the root hub's product and the port path, which a boot that numbers the buses in another order does not move; a-@1-4pin of an older policy is read by its bus port untildevice lockwrites it again) with the classes of the interfaces it has then, denies every class, and puts it in force: a new device is then never configured, so no driver binds to it. Locked, the interfaces of a device that is configured wait at 0 until each is judged, and are authorized and probed only for a class its rule keeps or a class allowed (device class storage allow, which also has a new device configured so its interfaces can be judged): a stick that comes back as a keyboard as well has the keyboard held. A device the kernel holds unconfigured when the lock is taken (the command line holds every one at boot) is configured first, with every root hub's interfaces waiting, and kept as the classes it then shows; one that cannot be configured or shows no interface is not kept. A rule for a device named by its whole id while unplugged lets it in whole. A deny rule holds its device locked or not. One function judges (usb_judge) and one applies (usb_apply); boot, every verb and the watcher (a process of its own while the policy holds anything, woken by uevents it never reads and walking sysfs again every ten seconds) call those two and nothing else. A device that is built in is exempt from the lock's default only when it and every hub above it sayremovableisfixed, since a hub's own descriptor says that of its ports and a hub somebody plugs in can call every port it has fixed. A lock from off never holds a device present when it runs, which is the one net against a machine left with no keyboard (a lock while locked keeps only what the policy lets work); apply has none on purpose, since a machine whose keyboard has gone would admit the next one plugged in. What a device says of itself (product, serial) is attacker input: it reaches the status, the policy and the append-only log (/root/usb.log, 0600, cut to its newer half past 64 KiB) only escaped and bounded, a serial in one spelling everywhere that is printable ASCII, and a serial typed with a control byte is refused. What it cannot hold: the kernel reads a new device's device descriptor and strings before anything decides (the descriptor parsers are the kernel's attack surface either way), a hub that is let in enumerates what is behind it, a device that copies the VID:PID, serial and classes of an allowed one is that device to the policy, DMA over Thunderbolt or PCIe is the IOMMU's (sec_dma), and root can undo all of it. The policy is read once/rootis the kept one, so a device plugged in during boot is up until the first restore deauthorizes it: onlyusbcore.authorized_default=2on the kernel command line, whichsec_host_lockedsets, holds every device the firmware does not declare internal from the first moment. With the policy off, a deny rule is reactive (the watcher deauthorizes the device once it has enumerated). The tight host tier (MOONWATER_STRICT_HOST2 and 3) locks a/rootthat keeps no/root/usb.policy(whether a watcher runs does not decide it: a disk taken after an ask's session had locked was left with no policy), at its first boot once USB has settled (the devices unchanged for two seconds after three of uptime, fifteen at most, in a process of its own so the boot waits for none of it), and at once, carried over the session's lock, when a disk is taken later in the boot: a lock taken at the first restore held a guest's tablet and keyboard, which had not enumerated yet. Whatever is plugged in by then is trusted, but a device first seen in the last two seconds of the settle (one plugging and unplugging to hold it to the cap) gets no rule. A lock that cannot be written to/root(or finds there something it cannot read, which is not written over, at boot or when asked for) is in force from/rununtil the machine restarts or a verb keeps one, on every tier, anddevicesays why. A verb waits for the device lock 20 seconds at most and changes nothing if it cannot have it. The default tier changes nothing until the owner locks.sec_lockedreachesSTRICT_HOST3 through the whole build's level and does not composesec_host_locked, so its image has the lock at first boot but not the command line unlesssec_host_lockedis named. - UI-D1, the compositor's window table is root's, not anyone's. The
compositor shares its state as one writable mapping (
/run/moonwater/windows, window.cstruct windows): every window's pixel buffers and input ring in one place, which every window program maps and reads and writes its row of. That is a trust boundary, not a public interface -- a program that maps it reads the Canvas terminal's picture (a root shell's) and writes keystrokes into the focused window's ring (a confused deputy over root). Every legitimate window program is root (the compositor and the terminal, log, launcher and settings the machine script starts; a KDE or Chrome client speaks Wayland/X, not this table), so the table, its memfd and its door FIFOs are0600(WINDOWS_MODE) and/dev/spark'sWINDOWS_IOCTL_TABLE_GETneedsCAP_SYS_ADMIN, matching itsSETside; a process that is only root in its own user namespace (a bowl underunshare -r) is refused. Isolated unprivileged windows are not supported: a single shared writable mapping cannot keep one client out of another's pixels or input, and giving them each their own would be a per-client protocol, not this table (MW-2026-050; the settings window builds itsmoonwatercommands as an argv, never a shell line, and the Canvas terminal answers DA, DSR, DECRQM and XTWINOPS with fixed or numeric text only, never the title or any attacker string). - SH-D1, the environment a shell starts with is data, not the shell's
policy. Whoever sets the environment of a script (a
system()in a setuid program, a service's unit, a cron line) does not choose how the script's words are read: IFS is the shell's own three bytes (thesystem()attack); a root shell takes no PS4 (bash's rule since 4.4, kept for every personality); and GLOBIGNORE, which bash applies only once the shell assigns it (itssv_globignoreruns on assignment, never for the environment), is a plain variable until then in the bash personalities, whatever the ids and -p, where it was taken as the ignore list and chose which files the script's globs reached (MW-2026-203); dash has no GLOBIGNORE. Held by the shell lane'sglobignore-environmentfamily (every personality, root, nobody and the privileged utility's two mixed identities, with -p and +p) and itsprivilegedutility.
The compositor (src/canvas/compositor/manage.c, compositor_clip_*) holds two
selections: CLIPBOARD (copy and paste) and PRIMARY (the last selection, pasted
with the middle button). Programs reach them through the window table
(src/canvas/window.c, windows_clip_*); scripts through
moonwater clipboard. The setting moonwater canvas clipboard on|off,
... history N and ... limit MIB govern it.
- Text only:
text/plain;charset=utf-8, valid UTF-8 (shortest forms, no surrogates), no NUL, at most the limit (16 MiB by default, 1 to 16). Anything else is declined at the copy. - A copy is a memfd the copying program makes and seals against growing,
shrinking and writing. The compositor opens it through
/proc/PID/fd, checks the seals, the size and the text, and keeps it at descriptor 900 (CLIPBOARD) or 901 (PRIMARY), numbers nothing else is given. No byte is copied; the copying program cannot change the text after it was taken; the copy outlives the window that made it. - Nothing is written to a disk. The history (
canvas clipboard history N, 0 to 32, 0 by default) is memfds in the compositor's memory. Turning the service off,moonwater clipboard clear, or the compositor ending empties both selections and the history.
| Who | Copy | Paste |
|---|---|---|
| The window with the keys, right after a key or a button of the person's on it (1.5 s) | yes | yes |
| Any window right after a gesture of the person's on it | yes | no |
| A window with no gesture of the person's (a background program, a script driving a window) | no | no |
| A popup (a menu) of the window with the keys | as its window | as its window |
moonwater clipboard (root, from a shell) |
yes | yes |
| A non-root process, a bowl's program | no access (it cannot map the table) | no access |
The compositor answers a paste request with READY or REFUSED; a refused window learns nothing, not even the length. A window that asks to watch is told that the clipboard changed, never what it holds.
- Background snooping. A window that is not in front reads what was
copied (a password from a manager). Stopped: a paste is given only to the
window with the keys, and only within 1.5 s of the person's key or button
on it. Checked by
CHECK_text_enginesectionclipboard, which drives the real compositor functions through a random stream of offers, asks, focus changes and gestures; removing the focus rule turns 225 checks red. - Clipboard hijack. A program replaces what was copied (a wallet address swapped). Stopped: a copy needs a gesture on the copying window; the text is a sealed memfd, so the program cannot change it after the compositor took it. Removing the seal check or the gesture rule turns the check red.
- Paste injection into a terminal. Copied text from a web page or a file
carries
ESC [ 201 ~(ending a bracketed paste early) or other escape sequences, so pasting it runs a command or rewrites the screen. Stopped:term_paste_filter(src/canvas/term.c) removes ESC, every C0 control but tab and the line ends, DEL and the C1 controls (U+0080 to U+009F) from every paste, bracketed or not, so no paste can contain a sequence at all; line ends become CR. A program that asked for bracketed paste (DECSET 2004) gets the text between the markers; with the terminal's own line editor (the shell's prompt) the text goes into the line being typed and nothing runs until Enter. Checked against a model of the filter and with the attack string; letting ESC through turns 4172 checks red. - Malformed or huge data. A copy of invalid UTF-8, a NUL that truncates
the text for a C reader, or a gigabyte. Stopped at the compositor (and again
by the reader,
windows_clip_read): checked, bounded, declined. - Output of the command line.
moonwater clipboard getandwatchprint copied text, which is anybody's. To a terminal, C0 and C1 controls, DEL and the bidirectional controls (U+202A to U+202E, U+2066 to U+2069, U+200E, U+200F, U+061C) are printed escaped (\xNN,\u{N}), so the text cannot move the cursor, retitle the window or reorder the line it is read on;watchbounds each line.getto a file or a pipe writes the exact bytes, which is what a script asked for. - Every root program is trusted. The table is root's (mode 0600, the
compositor's memfd reached through
/procof a root process); any root program can read any window's pixels and could open the compositor's descriptors itself. The rules above keep well-behaved root programs from snooping by accident and define the protocol a future unprivileged window must be held to; they are not a boundary between root programs.
- Bowl programs (a desktop in a bowl, Wayland or X clients) have no access: they run their own compositor and its clipboard. A bridge to a Wayland data device is a decision for later.
- Only text. No images, no rich text, no files.
- The terminal does not answer OSC 52 (a program setting the clipboard by an escape sequence); that would let anything printed to the terminal write the clipboard.
A deliberate exposure, not an incident: bowl profile ssh install puts
OpenSSH's server (Alpine's openssh-server and openssh-keygen, 10.3p1 on
Alpine 3.24) in the Alpine bowl so that a person can reach the machine by a key,
and moonwater ssh (src/sh/ssh.c) runs it. It is off after install and
after every boot that followed a timed on; it listens only while the switch
says on. The Settings window's SSH group is the same rows (src/sh/registry.c).
/root/ssh(0700, root's; kept bywipe):settings(the switch, root, the port, the address, the time limit and a timed on's end),authorized_keys(the one list, written only byssh key addandssh key remove, each linerestrict,pty TYPE KEY LABEL),host_ed25519_key(made by the copied ssh-keygen at the first on, on the machine, never in the tree),sshd_config(written from the settings at every start and given with-f; noInclude),digests(the SHA-256 of each file sshd runs from, recorded at install) andlog(every change with the pid and program that asked, every start, stop and refusal, and sshd's own lines atLogLevel VERBOSE; root's, cut to its newer half past 64 KiB; logins, starts, stops and refusals go to the kernel's log as well). Every file is read through no link and refused when it is not a regular file of root's with no group or other bits.- The configuration: keys only (
AuthenticationMethods publickey, no password, keyboard-interactive, empty password or host-based login),AllowUsers rootandPermitRootLogin prohibit-passwordonly whilessh root on(elseno),AuthorizedKeysFilethe list above and noAuthorizedKeysCommand, principals or CA; every forwarding off (DisableForwarding, TCP, stream local, agent, X11, tunnel, gateway ports,PermitListen/PermitOpen none),PermitUserEnvironment no,PermitUserRC no;MaxAuthTries 3,LoginGraceTime 20,MaxStartups 3:50:10,PerSourceMaxStartups 2,ClientAliveInterval 30with a count of 3,StrictModes yes; host key ed25519 only; keysssh-ed25519andsk-ssh-ed25519@openssh.comonly; key exchangesntrup761x25519-sha512@openssh.comthen X25519; ciphers AES-GCM alone, which Terrapin's prefix truncation (CVE-2023-48795) does not reach with any client, strict key exchange or not (it reaches ChaCha20-Poly1305 and the encrypt-then-MAC modes). NoUsePAMline: Alpine's sshd has no PAM, and a build that has it is off by default and is held to that. - Only root can log in. The machine's other account (
user, 1000) is the id every program of a bowl runs as at the hardened tier, so a login as it would be every bowl's programs and files and nothing of the machine's (nomoonwaterchange, no/root, no debugger on the compositor): it is not offered. With root off the server answers and lets nobody in.
ssh_view_enter, in a child of the supervisor (moonwater ssh serve, which holds/run/moonwater/ssh.lockfor the server's life): it enters PID 1's mount namespace (whatever namespace the command was typed in), makes one of its own as a slave of it, and mounts a tmpfs there that nothing else sees. Each recorded file is copied from the bowl into it and hashed as it is copied; one whose SHA-256 is not the record's refuses the start whole, by name, so what was checked is what runs and the bowl's files are never executed. The copies are laid over/liband/usr/lib(an overlay: the loader, the libraries andsshd-session/sshd-authat the paths sshd was built with), Moonwater's ownpasswdandgroup(root, and the privilege-separation account 65520) over the machine's, an empty directory over/etc/sshand/var/empty, and the tmpfs is made read-only.sshd -T -fon the file, and every value the settings decide compared with what it says it will use (each once; the addresses exactly the ones named; ausepamline, where the build has one,no): any difference refuses the start and names the keyword.- sshd is executed by its absolute path in the tmpfs with an empty
environment (no
LD_PRELOAD,LD_LIBRARY_PATH,LD_AUDIT, nothing inherited),-D -e -f /root/ssh/sshd_config. - The machine process, every five seconds (
ssh_keep_machine): a timed on that ran out, or one from another boot, is turned off; off is no server (its supervisor is told to end it, and it ends every session first); on is the server started from the settings as they are now (one started from other settings is stopped and started again); everysshd,sshd-sessionorsshd-auththat does not descend from the supervisor, and every process holding a socket that listens on the port and is not the listener, is ended with SIGKILL and said in the log. - There is no firewall in the tree (the kernel profiles have no netfilter): the port is reachable exactly while something listens on it, which is the server alone. Off, a connection to it is refused, and at the tight net tier dropped without an answer (FW-D1).
The TCP port (22 unless set) on every address, or on the one address set: the
SSH transport of OpenSSH 10.3p1 before authentication (the version exchange,
the key exchange with the algorithms above, and public-key authentication for
root against the list), in sshd-session and the unprivileged sshd-auth
(chrooted into the empty /var/empty as 65520), at most 3 unauthenticated
connections before random early drops and 10 in all, 2 from one source, 20
seconds each, 3 tries each, and OpenSSH's own per-source penalties. What stops
them: there is no password of any kind to guess and no account but root; a key
not in the list is refused; nothing is forwarded for anyone, a key in the list
included. What remains: a fault in OpenSSH's pre-authentication code (the class
of regreSSHion, CVE-2024-6387, fixed in 9.8) is reachable by anyone who can
reach the port; updating the bowl's package (apk upgrade) changes the files,
which the server then refuses until bowl profile ssh install records them
again; the limit (60 minutes by default) bounds how long a forgotten on stays
reachable.
| Who | Can |
|---|---|
Root of the machine's user namespace, at a terminal (moonwater ssh ...) |
everything |
| The Settings window (a root program) | everything, through the same verbs |
| A process that is root only in a namespace of its own | nothing: the verbs ask PID 1's user namespace (ssh_machine_root) |
| A program of a bowl at the hardened tier (a real uid 1000) | nothing: /root is not in its view, the state is root's 0600, the lock and the record are root's, and it cannot signal or trace the server |
| A program of a bowl at the default tier | everything a file can do: it is root to the machine's files (BOWL-D1), so it can read the host key and rewrite the settings and the list, as it can rewrite the machine script; these settings hold only against the rest |
| An unprivileged program of the machine, a Wayland or X client, a D-Bus call or portal | nothing of the settings; the session bus has no method that runs moonwater, and no client can write the window table. A uid 1000 program can bind the port while the server is off (above 1024, when the port is set there), and is ended at the next look |
A program with /dev/uinput (root, or a bowl with the input grant, which bowl profile steam gives) |
not turn the server on, let root in or add a key through the Settings window, whose deliberate rows take only a key or a press the compositor read from a device it found physical (WINDOW_EVENT_VIRTUAL, MW-2026-202, ae5dcbec; the window's gate 349adc24); can still type into a root terminal, which takes virtual keys, and so type moonwater ssh on there as it can type anything |
- The rows that are a deliberate act (SSH server on, Root login on, Add a key)
carry
deliberatein the registry, and the Settings window runs one only for a KEY or BUTTON event withoutWINDOW_EVENT_VIRTUAL: the compositor leaves the bit off only for an event it read itself from a device it classified as physical (USB, a built-in keyboard, ACPI and platform buttons, an I2C touchpad, classic Bluetooth through the kernel's driver, a virtual machine's virtio input; a touch screen's taps inherit the touch screen). Virtual, and refused: uinput, uhid (so a Bluetooth LE keyboard cannot confirm), a node it cannot read, the headless pipe, the on-screen keyboard, and anything the Wayland shim injects. The same verbs typed in the window's All commands are refused without a hand too. Turning off, root off and End every session are not gated. Held by four CHECK_terminal rows (the UI's; NOT RUN by this worker). - Not held: the Canvas terminal takes virtual keys, so a program that can make a
uinput keyboard can type
moonwater ssh oninto a root terminal that is open;moonwater ssh on,ssh root onandssh key addat a root terminal are the deliberate path, and are as safe as that terminal. Kernels of the hardened and locked profiles have no uinput. Whether a Bluetooth LE keyboard and the on-screen keyboard being unable to confirm is acceptable is the owner's decision.
- At the default bowl tier nothing here holds against a program of a bowl
(BOWL-D1): the status line and the Settings row say which tier the machine
is, and
sec_bowl_hardenedis the tier at which they hold. - No sftp subsystem: files are moved with the shell. A session's mount namespace is the server's, a slave of the machine's: a mount made inside a session is not seen outside it.
- Ending a session (
ssh end,ssh off,ssh key remove) ends each connection's privileged process, so its terminal hangs up and what it ran is told so as after any disconnection; a program that detached from its terminal goes on. /procis shared: any process of the machine can see that sshd runs and the title of each session's process (who is logged in).
Five profiles in kernel/profile/ choose how the build leans where safety and
the reference disagree, and how hard the kernel under it is:
| Profile | Tools and builtins | MOONWATER_STRICT |
The kernel |
|---|---|---|---|
sec_reference |
all | 0: the reference exactly, holes and all | the baseline |
sec_default |
all | 1: sanitise only what hostile input made dangerous | the baseline |
sec_workstation |
all | 1 | hardened in every region that costs a program nothing it expects: not lockdown, not the 32-bit ABI |
sec_hardened |
all | 2: refuse where the default sanitises | every region hardened |
sec_locked |
a kiosk's allow list | 3: and what init can shut until the next boot | every region locked |
sec_default is in the default profile list, and it is the only tier that
promises bash, dash and GNU behaviour for anything a script does. The others
are choices, and what they refuse is refused on purpose. All of them turn on
Yama, which Floodlight's restricted launches need. To pick one, name it last
after the rest of the default list:
sh build.sh debug_none limbo desktop wifi serial sec_hardenedThe baseline. The kernel is built from allnoconfig, where an option
nobody names is off whatever Kconfig says its default is. Until sec_baseline
existed the shipped kernel had no stack protector, no usercopy bounds check, no
FORTIFY_SOURCE, no slab freelist hardening, no CPU vulnerability mitigations
on x86-64 (CPU_MITIGATIONS is a prompt that allnoconfig turns off, and
every mitigation under it goes with it), no W^X on riscv64 and a null-page
floor of 4 KiB. Every tier composes sec_baseline and its architecture's file
(sec_baseline.x64, .arm, .riscv); it costs close to nothing on the paths
this project measures, and the mitigations are chosen at boot from what the
processor says it is vulnerable to. A profile names its parts with
#> includes NAME... and an architecture's own lines sit in NAME.ARCH
beside it, which is how a region asks for x86's indirect branch tracking
without every other build reporting it dropped.
The regions. A tier is every region at one level; a region is a part of the
hardening that can move alone. Name its profile after the tier to take that one
further (sh build.sh ... sec_default sec_net_locked sec_mem_hardened), or keep
one at a gentler level than the tier around it by composing its profile first.
Each region has a hardened and a locked level, and the locked one is the
hardened one and more, so name one or the other. The files are
sec_<region>_hardened and sec_<region>_locked; sec_exec and sec_build
have only sec_exec_hardened and sec_build_hardened.
| Region | Hardened | Locked adds |
|---|---|---|
sec_mem (kernel) |
heap zeroed on allocation, locals zeroed, caches never merged, typed buckets, shuffled free lists, random stack offset per syscall, checked lists, W+X mappings warned about at boot | zeroed on free and every call-used register cleared at return, partitioned kmalloc caches, corruption and an oops panic (and reboot after 5 s), KFENCE |
sec_cpu (kernel) |
indirect branch tracking, call depth tracking, straight-line speculation barriers, user shadow stacks, TSX off; arm64 memory tagging | mitigations=auto,nosmt nosmt=force pti=on: no second thread of a core on any processor |
sec_surface (kernel) |
no ACPI table or SSDT replacement from userspace, no MSR/cpuid devices, no ioperm/iopl, no vsyscall | no 32-bit or x32 ABI, no LDT, no FUSE, no binfmt_misc, no watch queue, no POSIX message queues, no io_uring or file handle calls |
sec_dma (kernel) |
VT-d, AMD-Vi and SMMU, strict translated DMA, no passthrough, firmware PCI DMA off | no PCI hotplug, USB4, FireWire or PC card |
sec_lockdown (kernel) |
integrity lockdown from boot, signed modules only, Landlock | confidentiality lockdown |
sec_files |
STRICT_FILES 2 and find without -delete or -fprint* |
3 |
sec_text |
STRICT_TEXT 2 |
3 |
sec_net |
STRICT_NET 2 and no wget or fetch; wifi with protected management frames always, and WPA2 only for a network saved with wpa2; time from NTS only and names over DNS over TLS only, unless /root/ntp.nts or /root/dns.tls says otherwise; a public certificate has to be logged (Certificate Transparency); a closed port off loopback is silent, no RST or ICMP unreachable (net.ipv4.moonwater_silent, FW-D1) |
3 |
sec_host |
STRICT_HOST 2: a disk is asked about, kptr_restrict 2, io_uring refused, Yama 2, widest mmap randomisation, USB locked at the first boot (USB-D1) |
3: no module loads, no ptrace attach (Yama 3), hidepid on /proc, the data partition nosuid, /dev/shm noexec, usbcore.authorized_default=2 on the command line |
sec_bowl |
STRICT_BOWL 2 |
3 |
sec_exec |
Floodlight sealed with every command-making switch off | (none) |
sec_build |
the image's own programs built with zeroed locals, probed stack frames, cleared call-used registers and the stack protector (+5.7% on a shell start, inside the noise on a compute loop) | (none) |
The userspace regions are what MOONWATER_STRICT_FILES, _TEXT, _NET, _HOST
and _BOWL set (-1 follows the whole build's level, so a region left alone
changes nothing), and a tool names its region and never the whole level. The
sysctls init writes before it starts anything are the FILES and HOST regions'
(fs.protected_*, kptr_restrict, dmesg_restrict, io_uring_disabled,
randomize_va_space, at the tight level Yama and mmap's randomisation, at
the locked level Yama 3 and modules_disabled); they used to be written by the network
watcher a moment after boot, and not at all where it never started.
/proc and /sys are mounted nosuid,nodev,noexec and /dev
nosuid,noexec by the kernel module, at every tier.
What a tier's image is expected to say once it has booted is a table in
lane_tier (test/run), and MOONWATER_IMAGE=dist/bootx64.efi MOONWATER_TIER=hardened sh test/run tier reads it back from a guest: the
sysctls init wrote, the mount flags, the lockdown line, the W+X page-table
check, the IOMMU's strict mode, /dev/uinput's mode and vm.max_map_count.
sh test/run switches is the composition half (what each tier and region
names, that a region keeps to its own level, and the final value of the game
controller switches and the Canvas define in each image). sh test/run input
boots the desktop image and makes a virtual pad through /dev/uinput, reads
a press back from its joystick node and makes a DRM sync object.
What sec_hardened (STRICT_TIGHT) refuses where the default does what GNU
coreutils does:
| Tool | Default (GNU) | sec_hardened |
|---|---|---|
mkdir, mkfifo, mknod, install, cp |
make an entry in a world-writable directory without the sticky bit | refuse it (Permission denied) |
cp |
writes through a destination that is a link; under POSIXLY_CORRECT makes the file a dangling link names |
replaces the link itself, never touching what it points at, and always refuses a dangling one |
split, csplit, and any output opened for writing (tar -f, wget -O) |
write through an output name that is a link | replace the link with the new file |
chown -R -L, chgrp -R -L |
follow the links met in the tree | follow none below the operand |
cp -r |
makes the new directory where it goes and fills it | builds it in a private stage and publishes it whole |
install |
leaves the copy in place, mode 0600, when the owner asked for is refused | takes the copy away and says it was not published |
pinky -l |
copies each user's ~/.project and ~/.plan to the terminal as they are |
leaves them out |
wget, fetch and every other HTTP client in the tree |
accept a 204 that declares Content-Length or Transfer-Encoding (its body is never read; the connection closes after the one response), read a 205's content like any other body, and take a Content-Length that repeats one number (twice, or 3, 3), a folded line after an ordinary field and any byte but NUL and a bare CR in the reason phrase, as wget and curl do |
refuse a 204 that declares any body framing, a 205 with a non-zero length, chunked or close-delimited content (RFC 9110 15.3.5, 15.3.6, RFC 9112 6.1), a repeated or listed Content-Length, any folded line and a control byte in the reason phrase |
Every row but the HTTP one has a check in floodlight_hardened (test/run),
run against a shell built from kernel/profile/sec_hardened's configuration;
the default half is the differential engine's, against GNU. The HTTP row's
tight half is CHECK_net built with MOONWATER_STRICT 2 (the net-tight
tally of sh test/run net) and the framing harness's second tier; its default
half is held against GNU wget and curl by wget_mutation.
Two differences are not tier choices. kill is util-linux's, not
coreutils' (kill -l takes several names, -s0 is a signal), because
coreutils 9.11 does not build kill by default. install invoked as
ginstall reports itself as install.
Locales are read from the machine, not compiled in. Where /usr/lib/locale
(or its locale-archive) has a locale's files, sort, ls, join, comm,
expr and the shell's globs and [[ a < b ]] order text by that locale's
LC_COLLATE exactly as the C library's strcoll does, sort -n -h -g read the
locale's decimal point and thousands separator, and date, numfmt and friends
read LC_TIME and LC_NUMERIC. The image ships no locale data, so there every
locale is C and orders by byte; the C locale never pays for any of this. uname
answers Moonwater for -o and ends -a at the machine: Moonwater is not GNU
and does not say it is.
To take a single tool or builtin out, add a line to a profile of your own, or use menuconfig:
# CONFIG_MOONWATER_TOOL_WGET is not set
# CONFIG_MOONWATER_BUILTIN_HISTORY is not set./build config-header <profile> <header> shows what a profile turns off, and
./build surface <profile> lists the names it would link.
Run sh test/run <lane> or python3 test/differential.py --harness <name>.
net_dependency_closure, net_math_proof, net_clock_fault, net_wait_states,
net_parser_work_states, net_lease_transitions and security_hygiene start lane_net; a new shared primitive in net.c fails the
closure gate until it is reviewed, and security_hygiene fails when a harness
named here is not registered. Evidence is for one build and environment, not a
certification. MOONWATER_REQUIRE_ARCHES=1 MW_UBSAN=1 sh test/run net makes
ARM64 and RISC-V mandatory with UBSan trapping.
| Area | Evidence | Open |
|---|---|---|
| Bytes, memory | byte_reader cursors (security_hygiene forbids listed parsers from indexing their input); MSG_TRUNC; guard pages (codec, socket, standard); ASan/UBSan fuzz sh test/run fuzz; MSan sh test/run msan; net_math_proof (DHCP masks, AES field and S-box, HKDF counter, netlink widths); net_wait_states (1,613,472 send/read and 4,302,592 writev schedules, 15,360 nested-deadline boundaries, ASan/UBSan) |
tls_parse_cert index reads are guarded by hand and fuzzed; no corpus beyond generated seeds |
| Netlink | sender, port, sequence, alignment, multipart, NETLINK_DISCARD_MAX; netlink_fuzz |
nested attributes beyond the bounded fuzz |
Discovery (src/net/discovery.c) |
moonwater network discovery refresh, link doctor and the network's watcher (at boot, at a lease that is new or moved, when a link comes or goes: net_discovery_soon, apart from the lease) send a STUN binding (RFC 8489) to the first two servers of the list that resolve (stun.cloudflare.com:3478 and stun.l.google.com:19302 unless network discovery stun servers keeps others), and where UDP does not get out fetch the trace at the URL kept (https://cloudflare.com/cdn-cgi/trace unless network discovery https url keeps another); each of those servers learns the machine's public address and that it asked. Each has its switch (`network discovery stun |
https [on |
| DNS | dns_oracle: dns_reply_result against an independent reading (RFC 1035 and the resolver's contract: identity, header, every section framed, compression ceilings and jump budgets, the CNAME chain) over 20,000 replies from a grammar, a fifth damaged, every status reached; exact question, ID, peer; per-query source port, 0x20, EDNS0 with fallbacks; own resolver first; DNS_DISCARD_MAX; dns_fuzz, sh test/run net; a validated TC reply keeps the full query deadline for TCP, while only the UDP EDNS trial is capped at one second; DNS over TLS as a setting (dns_tls: 18 rows of setting, leaf, port, clock and tier against a resolver on 1.1.1.1 and the network's own on 10.0.0.1 in a namespace; the setting and the four resolvers in CHECK_net at both tiers) |
with DNS over TLS off (the default tier's default) an on-path peer can still forge an answer, and with on an attacker who blocks 853 gets the plain query; NTS, SNTP, hostid, logger, waterlink and caIssuers names are always plain |
| DHCPv4 | xid, MAC, server and OFFER-peer binding; option overload, END and zero padding; lease sanity; ARP probes before install, and a DHCPDECLINE (RFC 2131 4.4.1) with a ten-second hold-off for an address another station answers for; watcher cut once per link news, never between a REQUEST and its ACK window's end (DHCP-D3); replies off a packet socket judged as IP and UDP judge them (DHCP-D1): dhcp_frame_fuzz against an independent RFC 791/768 reading and a classic BPF interpreter running the kernel's prefilter, the CBMC proof dhcp_frame, CHECK_net's rows and its loopback socket in namespaces of its own, net_parser_work_states off both sockets; netem scenes at rp_filter 1 and 2, a server that unicasts its replies, and link news after a REQUEST with an ACK 0.6 s late or never (one DHCPRELEASE); the confinement refusing where seccomp answers ENOSYS (DHCP-D2); route ownership and rollback fault matrix (net_lease_transitions); dhcp_fuzz, sh test/run netem net machine |
the DECLINE and the RELEASE are checked as built packets, through their confined child and against the scripted netem server, never against a production server (a server may ignore a RELEASE broadcast from 0.0.0.0); the frame judge's proof is bounded at 32 bytes (40 ran past an hour) and the fuzz is what covers longer frames; the loopback socket check is NOT RUN under qemu-user |
| SNTP, NTS | 64-bit nonce, peer, mode, stratum, timing, exactly 48 bytes at the tight tier; each sample its own wait; sntp_fuzz, sntp_era (2036, 2038, 2104), sh test/run netem machine; NTS (RFC 8915): the AES-SIV-CMAC-256 AEAD against RFC 5297 and OpenSSL (crypto_vectors, 41 vectors on three machines, constant instruction counts and data addresses for six secrets), 904 NTS replies built independently and refused for every changed byte and every cut, the key-establishment parser over 26 shapes and every cut length (CHECK_net), nts_fuzz, and the client against chrony 4.8's NTS server and against servers that are wrong (nts, 92 rows: key establishment counted, torn and linked state, every tampered, cut, replayed, stripped or dropped reply, NTSN, no ALPN, TLS 1.2, a wrong or expired certificate, noise, silence, a private time server, the floor's judgement, only and off, the tight tier's default); the floor and clock.good in tls_chains, tls_dates and moonwater_cli |
nts needs a chronyd built with NTS (MOONWATER_CHRONYD) and is NOT RUN without one; with no NTS server reachable the default tier takes plain NTP between the floor and 2104 (a day once the clock is set, two seconds once synchronised) |
| HTTP, URL | localhost and *.localhost reach 127.0.0.1 without a resolver (RFC 6761; wget_hostile with a stub resolver, curl held to the same rows); host spellings named against GNU wget and curl; the scheme rule at both tiers (http_urls); sink-side validation of host, target, headers; userinfo, schemes, fragments refused; one framing reading; redirect and HTTPS-downgrade bounds; body deadline; per-hop host, address, SNI and Host identity; http_response_framing (with http.client and curl), wget_mutation and wget_hostile (GNU wget and curl as live oracles), https_downgrade, http_fuzz |
the first address a name resolves to is the one connected to (no multi-address fallback, which neither identity nor the tight tier's rebinding rule would survive unexamined); interface scope is not a part of an address here |
| TLS, X.509 | transcript, Finished, AEAD, record sequence, state ordering; strict DER; CertificateEntry extensions refused but a staple the hello asked for; delivery schedules and FIN/RST cuts (tls_peer --schedule); SAN and name constraints, key usage, EKU, dates; chains against OpenSSL and Go crypto/x509; record nonce coverage over every value in every sequence byte lane and guarded unaligned buffers; record-header coverage over every 16-bit length and 8-bit type; tls_chains (also wget's status and words for each refusal), tls_hostnames, tls_dates, public_suffixes, anchors, tls_peer, tls_der_fuzz, tls_hs_fuzz, tls_verify_fuzz; x509_corpus by hand over 643 hosts |
name constraints in more shapes |
| Revocation | tls_chains serves CRLs made by openssl ca -gencrl (listing the leaf or not, partitioned by issuingDistributionPoint, another partition, CA-only, past nextUpdate, another key under the issuer's name, absent, PEM, an unknown critical extension, a delta, an RSA issuer, an intermediate and the first CA revoked) and holds wget to openssl verify -crl_check / -crl_check_all, at the default tier and again at the tight one, words and status included; tls_peer staples openssl ocsp responses (good, revoked, unknown, stale, no nextUpdate, another certificate's, a broken signature, a delegated responder with and without id-kp-OCSPSigning, tryLater, must-staple) over scripted TLS 1.3 and 1.2 flights at both tiers against openssl ocsp -respin, the wire shapes a staple may not take, and openssl s_server -status_file over both versions; CHECK_net (signed fixtures, the tiers at both MOONWATER_STRICT builds, the five-minute skew to the second, the TLS 1.2 relay, the ClientHello and ServerHello extension, every ceiling exact and one over); tls_ocsp_fuzz, tls_crl_fuzz; net_bounded_proof and net_exhaustive_proof below |
the CRL cache lives for one process, so each wget run fetches again; a CRL over TLS_CRL_MAX is no answer |
| Certificate Transparency | tls_ct: 23 leaves under the harness's own six logs (five operators, one retired a month ago, one whose interval holds no leaf here) against a model of RFC 6962 and Chrome's policy -- two operators, one log not retired, two or three SCTs by lifetime (90, 180, 400 days), a broken signature, an hour ahead, an unknown log, retired before and after its SCT, the interval, version 2, SHA-384, the list between two extensions, a TBS whose DER length shrinks without its list, another issuer's key, a byte after the list, no list, SCT extensions signed, sixteen broken before two good -- with the harness's precertificate held to cryptography's first; end to end through wget at the tight tier (logged, and refused in its words with status 5) and the default (either taken); CHECK_net on 1.1.1.1's real leaf (three SCTs from DigiCert, Sectigo and Google logs; one broken is too few for 355 days; another issuer's key holds none) and every log id the SHA-256 of its key; ct_logs regenerates the table byte for byte from the list its header names; live at the tight tier against Google, Cloudflare, Let's Encrypt, DigiCert, Sectigo, Amazon, Apple, GitHub, Wikipedia, gov.uk and bund.de, and DNS over TLS to 1.1.1.1, by hand |
SCTs delivered in TLS or a staple are not read; the log table is a snapshot of Chrome's list |
| Confinement | CHECK_net on all three machines: net_apart_filter_decisions runs the built filter in a classic-BPF interpreter over the calls a fetch makes and the ones it must not (another architecture, x32, unix, netlink, packet, IPv6 and raw sockets, a named protocol, options fetching never sets, executable memory, openat, execve, ptrace, mprotect, ioctl, kill, prctl, read); natively, net_apart_confinement (the child keeps its pipe, output and standard error and nothing else, every call fetching needs works, and openat, execve, ptrace, the five refused socket kinds, executable memory, mprotect and ioctl each die of SIGSYS after it answered) and net_apart_fetching (fetch's and wget's manners through the child against a loopback server that reads Seccomp: 2 and NoNewPrivs: 1 off the waiting child; a planted openat after a working fetch dies; a 12 MiB body grows its store inside the filter; the resolver answers from the servers read before the filter); under qemu-user the refusal is checked, and the deaths are checked on arm64 and riscv64 themselves by guest_confinement (the boot lane with MOONWATER_IMAGE=dist/bootaa64.efi or bootriscv64.efi: CHECK_net's three confinement groups and CHECK_bowl, the Wi-Fi station's confinement with it, run as root in the machine's own guest, 114 and 1,480 checks with no failure on both); security_hygiene fails any call into http_run, http_spider, http_link_open, http_stream_open, tls_connect, tls_connect_until, tls_plain_get, tls_aia_fetch, tls_crl_fetch, nts_ke, dns_query_tls, dns_resolve_wanted or locale_auto_ask outside a task handed to net_apart, a task called directly, and a filter install that takes anything but success; wget_mutation, wget_hostile (its address rows under unshare -Urnm), tls_peer, https_downgrade and the misc lane's wget and fetch rows run through it |
the drop to nobody as root is seen by hand (perf trace), not by a lane; the child may connect to any IPv4 address its user can reach, so the tight tier's private-address rule and caIssuers' public-only rule hold only while the child is not compromised |
| Crypto | OpenSSL vectors and every lib.c architecture body: crypto_vectors (--wycheproof DIR by hand; AES-SIV-CMAC-256 against RFC 5297's own bytes), crypto_fuzz |
none known |
| Wi-Fi | RSN, EAPOL-Key, replay counters, source address, scan parsing; all four GTK slots and both IGTK slots, zero-valued first keys, driver refusal/retry and roam reset, message 3's elements held to the beacon's (wifi_key_state); the strongest 64 names kept and the associated row never evicted; one BSS donates every field of a row; the RSN offer of both frames against a model, a twin offering less ranked last (wifi_scan_fuzz); PSK, PSK-SHA256 with protection and SAE key frames (HMAC-SHA1 and AES-CMAC MICs, descriptor versions 2, 3 and 0, IGTK KDEs, elements bent or stripped in message 3) under wifi_eapol_fuzz; the SAE exchange's frame reader, state and bounds and the budget against a model (wifi_sae_fuzz); SAE (hunt and hash-to-element), the KDF PTK and CMAC against a Python reference and RFC 4493 (CHECK_waterlink_service); wifi_join_plan at every tier over every offer, rule and secret (CHECK_bowl, again in its tight build); wifi_air (hwsim: the pmf and sae families, spoofed deauthentication, hostapd 2.11 with each password element method and a token, every family through the confined station); the station's filter in a classic-BPF interpreter over 48 calls and its confinement natively in a user namespace of its own (its sockets come back, openat, an IPv4 or raw packet socket, execve, ptrace and prctl die of SIGSYS) and refused under qemu-user (CHECK_bowl on three machines and its tight build); security_hygiene holds the join and the keeper to the station, the station to its broker and the broker to a join apart |
a forger outranking every retained row; a second physical chipset; the first join of a network is trust on first use |
| Waterlink | Noise handshake, cookie, replay window, grants, revocation; mDNS reads Internet class only, RCODE zero, TTL nonzero, an SRV with a non-root target and a nonzero port, exposes only a PTR and SRV intersection, and shares a packet-sized compression-pointer budget across every name; the reply and answer budgets move only after a successful send; IP_MULTICAST_IF failure refuses the send; a source holds at most LINK_GREET_SOURCE of the 16 greeting slots; legacy verifier migration is all-write plus fsync, and until it succeeds the listener stays off while commands keep the groups (their save is the scrub); every elapsed time is ordered first; waterlink_fuzz rejects a wake/fill cycle that remains immediately due without output; sh test/run waterlink link, waterlink_sanitized, waterlink_fuzz (MSan with MOONWATER_MSAN=1); mDNS read in a confined reader: its filter in the classic-BPF interpreter, what the listener believes of a reading (every count at its room, one over refused), and an announcement and noise read apart against the reading made in place (CHECK_waterlink_service, natively in its user namespace) |
handshake flood under netem; address rotation reaches the global greeting ceiling |
| Saved state | wifi and bluetooth lists and the wifi rules written beside themselves and renamed, opened nonblocking, regular files only, the rules 0600 and kept to the saved networks; no hash of a group secret on disk; sh test/run cli link |
|
| Secrets, boot choice | history_secret_line rows including what the denylist does not see (CHECK_bowl); link group NAME - and wifi add at a terminal (moonwater_cli, link); the tight tier's refusal of both argument forms (CHECK_bowl again at MOONWATER_STRICT 2); host_link_external, host_disk_external failing closed and host_lone_taken (CHECK_bowl); a fixed NVMe install still taken and another build still asked about (install lane) |
a USB install in a guest (found only when it enumerates before the census, racy in QEMU); the removable files of a real PCI port need hardware |
| USB devices (USB-D1) | moonwater_cli over a sysfs of files: what lock keeps (classes, places, a long serial's hash, nothing fixed, a device behind an unfixed hub not fixed), a held device configured and kept as its classes, held, allow, deny, ambiguity, class, a known stick grown a keyboard held, an old -@PORT pin read and rewritten, places across renumbered buses, a no-serial clone of a hashed serial held, a lock that cannot be written, or a policy that cannot be read and is not written over, in force from /run, a bounded wait for a held lock, a failing default logged, unlock with the deny kept, the file's grammar and its 64-rule cap, the watcher alone and ending, hostile product and serial spelled with no control byte anywhere (cli lane); the usb lane against a booted kernel with QMP hot-plug: a stick held with no SCSI host or disk, a keyboard with no input device, allow PORT, class storage, the deny across unlock and again at a replug, hostile serials, the policy read at a second boot from an install (33 rows, 23 red on an image without it), and with MOONWATER_USB_TIER a sec_host_locked image's first boot: every device held from the start, the lock taken once USB has settled keeping the tablet and the keyboard as hid, a later stick held, then an install of the tier booted not from its disk so that it asks, the disk (left with no policy) taken after the session's lock and locked, usb saying lock with the watcher running and the kernel at 0 0 0 (13 rows; 46 of 46 on images built with 4db51897, 42 of 46 on images from before this review's fixes: the long serial's hash, the hid rules and two of the ask rows) |
a real port's removable and ACPI's hard-wired ports (QEMU says unknown for every port, so what authorized_default=2 admits as internal and the fixed exemption are not proved in a guest); hostile descriptors (fuzzed apart); the boot window without the command line word; Thunderbolt and other buses |
| Terminal, JSON reader | term_fuzz (grid, write cuts, resizes, keys, pointer between writes; the cursor stays on the grid; it fails on a planted clamp bug) and bowl_json_fuzz, ASan/UBSan, smoke in term and bowl |
KERNEL_MODE emulator build, MSan |
| Updates from a stick (OUT-D5) | CHECK_storage_format on three machines, on a system partition that is a directory: the judge (this machine's image taken and its build read; another machine's, a PE32, a console program, no optional header, no PE header, one cut short of its sections, a header shorter than a page, no build named, a FIFO: each refused for what it is, and an update from it changes no byte of the partition); the order of builds (a later link, the same build, a count within one second, two zones of the table, words that say no moment); the stick's file (the loader of a --usb stick, the update file of a plain FAT stick, the update file first, nothing, another machine's); which stick an update takes (held, refused, the disk's own build, two at once); the sum beside it (none, its own, another, words that are none); an update and a rollback whole (the build, the one kept byte for byte, the settings a generation on, nothing staged, a second rollback undoing the first, none kept, one kept for another machine); an update and a rollback over a loader that cannot be read (written all the same, previous.efi left as it was); a rollback stopped by its last rename after its switch (the build replaced kept in previous.new, and said); and both cut after every step and inside each copy, the loader whole and the old build or the new as the switch says, the next write ending as an uncut one; moonwater_cli: a stick the kernel holds and one the policy denies said to be held and not read, one let in looked at, the words of update usb and rollback; moonwater_setup (cli lane): update usb and rollback lifted out of host.c write the disk the question was about, and not one swapped in under its names and numbers while the answer waits, between the look after it and the mount, or with yes said |
the install lane's guest scene (boot the install, plug a stick with a newer build, update, reboot into it with the data kept) and its power cuts on these steps were not run where this was written: no image could be built there; FAT's own rename across a cut is the guest's to prove, a directory here is not FAT; no signature |
| Shell, OS boundary | generated Bash and Dash differential; private edit files; edit draws a file's controls, DEL and invalid UTF-8 as ? and drops C1 controls spelled in UTF-8, in rows and status line (edit lane, hostile); PTY setup; tar pinned parents; hostile environment and privilege matrices; pathname_race; effect-based coreutils (sh test/run shell builtins files tar) |
|
| Faults, resources | seccomp entropy failure; partial I/O, EINTR, ENOSPC, deadline and clock-jump faults; TLS 1.2/1.3 handshake writes and KeyUpdate replies share the operation deadline, including buffered writev batching; deferred read budgets are clamped to the enclosing body deadline; buffered payload cannot escape that body deadline; ordinary HTTP/TLS writes use one bounded nonblocking slow path, and queued whole writes need no clock or poll; interrupted output writev resumes its spans under one absolute retry budget, without a clock on uninterrupted writes; fatal TLS protocol errors spend both keys and cannot publish later buffered data (unexpected record types swept over both versions and sequence boundaries); descriptor and mmap exhaustion; once-armed memory_reserve, writev and socket faults mid-path; namespaces with netem (sh test/run netem) |
SNTP allocation faults; a writev syscall that itself blocks on a disk or pipe is outside the interruption budget |
| Kernel (ring 0) | core_state, pane_pages, shared_page, console_queue, term_streams (kit lane); ring0_hostile on KASAN, UBSAN, lockdep or KCSAN images (MOONWATER_IMAGE=dist/bootx64.efi sh test/run ring0); image defaults for redirects, router advertisements, RFC 1337, SYN cookies, rp_filter and the ARP settings (sh test/run boot, net_sysctl) |
the rp_filter and ARP row of the boot lane has not run on an image yet |
| Silent closed port (FW-D1) | mw_net_silent_gate (kernel/kernel.c) held to its rule in C on x86_64, arm64 and riscv64, over random device flags, a NULL device and seven switch values with the device unmapped while the switch is off (kernel_ports, kit lane); the watcher writing the switch 1 at STRICT_NET 2 and 3 and leaving it at the default, over a scratch /proc/sys and with the file absent (net_sysctl); two guests on a private link, a closed TCP and UDP port refused and the RST and unreachable counters moving at 0, dropped with no counter at 1 while loopback (v4 and v6), the target's own address and an open listener still answer, back at 0, IPv6 over link-local, a tight tier booting at 1 (sh test/run firewall, 29 rows, 11 red on an image without the guard edits) |
the flood A/B measures the gate's CPU saving, not a line-rate generator or a distributed flood; the tight-tier boot row is NOT RUN without MOONWATER_NET_TIER; the open-port, forwarded-traffic and other-ICMP paths are not driven for CPU; arm64 and riscv64 are held by the qemu-user differential and both assemblers, not by a boot; the timing of a dropped reset is a side channel this does not close |
| Supply chain | bowl bootstraps pinned by digest or signing key, refusal on any mismatch; a download held to a kernel size ceiling (2 x the measured size + 64 MiB, RLIMIT_FSIZE); the signature reader under bowl_sig_fuzz; sh test/run bowl |
Revocation by hand, 2026-10-09: wget at both tiers, with the shipped anchors,
against 30 public hosts across Let's Encrypt, Google Trust Services, DigiCert
(Global G2 and G3, EV), Sectigo, GlobalSign, Amazon, Microsoft, Apple,
SSL.com, HydrantID and Thawte, 22 of them stapling: no TLS refusal at either
tier (the tight tier first refused bing.com and learn.microsoft.com, whose
first CRL mirror answers 403; mirrors are now tried in turn). Over the 642
live chains of x509_corpus the 1,872 certificates parse the same before and
after (1,854 parse; 1,708 name an http: CRL; none asks for a staple). Cost,
median of seven interleaved runs, parent tree against this one: +17 ms for a
stapled DigiCert G2 host, +49 ms for a Let's Encrypt leaf (a 61 KB CRL),
+66 ms for Netflix (125 KB), +111 ms for SSL.com (1.4 MB); on loopback a
leaf's CRL adds 0.35 ms of wall and 0.15 ms of CPU to a 0.75 ms fetch, three
CRLs 0.82 ms and 0.40 ms, and a stapled answer 0.11 ms and 0.10 ms.
SYN flood by hand: two taps in a namespace, a guest and a listener that accepts
and closes, 20,000 random-source SYNs a second for 14 s while a second address
connects every quarter second; toggle net.ipv4.tcp_syncookies. With cookies
48 of 48 answered, without 0 of 6 (use a host the kernel has not seen succeed).
net_wait_states exhausts five-event schedules over seven I/O outcomes,
four poll outcomes, four monotonic-clock behaviors and six span lengths.
It checks byte progress, nonblocking calls, expired budgets, bounded retries
and a clock-free complete-write path against production wait.c. A model
clock advances at each observation (or fails or jumps backwards); this does
not prove fairness of the kernel, hardware clocks or blocking output sinks.
The same gate lifts production http_write_spans and exhausts five-event
I/O scripts across four clock behaviors and 64 three-span partitions,
including zero-length spans. Nested relative/absolute deadline tests compare
expiry with 128-bit arithmetic at zero, adjacent, saturation and wrap edges,
including an aliased destination and enclosing deadline. These boundary
cases do not enumerate the entire 64-bit arithmetic domain.
net_math_proof separately merges equivalent bit prefixes with their exact
multiplicities over all 2^256 assignments of four 64-bit words. Under the
elapsed-time and clamp guards, the chosen inner expiry cannot exceed the
enclosing expiry; sums are compared at 65 bits, including their carry.
This proves that arithmetic lemma and checks its production guards, not C
memory safety, compiler correctness or operating-system scheduling.
Crypto stack-residue probes clear and snapshot the sampled region in assembly
on all three architectures, with planted-spill and clean-call controls,
rather than reading uninitialized C arrays.
The transport stubs in protocol fuzzers check wire shape, while the native
socket fault tests check actual deadline propagation through TLS and HTTP.
net_parser_work_states lifts production dhcp_receive, dhcp_complete,
peer matching and the shared discard helper. It checks 2,129,920 five-event
schedules over eight packet/transport outcomes and all 65 work boundaries,
repeating the final event to include persistent junk, read off the client
socket and again off the packet socket (4,259,840 in all), where the refused
reply is a whole ACK sent to another station's address. Completion and receive
are compared with an independent straight-line oracle; no more than 65
datagrams are consumed to discard 64 and consider the next one. Native UDP
tests sweep every split of syntax/identity and lease-state junk at exactly
64 and 65 rejections, in both orders and renewal/rebinding states. These
regressions fail before the shared allowance: returning a parsed but unusable
packet used to reset the receive loop's local limit, allowing 4,225 packets
in the worst case. Clock deadlines still bound elapsed time independently.
The model abstracts packet parsing and lease policy; it does not prove those
policies or kernel behavior. DNS tests sweep all 127 allowed pointer depths
and work/size-boundary neighbors in all three record sections. Repeated legal
pointer chains cannot multiply decompression work across records and CNAME
passes. The allowance intentionally refuses some otherwise-valid responses
with excessive compression; it does not limit resolver traffic system-wide.
On the native x86-64 hosted parser lift (seven alternating repetitions), the
160-owner/127-jump fixture fell from a median 179.1 us to 73.2 us per parse.
A tiny compressed A reply rose from 50.7 ns to 65.9 ns; this is direct parser
cost below socket/DNS latency, but it is a measured hot-path cost rather than
a free bound. These figures are comparative host measurements, not portable
hardware guarantees.
BENCH_net_hot also keeps the per-record TLS wire operations visible. On the
native x86-64 host, nine interleaved runs reduced the nonce median from 12.69
to 3.26 CPU ticks by using the existing unaligned and network-order word
helpers. Eleven later interleaved runs reduced the record-header median from
3.73 to 1.09 ticks by keeping the byte swap and unaligned word store inline on
x86-64 and AArch64. The RV64 IMAFD floor keeps lib.c's bytewise assembly
store because GCC otherwise emits the unavailable __bswapsi2 runtime helper.
The production primitive checks pass on all three architectures and exhaust
each sequence byte lane and every 16-bit record length. Tick measurements are
comparative results from this x86-64 host; QEMU runs establish behavior, not
hardware latency.
Socket-fixture setup failures now stop their case, and diagnostic netlink
drains and chunk-output reads are nonblocking. A denied local send therefore
fails a check instead of leaving the security lane asleep on a byte that can
never arrive.
sh test/run proof (named only) holds proofs, not samples.
net_exhaustive_proof compares production predicates with specifications
written from the RFCs and the stated policy on every input of their domains:
http_address_public on all 2^32 addresses; dhcp_mask_valid,
dhcp_prefix_of and dhcp_address_unicast on all 2^32 values;
dhcp_prefix_clear on every address under every prefix length and the omitted
mask (141,733,920,768 cases); tls_asn1_length on every four-byte head at every
truncation; tls_oid_content_der up to four bytes; http_dot_segment up to four
bytes, and up to nine over the bytes it tells apart; the default lease timers
for every lifetime; dhcp_walk against an RFC 2132/3396 walker for every
region of up to ten bytes over the bytes it tells apart, under ASan;
tls_der_integer and tls_der_named_bits on every content of up to four bytes
against X.690's INTEGER and named-bit-list rules (4,311,810,305 cases); and
tls_date_seconds and tls_revocation_fresh on every day from 1950 through
2399 at four times of day against days counted one by one. Each
reports how many inputs were accepted and fails if either answer never occurs.
net_bounded_proof has CBMC prove memory safety, no pointer or signed
overflow, termination by unwinding assertion and a stated property for every
input up to a bound: byte_reader for buffers of any length and byte_store
for any append (every parser reads and writes through these), dns_copy_name
(7 bytes), the ASN.1 helpers (8), netlink attribute finding (24),
http_header_end with http_response_fields (10), the chunk-size and trailer
lines (10), http_split_into (10), http_path_simplify (8: no dot segment
is left and a second pass changes nothing), the DHCP frame judge (dhcp_frame:
dhcp_unframe agrees with RFC 791 and 768 read by index on the verdict, the
addresses, the port and the message's place for every frame of up to 32
bytes, and dhcp_frame_control: dhcp_frame_vouched agrees with cmsg(3)
over every control buffer of up to 48; dhcp_frame_filter: every frame of up to 68 bytes, so every
header length, that the judge accepts with its UDP checksum vouched for -- the
most it accepts -- is kept by the kernel's prefilter, run as classic BPF from
its own bytes), and the revocation parsers' small pieces: the DER cursor
tls_der_value with tls_der_integer and tls_der_named_bits (8: a value
inside its reader past its header, the reader resuming after it, DER's one
spelling), tls_entry_status (20: a staple only when asked, alone, inside the
extensions), the TLS Feature parser (12: must-staple only with an INTEGER 5 in
it), authorityKeyIdentifier (12: the key inside, no issuer without its
serial) and issuingDistributionPoint (12: at most one of the three
only-flags, names inside and never relative). tls_constraints and
tls_key_usage hold basicConstraints (15 bytes) and keyUsage (6) equal to an
independent RFC 5280 reading. Every proof is run again with its
outcome marked, so an outcome no input reaches fails as vacuous. The lib.c
routines the parsers call stand in as the contracts written in the harness.
Not proved: the X.509 parser and chain builder as a whole, the whole OCSP
response and CRL parsers (fuzzed, tls_ocsp_fuzz and tls_crl_fuzz), the TLS
handshake state machine, http_run, DNS answer selection and the DHCP client's
reader beyond its frame judge and option walk; those rest on fuzzing,
differential oracles and the mutation lane.
Exact-limit and one-over rows live in CHECK_net (test/checks.c, with the
ledger at the top of its section).
| Parser | Ceiling |
|---|---|
| DNS | message DNS_MAX_MESSAGE; label 63, name 255; DNS_CNAME_HOPS 16; DNS_WORK_POINTERS 4,096 compression jumps per framing section and across answer-selection passes, at most 16,384 per reply; DNS_DISCARD_MAX 64; DNS_SERVERS_MAX 3 |
| DHCP | NETWORK_DISCARD_MAX 64 rejected datagrams per OFFER or ACK phase, shared across packet syntax/peer and lease-state rejection, and off the packet socket across frames refused for their kind, their IP or UDP headers or their destination; DHCP_FRAME_ROOM 1,536 bytes a frame and caller room for its message; NET_DHCP_ACK_GRACE_SECONDS 2 past link news or the budget for a REQUEST in its ACK window, once per exchange |
| Netlink | NETLINK_DISCARD_MAX 64 unrelated datagrams per transaction; 16 MiB datagram |
| SNTP | SNTP_DISCARD_MAX 64 non-terminal receives per exchange, an NTS reply that does not authenticate counted among them |
| NTS | NTS_KE_ROOM 4,096 bytes of key-establishment reply in NTS_KE_SECONDS (6 s for connection, handshake and reply); NTS_COOKIES 8 of at most NTS_COOKIE_MAX 256 bytes, a longer cookie passed over; NTS_SERVER_MAX 64 bytes of name; NTS_PACKET_ROOM 1,280 bytes a packet; four key-establishment servers a walk |
| DNS over TLS | DNS_MAX_MESSAGE a reply; DNS_TLS_SECONDS 2 s for every TLS try before the UDP fallback (on), the lookup's own 3 s with only |
| TLS | TLS_RECORD_MAX, TLS_HS_MAX, 64 extensions, 8 certificates |
| Revocation | TLS_OCSP_MAX 16,384 bytes a staple, TLS_OCSP_RESPONSES 16 SingleResponses, TLS_OCSP_CERTS 4 certificates a response; TLS_LIST_EXTENSIONS 16 extensions a CRL, CRL entry, response or single response; TLS_CRL_ENTRIES 524,288 revoked certificates a CRL (1.7 times the 311,758 of the largest public CRL seen, DigiCert Global G2 TLS RSA SHA256 2020 CA1 at 11.7 MB on 2026-10-09; Let's Encrypt's shards are a few hundred bytes); TLS_CRL_MAX 16 MiB a CRL, which is also all three DER length octets can say; TLS_REVOCATION_SECONDS 10 for every fetch of one handshake together, inside the handshake's 30 (each name lookup its own 3); TLS_CRL_POINTS 4 URIs tried a distribution point; TLS_CRL_HELD 8 CRLs and TLS_CRL_HELD_BYTES 32 MiB held per process, least recently used out first; TLS_CRL_RETRY 300 s before a failed fetch is tried again; TLS_REVOCATION_SKEW 300 s either way of thisUpdate and nextUpdate; 16 names a side compared between a distribution point and an issuingDistributionPoint |
| HTTP | HTTP_URL_MAX, HTTP_HEAD_MAX, HTTP_FETCH_MAX (16 MiB in memory), HTTP_HOPS, HTTP_WRITE_SPANS; HTTP_BODY_SECONDS (300 s) bounds a stored body in every tier and a streamed one at the tight tier, where the default keeps GNU wget's idle timer alone |
| Waterlink | 8 instances a packet; at most the packet's byte length in shared mDNS compression-pointer jumps; LINK_GREET_SOURCE 8 of 16 greeting slots; one reply and one answer an interval |
| Wi-Fi | SAE, cheap input to dear crypto: one peer commit taken in (two scalar multiplications) an exchange, after checks that cost nothing; one token round, WIFI_SAE_TOKEN_MOST 64 bytes; WIFI_SAE_FRAMES_MOST 64 authentication events read, WIFI_SAE_SECONDS 10 s; WIFI_SAE_PEER_MOST 6 exchanges with one access point and WIFI_SAE_ALL_MOST 24 with all in any WIFI_SAE_WINDOW_MS 60 s, by the boot clock in /run/moonwater/wifi.sae, one over refused before the work; 40 to WIFI_SAE_PASSES_MOST 255 hunting passes. EAPOL: a 512-byte frame, CRYPTO_WRAP_MOST of key data. Scan: RADIO_AIR_MOST 64 names; RADIO_AVOID_MOST 64 access points given up on, an hour each. RADIO_RULES_ROOM 4,096 bytes of rules, three a saved network |
Every externally reachable parser adds: empty, shortest, exact-limit and
one-over objects; truncation at every byte; every tag including unknown;
integer widths and overflow; duplicate, reordered, conflicting and trailing
fields; every stream split and partial I/O; a fixed ceiling and a test that
reaches it; identity mutations for every field that authorizes a reply; faults
for allocation, randomness, time and I/O; a differential oracle or a stated
reason for none; reads through byte_reader, with its name in reader_only in
security_hygiene; and a hosted lift that takes the cursor with
byte_reader_source().
A security fix is complete when it records the attacker position and the violated invariant, the reachable path and concrete input, the consequence, the smallest fix at the shared boundary, and the residual position it does not stop; has a family-level regression with valid neighbors that fails on the vulnerable code (a mutant or the parent tree); and states its resource ceiling and portability. A differential oracle can share the mistake, so name the deliberate disagreements. A red lane is an open gap even when the fault is in its oracle.
MOONWATER_FUZZ_REPORT=artifacts/fuzz-report.txt sh test/run fuzz writes the
compiler and sanitizer versions, seed counts, budgets and exits (overall_exit
2 means NOT RUN: still attach it). Defaults match the lane smoke (20,000 runs,
5 s); MOONWATER_FUZZ_SECONDS and MOONWATER_FUZZ_RUNS lengthen it. Seeds
come from tls_fuzz_seeds, dns_fuzz_seeds and netlink_fuzz_seeds and are
written per run, never kept in the tree. Attach sh test/run msan and the
architecture gate above.
- Closed, unmerged work: wget and curl parity of defaults (#22). Its
branch is gone; the pull request keeps its head (
git fetch origin pull/22/head). The clock floor (#17), NTS (#18) and DNS over TLS (#20) are in the tree; WPA3 and 802.11w (#19) are in, rewritten on this tree (WIFI-D1 to D6). #21's packet socket, REQUEST-to-ACK hold, announcements andrp_filterare in (DHCP-D1 to D3); its conflict probe inside the child was not taken, the watcher's own probe and per-link DECLINE hold-off were there first. - Wi-Fi: a network at 6 GHz alone is not scanned for by a join (its
channels are listened to, which outlasts the scan's five seconds); WPA3's
password identifiers, groups other than 19, SAE-PK, AKM 24 and 25 and FT are
not built. The first join of a network is trust on first use (WIFI-D4), and
a WPA2/WPA3 network never joined with WPA3 can be pushed to WPA2 at the
default tier by an attacker who stops the exchange (a refusal or
deauthentication forged before the confirm), unless its access point says
Transition Disable for WPA3-Personal in an authenticated message 3, which
is then kept as WPA3 joined with (
/root/wifi.rules). EAPOL message 1 is unauthenticated by design; a roam the driver made on its own has no elements to hold the next message 3 to. SAE's commits are unauthenticated before the confirm, so a forger in range can make an exchange fail (the budget bounds what that costs, not that it happens). hwsim has no firmware and no real rekeys; a second physical chipset is unproved. The SAE budget's file being unwritable leaves exchanges counted per exchange only. - Time and names: at the default tier, with no NTS server reachable, plain
SNTP is believed between the clock's floor and 2104 (a day's step once the
clock is set, two seconds once synchronised) and a forged step is undone by
the next NTS answer;
clock.goodlags the truth by the time the machine was switched off; DNS over TLS is off, so names are as forgeable as the network is; the NTS-KE certificate of the first exchange of a boot is judged as of the floor, so a stolen key whose certificate expired after the floor can answer it; NTS's and SNTP's own names, and a caIssuers location, are asked in plain. - No change planned: a response cut inside its status line or a header fails in both tiers (GNU wget and curl disagree with each other there); an endless close-delimited body at the default tier can fill the disk; the radio lock is held across a whole join; the elements a scan reads are unauthenticated, so the join orders by what the saved network asks for and has taught it, and the handshake's message 3 authenticates the elements the choice was made from.
- Parsing still in the asking process: every client that asks a server
-- the HTTP/TLS clients,
host, the NTS key establishment, every time query, and the name lookups of hostid, logger, a Waterlink service and NTS's time server -- runs apart (Decisions), and DHCP has its own confined child, and so do the Wi-Fi station (WIFI-D7) and the Waterlink listener's mDNS reader. What still reads bytes from the wire where it lives: Waterlink's datagrams, in its listener, and netlink from the kernel. A datagram is held to the keyed MAC of the listener's own public key (waterlink_gate_passes) before any of it is read, a handshake message is of one fixed size and layout, and what a linked machine sends after the handshake is the word of a machine that may run commands as root here by design (waterlink_pre_fuzz,waterlink_fuzz,waterlink_noise); netlink comes from the kernel (netlink_fuzz). Neither is a confined parser. - Found by the audit of 2026-11-12 and left as they are (each is a
decision, not an oversight; the fixes of that day are MW-2026-185 to 193):
- A greeting is bound to no destination. A group's first message names nobody it is for (the header is not in the transcript), so any host on the link can make a member greet it (an announcement does) and send that greeting on to another member, which then records the first member at the sender's address and dials it there; four such evict the member's real places. Binding the destination's address into the psk transcript is a change of the wire, and old and new builds would not open each other's greetings.
- An announcement's source is not held to the receiving interface's subnet, so a spoofed source draws a 1,200-byte greeting a group to an off-link address (the ring bounds it at 16 in 10 seconds).
- One group can fill all 64 places of the machines file with invented keys; a ceiling per group is a limit on how large a group may be.
- The mDNS pointer budget is overstated. A PTR or SRV whose data is a malformed name is passed over without its jumps being charged: a 1,490-byte packet followed 10,964 where the ceiling says its byte length. Refusing the packet changes what the two models of the reader accept.
- A pairing code is thirty bits with the waiting machine's name as its only salt, so one recorded greeting is an offline verifier for it, and the work can be done ahead for a known name. What it buys ends when the code is used or runs out.
net_apartwaits on its child with no deadline. An honest child is bound by its own; one taken over holds its caller (the NTP child and its lock,host, a synchronous wget) until it is killed. A ceiling per caller is the fix.- The first NTS key establishment of a boot at the tight tier judges a
staple's or CRL's
thisUpdateagainst the clock's floor and asks three SCTs of a 90-day leaf (its zeroed notBefore reads as a long life), so a machine that was off longer than the answer is old refuses it and stays unsynchronised. - A fetched CRL that never verifies is held for the life of the process
and never fetched again, where one that failed to fetch is retried after
TLS_CRL_RETRY. - A DHCP watcher is served only by a poll that times out, so link news more often than once a second from another interface starves renewal and expiry; and 1,300 junk datagrams to port 68 end an acquisition's schedule with "nobody offered", which the watcher takes as final for the pass.
- The tight tier takes a URL with no scheme as
http://, where this document says it asks for an explicit scheme; and its whole-fetch budget does not cover a hop's lookup, connect or TLS handshake. fetchwrites its failure text to standard output, where the body goes.
- Lanes that had stopped running, found the same day:
waterlink_sanitizedandwire_constants(lift markers and the Mac's socket numbers), the link lane (it asked for netem before anything), CHECK_waterlink_service and the utilities program (the kit's switches inside the tool table; the modem's half of the link), CHECK_net (AUDIO_EAGAIN). All run again. Still red:waterlink_pre_fuzzandwaterlink_fuzz, whose lifts of the listener have drifted past a marker fix (they need the modem's and the keeper's functions stubbed and their sections re-cut); one row of CHECK_net, "fragmented HTTP header search work stays linear", whose byte counter reads zero sincememory_searchbecame a macro in lib.util.c; the hosted fuzz lifts that need a clang newer than 18 (offset_of,__builtin_cpu_supports); and two scenes of the link lane (177 of 181 on a kernel with no netem and no IPv6): "status names the peer, its grants, and where it was heard", written for the status page before it said one state a line, and "the code is taken in capitals", where the typing machine waits out its time in the lane though the same pairing links in under two seconds when run by itself, with or without the wait's own change of 2026-11-12; its cause is not found. CHECK_waterlink_service needs a loopback IPv6 socket and a kernel of 6.10 or later inside a user namespace (the staged publish links an unnamed file by its descriptor). - Update images are not signed (OUT-D5). A build from a stick is taken by
its shape and the build it names, the stick by the device policy, the bytes
by the sum the stick carries; nothing ties an image to whoever builds
Moonwater, so root with a stick can install any image, as
setup installcould. A signing key for builds, its signature checked before the write and an unsigned image refused unless the person says so in words, is what closes it, and there is none yet. Nor has the install lane run on these steps: its power cuts kill a guest part way throughsetup update, whose stepssetup update usbandsetup rollbacknow share, and no image could be built where they were written, so neither that lane nor a guest scene of the update from a stick has run on them. - Evidence: a corpus beyond generated seeds; ASan/UBSan and native namespace runs as required jobs; MSan beyond hosted lifts; a second oracle for DNS; an independent review once those are reproducible.
Hypotheses, not findings. Each needs a seeded transcript, a parent-tree or
mutant red run, valid neighbors, a hard work and memory ceiling, an honest
transaction running at the same time and the layer that enforced the property.
Run only in namespaces, mac80211_hwsim, disposable guests and test
credentials, never against a public network.
- Epochs: lease, resolver, route and interface swaps between OFFER, ACK, renewal and carrier loss with queued prior-transaction replies; interface rename and index reuse; clock jumps and suspend between steps.
- Scheduling: TLS record and redirect-leg delivery torture; datagram queue archaeology; MTU, fragmentation and source or interface swaps at each phase.
- Amplification: cheap input to expensive crypto (key shares, SAE, Waterlink mac1/mac2, OpenPGP MPIs); superlinear parser cost; state-table churn below each limiter; response bytes and CPU per input byte for every unauthenticated listener.
- Identity: one byte string with several identities (URL, DNS, Host, SNI,
SAN, socket); one authorized tuple used by policy, SNI, Host and
connect; CNAME and multi-address fallback; DoT and NTS bootstrap names. - Ambient authority: hostile cwd, umask, descriptors, signals, terminal and limits at start; local races for ports and state endpoints; logs and terminal control sequences as sinks. Checked 2026-10-11 for descriptors: wget with standard input, output and error closed, or error alone, fetches whole (its confined child's answer pipe never lands on a descriptor the child also writes its words to).
- Entropy: clone, restore and fork at each random acquisition; counter and
key rollback; never repair repetition with public values.
Checked 2026-10-11 for fork: every random value the network code uses
-- TLS client random and ECDHE scalars, DNS ids and ports, DHCP and SNTP
transaction tags, NTS identifiers and nonces, SAE and Waterlink
ephemerals -- is a
getrandomcall at the moment of use (system_random_fill,network_transaction_secure); no userspace pool exists to be copied by the forks ofnet_apart, the Wi-Fi station or the mDNS reader, and libc'srandis used by none of them. - Control loops: cycles across DHCP, DNS, TLS, redirects, rekey and Wi-Fi that no per-parser limit bounds; backoff with jitter and a quiet-period recovery bound.
- Isolation: two principals, interfaces or groups with colliding names, addresses and timing; descriptor and source-port reuse.
- Wi-Fi: downgrade matrix, SAE abuse, EAPOL rekey collisions, beacon churn, multi-BSSID, a second physical chipset.
- Persistence: every state path replaced by every object type; kill after
each write,
fsyncand rename; space, inode and descriptor exhaustion; mirror rollback and equivocation. - Kernel and NIC: netlink with concurrent events, padding poisoned before syscalls, offload (GRO, GSO, checksum), UDP checksum rules, IPv6 extension chains; two kernels, two NIC families.
- Secrets: secret-lifetime map, zeroization under LTO on every architecture, timing and cache oracles with predeclared thresholds.
- Split worlds: middlebox, resolver and origin reading HTTP, DNS and TLS differently; every optional upgrade failing after partial success; version skew of saved state.
- Recovery: convergence after the attack stops without a reboot, and no forgotten authenticated revocation.