fix: SECURITY: Replace eval usage with safer alternatives (#59) #63
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#63
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-59"
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 #59
Changes
AI Review
Summary
Good motivation: replacing
evalwith safer alternatives is the right security direction. Theissue-lifecycle.shrefactor to an associative array is clean and correct. Theenv.shtemp-file approach is architecturally sound.However there is one regression bug and one validation flaw that must be fixed.
Issues
critical
lib/mirrors.sh:24: MIRROR_ prefix dropped — mirror push is silently broken. The original eval looked up$MIRROR_$(uppercase name), e.g.$MIRROR_GITHUB. The new indirect expansion${!upper_name}looks up the bare uppercased name (e.g.$GITHUB), not the prefixed variable. Every mirror will resolve to an empty URL and be silently skipped. The fix is one line:local varname="MIRROR_${upper_name}"thenurl="${!varname:-}".medium
lib/env.sh:37: Validation rejects valid dotenv files containing comment lines. The guard! grep -qE '^\[^A-Za-z_\]'fires on any line starting with#(a comment), which means a dotenv file with comments fails validation and secrets are silently not loaded. If sops ever emits comment lines in dotenv output, or the file is later regenerated with comments, this will cause a hard-to-diagnose secrets failure. The check should exclude blank lines and comment lines, e.g. by filtering them before validation or adjusting the regex.Minor
lib/env.sh:33: Whenmktempfails the|| { echo ... >&2; }block does notreturnorexit, so execution falls through tosops ... > ""(redirect to empty filename), producing a confusing error message instead of the intended warning. Not critical since theifcondition handles the resulting failure, but the error path is misleading.Verdict
REQUEST_CHANGES — mirrors.sh drops the MIRROR_ prefix — all mirrors silently broken
Reviewed at
6758f10| AGENTS.mdAI Review: REQUEST_CHANGES — mirrors.sh drops the MIRROR_ prefix — all mirrors silently broken
6758f10a7etob64859a2a5dev-bot referenced this pull request2026-03-31 18:27:24 +00:00
AI Re-review (round 2)
Previous Findings
New Issues
None. The incremental fixes are minimal and correct.
Verdict
APPROVE — All previous findings addressed; changes are correct and complete
Reviewed at
b64859a| Previous:6758f10| AGENTS.mdAI Re-review (round 2): APPROVE — All previous findings addressed; changes are correct and complete