Saltybox PR wording comparison

GPT-6.2 Sol · High

Claude Opus · High

Gemini 4 Neon · High

docs: tag the release PR's merge commit

If another PR lands before the release tag is created, tagging the tip of main can ship changes outside the release PR and its changelog. Using the release PR's recorded squash merge commit keeps the tag and published binaries tied to the reviewed release.

changelog: skip

docs: tag the release PR merge commit when releasing

The release steps tagged whatever commit main pointed at after syncing. If another PR merged between merging the release PR and tagging, the tag and the published binaries landed on a commit that the release PR and its changelog did not cover. Published release assets cannot be replaced, so the only repair is cutting a new version.

The steps now tag the squash merge commit GitHub recorded for the release PR. They confirm the PR is merged and that the commit is on main before tagging, and stop on any failure.

changelog: skip

docs: tag the release PR merge commit

The release instructions in CONTRIBUTING.md previously tagged the local tip of main after merging the release PR. If another PR lands on main during the window between merging and tagging, the version tag and generated release binaries point to a commit omitted from the release PR and its changelog.

Published release versions are immutable once cut, so correcting a mistagged release requires shipping another version. Recording the release PR number, fetching main, checking that GitHub's recorded squash merge commit is an ancestor of origin/main, and tagging that commit ensures each release tag matches its release PR.

changelog: skip

docs: include Cargo's vendor config in recovery archives

A recovery archive can contain all the dependencies and still fail to build offline if Cargo lacks the configuration pointing it to vendor/. Archive that configuration with the source and lockfile. A build from the extracted archive with an empty Cargo cache and fresh build directories exposes omissions that a build on the original machine could hide.

changelog: skip

docs: include the cargo vendor config in the recovery archive

The emergency recovery steps ran cargo vendor without keeping the source replacement config it prints. Without .cargo/config.toml, Cargo does not know to use vendor/ and tries to download dependencies. An archive made this way can fail to build on a clean offline machine, which is exactly the situation it exists for.

The old build check ran in the original tree, where the local Cargo cache and earlier build output could hide a missing dependency. The steps now save the config with the archive and check the build from an extracted copy with a fresh Cargo cache and fresh build directories.

changelog: skip

docs: include Cargo vendor config in recovery steps

Running cargo vendor populates the vendor directory, and Cargo requires a matching .cargo/config.toml file to resolve dependencies from that directory. Following the earlier emergency recovery steps in README.md left out that configuration file, so a stored source copy prepared for offline recovery could still attempt network access and fail to compile on an offline machine.

The updated instructions capture the locked vendor configuration into .cargo/config.toml from a fresh source copy and include it alongside vendor and Cargo.lock in the stored tree. They also direct users to verify the extracted copy with fresh Cargo cache and build directories so existing host caches cannot hide a missing file.

changelog: skip

fix: require passing release tests before publishing

Failed release-plan tests can cause the artifact builds to be skipped. Publishing accepted skipped builds and could create a GitHub release with a manifest and no binaries to download.

Publication now requires the release-plan tests to succeed. A workflow check catches a missing publishing gate after regeneration.

changelog: include

fix: block release publishing when release tests fail

When the release-plan tests failed on a version tag, the artifact build jobs were skipped, and the publish job accepted skipped builds as fine. It could then create a GitHub release with only the manifest and no binaries. Users saw a published version with nothing to download, and the release had to be repaired by hand.

The publish job now depends directly on the release tests and requires them to succeed. A failed, cancelled, or skipped test run blocks publication even when the artifact builds are skipped.

dist generates the release workflow and knows nothing about this gate, so regenerating the workflow would silently drop it. The release-plan tests now fail if the guard is missing, and the regeneration checklist lists it among the local patches to reapply.

changelog: include

fix: require passing release tests before publishing

The release workflow's host job accepts skipped artifact build jobs so partial build matrices can publish. When custom-release-plan-tests failed, was cancelled, or was skipped on a version tag, the downstream artifact jobs were skipped as well, letting host publish a manifest-only GitHub release with no downloadable archives. Fixing that broken release required manual intervention.

The host job now depends directly on custom-release-plan-tests and requires that job to succeed before publishing. Because dist overwrites local workflow patches when regenerating release.yml, the release-plan workflow verification checks both parts of this guard, and the repository release guides document reapplying it after workflow regeneration.

changelog: include

fix: keep update input separate from the stdin passphrase

