fix: feat: rewrite dispatcher — poll for merged vault PRs, enforce admin approval (#76) #82
No reviewers
Labels
No labels
action
backlog
blocked
in-progress
priority
tech-debt
underspecified
vision
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: johba/disinto#82
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-76"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #76
Changes
2ff83aae6fto6b543740bcAI Review
Security
dispatcher.sh:115:get_pr_for_fileuses-- "${actions_dir}/*"(a directory-wide pathspec) instead of-- "$file_path". It finds the first merge commit that added any file tovault/actions/, not the commit that specifically added the file under review. A malicious actor who directly pushes a TOML file will pass admin verification if any previous admin-merged PR touched that directory — the function skips the direct-push commit (no "Merge pull request" in message), then falls through to the next merge commit from the legitimate earlier PR, which returns a valid PR number and passesis_allowed_admin. Fix: pass the specific file path to git log, e.g.git -C "$OPS_REPO_ROOT" log --oneline --diff-filter=A -- "vault/actions/$(basename "$file_path")".Bugs
medium
dispatcher.sh:72-73:is_user_adminchecks.role_nameand.permissions.adminfrom/api/v1/users/{username}. The Forgejo user endpoint returns neither field (org role is on the org-member endpoint; repo permissions are on the collaborator endpoint). The correct field for site-wide admin is.is_admin. As written, the API branch ofis_allowed_adminalways returns false — the staticFORGE_ADMIN_USERSlist is the only working check.minor
dispatcher.sh:244-268:get_action_secretsis defined but never called. Secret checking is duplicated inline inlaunch_runner(lines 333–344). Dead function should be removed.Verdict
REQUEST_CHANGES — get_pr_for_file matches any file in vault/actions/ instead of the specific file, enabling a security bypass
Reviewed at
6b54374| AGENTS.mdAI Review: REQUEST_CHANGES — get_pr_for_file matches any file in vault/actions/ instead of the specific file, enabling a security bypass
6b543740bctoe7ed5d6567AI Re-review (round 2)
Previous Findings
get_pr_for_filedirectory-wide pathspec security bypass → FIXED: now uses"vault/actions/${file_name}"(specific file) instead of"${actions_dir}/*"is_user_adminchecked wrong Forgejo API fields → FIXED: now correctly reads.is_admin // falsefrom the user endpointget_action_secretsdead code → FIXED: function removedVerdict
APPROVE — All three previous findings addressed: security bypass fixed, correct API field used, dead code removed
Reviewed at
e7ed5d6| Previous:6b54374| AGENTS.mdAI Re-review (round 2): APPROVE — All three previous findings addressed: security bypass fixed, correct API field used, dead code removed