Repository navigation
fix: the blocking findings of the main audit - #37
Merged
Merged
Conversation
Workflows passed Vault credentials, the release-please token and the notification webhook to actions referenced by mutable refs (@main, @master, @werf, @v4), so any commit pushed to those branches would run in this repository's context with those secrets. Every pin resolves to the current tip of the ref previously used, so behaviour is unchanged. Adds a dependabot config to bump the pins. Signed-off-by: Aleksei Igrychev <aleksei.igrychev@palark.com>
A quorum counted key entries, so the same public key listed twice (inline and via gpgKeyPaths, for example) satisfied minNumberOfKeys: 2 with two signatures from one key holder: the verifier drops one trusted key per matching signature, and both entries matched. Keys are now parsed before the count, a repeated primary fingerprint is a config error naming both entries, and minNumberOfKeys is compared against the number of distinct keys. Signed-off-by: Aleksei Igrychev <aleksei.igrychev@palark.com>
A stdout line longer than the 64 KiB bufio.Scanner token limit ended the reading goroutine without draining the pipe, so the child blocked on a full pipe, the stderr io.Copy never saw EOF and cmd.Wait was never reached: the run hung forever holding the execution lock. os/exec now owns the copying: both streams are written to the log as they are produced, through one mutex, and a bounded tail of stderr is repeated on failure. This also streams stderr live instead of hiding it until the command ends, and no longer races cmd.Wait for the tail of stdout. Signed-off-by: Aleksei Igrychev <aleksei.igrychev@palark.com>
Both were keyed by the URL basename, so org-a/infra.git and org-b/infra.git shared one clone and one last processed tag: the second config fetched into the first one's clone, verified its tag and ran its own commands in that worktree. The directory is now <name>-<url hash>, an existing clone whose origin is not the configured URL is refused instead of reused, and state and clones written by earlier versions are moved over when they belong to the URL. Signed-off-by: Aleksei Igrychev <aleksei.igrychev@palark.com>
The tag was checked out while resolving it, before CheckQuorums, and the executor's working directory was the clone. So onQuorumFailure and onCommandSkipped ran shell commands inside the content of a tag that had not passed verification, on the very path meant to report an attack. GetTargetGitObject now only resolves the tag, the checkout happens after the quorum passes, and the executor starts in the directory trx was started in and moves to the clone only then. Hooks that run before verification therefore no longer see repository content. Signed-off-by: Aleksei Igrychev <aleksei.igrychev@palark.com>
Nothing recorded an attempt, so a tag whose quorum or commands failed was retried identically on every poll, firing onQuorumFailure or onCommandFailure every time, and an unsigned newest tag blocked every later tag for good. Deleting it upstream did not help either: the fetch never pruned, so the local ref kept winning. The failed tag is now stored next to the last processed one and skipped with an explicit error until a newer tag arrives or --force is given, and the fetch is forced and pruning. Signed-off-by: Aleksei Igrychev <aleksei.igrychev@palark.com>
alexey-igrychev
force-pushed
the
fix/audit-blocking-findings
branch
from
September 18, 2026 12:32
fb4763f to
617a5d2
Compare
This was referenced Sep 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The five blocking findings of the audit of
main@ b32caf4, plus the CI pinning, one commit each.gpgKeyPaths) satisfiedminNumberOfKeys: 2with two signatures from one key holder. Keys are parsed before the count, a repeated primary fingerprint is a config error naming both entries, and an entry holding several keys counts as one, because the verifier drops the whole entry per matched signature.CheckQuorums, and the executor's working directory was the clone, soonQuorumFailureandonCommandSkippedran shell commands inside the content of an unverified tag. The checkout now happens after the quorum passes, and the executor starts in the directorytrxwas started in, moving to the clone only then.org-a/infra.gitandorg-b/infra.gitshared them. The directory is now<name>-<url hash>, a clone whoseoriginis not the configured URL is refused instead of reused, and directories written by earlier versions are migrated.bufio.Scannergoroutine without draining the pipe, so the run hung forever holding the execution lock.os/execnow owns the copying, andWaitDelaybounds the wait on a process left running in the background.--forceis given; the fetch is forced and pruning.Behaviour changes for operators
onQuorumFailureandonCommandSkippedrun in the directorytrxwas started in, not in the clone. A hook written as./notify.shexpecting a repository-relative path stops resolving — that is the vulnerability being fixed.~/.trx/<name>and~/.trx/storage/<name>become<name>-<url hash>. The clone is moved when itsoriginmatches; the state file is copied and the old directory left in place, so a same-named repository does not lose its last processed tag.Tests cover each fixed property and were checked against the previous code where that is possible: the long-line test hangs the old executor, and the no-checkout test observes the worktree that the old resolve path would have moved.
Closes #14, closes #15, closes #16, closes #17, closes #22, closes #28.