With --passphrase-stdin, update could silently overwrite the encrypted contents when both inputs shared a source. Reading the passphrase could drain a pipe and leave an empty replacement. Reopening a redirected file could use the passphrase itself as replacement data.

On Unix, update rejects a replacement path that refers to the same file or pipe as standard input, including aliases, and preserves the existing encrypted file.

changelog: include

fix: reject update input that reuses the passphrase stdin

With --passphrase-stdin, update read the passphrase from standard input and then opened -i as an ordinary path. If that path also named standard input (/dev/stdin, /dev/fd/0, a link to either, or the regular file stdin was redirected from), the replacement came from the same source as the passphrase. A pipe yields whatever is left after the passphrase, usually nothing. A redirected file is opened again from the start and yields the passphrase bytes. Either way update succeeded and silently replaced the encrypted contents with empty data or the passphrase.

On Unix, update now refuses an input that is the same file or pipe as standard input when --passphrase-stdin is set. The check runs before the passphrase is read, so the command fails without waiting on stdin, and again on the opened input before any of its bytes are used. The encrypted file is left unchanged.

changelog: include

fix: reject update input sharing passphrase stdin

When update reads the passphrase via --passphrase-stdin and -i refers to the same standard input source, the passphrase read and replacement read collide. A piped stdin leaves nothing for the replacement read, and a redirected regular file causes update to encrypt the passphrase itself, silently replacing valid ciphertext with empty or passphrase data.

On Unix, update now compares the replacement path against standard input before reading the passphrase, covering descriptor aliases such as /dev/stdin and /dev/fd/0 as well as the redirected regular file itself. Checking up front avoids blocking on an open pipe or running key derivation before rejecting the command, and rechecking the path and the opened file descriptor before reading replacement bytes catches aliases introduced during passphrase reading and validation or between lookup and open.

On macOS, the check also inspects /dev/fd/0 metadata to account for pipe inode reporting differences between descriptor paths and fstat. Matching sources fail as a user error and leave the encrypted file intact. Non-Unix platforms skip the Unix descriptor check.

changelog: include

fix: reject output paths ending in . or ..

A final . or .. names a directory. Saltybox could create a temporary file in an unexpected directory before the rename failed, briefly placing plaintext there during decryption. All three commands now report the invalid output path before reading input, requesting a passphrase, or creating a temporary file.

changelog: include

fix: reject output paths ending in . or ..

-o dir/., -o dir/.., and -o . passed the up-front output path check. Rust's path handling drops a trailing ., so the temporary file holding the full output was created in a directory the user did not name as the destination. For decrypt that file holds the plaintext. The rename then failed with an opaque error such as EBUSY or "No such file".

A final . or .. always names a directory, so all three commands now reject it with a message saying so. The check runs before reading input, prompting for a passphrase, or creating a temporary file, so nothing is written anywhere.

changelog: include

fix: reject output paths ending in . or ..

An output path ending in . or .. always names a directory. Previously these arguments passed early -o validation, and Rust's Path normalization stripped a trailing . when resolving the parent directory. Commands ran through input reads, passphrase entry, and key derivation, then wrote the temporary output file into an unintended directory before rename failed with a low-level OS error. For decrypt, that placed temporary plaintext outside the directory the user expected.

All three commands now inspect the raw final path segment before normalization and reject . or .. immediately with a clear user error, before reading input, prompting for a passphrase, or creating a temporary file.

changelog: include

fix: escape control characters in path diagnostics

A filename or symlink target can contain control characters that affect the terminal when printed verbatim. Diagnostics now quote filesystem paths and display control characters as escapes, including when reporting a dangling symlink.

changelog: include

fix: escape control characters in paths in error messages

When an output path was a dangling symlink, the error message printed the link's target as raw text. Whoever creates a link chooses its target, so a link planted by someone else could put terminal escape sequences on the terminal of the user running saltybox.

Paths in diagnostics are now quoted, and control characters in them are shown as escape sequences. This covers every path saltybox reports, since user-supplied paths can contain the same bytes. Error messages change format as a result, which matters only to scripts that match on stderr text.

changelog: include

fix: quote and escape paths in error messages

File operation errors previously formatted paths and symbolic link targets with Path::display, printing raw control bytes directly to standard error. A failing filename or dangling symlink target containing terminal escape sequences could therefore write unescaped control codes to the user's terminal.

Diagnostics across file operations now format paths and symlink targets with Rust's quoted Debug representation, enclosing paths in quotes and rendering control characters as escape sequences. This behavior is also documented in SPEC.md.

changelog: include

fix!: reject untrusted output symlinks and special files

In a world-writable sticky directory, a symlink could redirect a save onto an unrelated file. Saltybox accepts a link in such a directory only if it belongs to the running account or the directory owner. This applies to links in parent components and at the final name. Existing destinations must be regular files, which protects named pipes and devices from being replaced with plaintext or ciphertext.

update uses the same resolved directory and filename to read the encrypted file and save its replacement, so retargeting a path symlink cannot redirect the save. It checks that the filename still refers to the file it validated just before the rename. A concurrent replacement can still occur between that check and the rename.

The symlink resolver uses an API introduced in macOS 13, which is now the minimum supported version.

changelog: include

fix!: refuse untrusted output symlinks and non-regular outputs

saltybox followed output symlinks wherever they pointed. In a shared world-writable sticky directory such as /tmp, another local user could plant a symlink at the name the victim was about to write. saltybox resolved the link itself and renamed onto its target, so Linux's protected_symlinks restriction never applied. The result was that any file the victim can write could be overwritten with plaintext or ciphertext while the command exited 0. In a world-writable sticky directory, commands now refuse a symlink owned by neither the running account nor the directory owner. The rule covers links in directory components as well as the final name.

update also resolved the output path twice, once to read the existing file and once to replace it. A symlink retargeted during key derivation could make update validate the passphrase against one file and replace another, which SPEC.md says cannot happen. update now resolves the output once and reads and replaces through the same directory and name. Before renaming, it checks that the name still refers to the file it validated and aborts if it has changed. Another process can still replace that final filename between the check and the rename, so concurrent changes to a file while it is being updated remain unsupported.

An output path naming a named pipe or device was replaced with a regular file holding the output, so decrypt could leave plaintext where the user expected a stream or a device. An existing destination must now be a regular file. Directories, named pipes, devices, and other special entries are refused before anything is read or written.

This is a breaking change for macOS users. Reading a symlink target through an open descriptor needs an API introduced in macOS 13, so macOS 12 and earlier are no longer supported. Release binaries declare 13.0 as their minimum, and source builds on macOS should set MACOSX_DEPLOYMENT_TARGET=13.0.

changelog: include

fix!: harden output path resolution and require macOS 13

Following output symlinks without ownership checks allowed a symlink owned by another local account in a world-writable sticky directory to redirect saltybox's write onto any file writable by the caller, bypassing OS protected_symlinks protections because saltybox created a temporary file in the resolved directory and renamed it over the target. Separately, update resolved its output path more than once, so retargeting a symlink during passphrase entry or key derivation could validate one file and overwrite a different file. Naming a FIFO, device, or other special entry as -o also caused the rename to replace that entry with a regular file, which for decrypt could write plaintext to disk at a path intended as a pipe or device.

On Linux and macOS, saltybox now walks the output path once, component by component, holding open directory descriptors from resolution through temporary file creation, cleanup, rename, and directory sync. Any symlink inside a world-writable sticky directory owned by neither the running account nor the directory owner is rejected across both intermediate directory components and the final name, with symlink traversal bounded at 40 hops to catch cycles. Existing destinations must be regular files (directories, named pipes, devices, and other special entries are rejected before reading or writing), and commands recheck the resolved entry before creating the temporary file and again before renaming it. If temporary file cleanup fails after an error, saltybox queries the open directory descriptor for its current path and falls back to reporting the filename alongside the original path when the directory moved and cannot be resolved.

For update, saltybox opens the resolved encrypted file from that directory handle with no-follow and nonblocking flags and uses the open handle for input-alias detection. Moving an original symlink during prompting or validation cannot redirect the save. Immediately before rename, update verifies that the resolved name still refers to the validated file and aborts if a change is detected. Another process can still replace that final filename between the final check and rename, so concurrent modifications to the resolved file during update remain unsupported.

Reading ownership and target text from the same open symlink descriptor on macOS requires freadlink, introduced in macOS 13. Supported platforms are now Linux and macOS 13 or later, release builds set MACOSX_DEPLOYMENT_TARGET=13.0, and source builds on macOS should set MACOSX_DEPLOYMENT_TARGET=13.0 so the binary records that minimum OS version. On macOS, crate-level forbid(unsafe_code) is relaxed to deny(unsafe_code) solely for that single freadlink FFI call, with forbid(unsafe_code) retained on all other targets. Unsupported platforms keep the path-based write implementation.

changelog: include