You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
configure.sh's $live Reads Are Unguarded, Same Abort Risk as $file #1260
check_ruleset()'s reads of $live (the parsed response body from a successful gh api "repos/$repo/rulesets/$id" call) are unguarded bare assignments, the same construct that made an earlier $file read abort the whole configure.sh check run via set -e (see #1246's fix). check_settings() has the identical shape on its own $live reads.
(repo-config/configure.sh, check_ruleset(), around lines 291 and 297.) live is only checked for a successful gh apicall (if ! live="$(gh api ...)"; then fail ...; return; fi), never for whether its body actually parses as an object with a .rules array. If gh api exits 0 with a body jq can't index that way (a truncated response, a proxy-injected non-JSON 200), the first such read aborts the whole script with a bare, unattributed jq error instead of the clean, attributed FAIL the rest of this function was just fixed to guarantee for the analogous $file case.
The same bare-assignment-on-$live-via-jqr shape also exists in check_settings(), around lines 348/352/355/357 (got="$(jqr --arg k "$key" '.[$k]' <<<"$live")", private="$(jqr '.private' <<<"$live")", etc.), reading the settings API response the same way.
Suggested fix
Guard the first $live read in each function (check_ruleset()'s got_types, check_settings()'s private or its first per-key read) the same way the $file guards already are, so a malformed live response reports a named FAIL instead of aborting.
Context
Found via an adversarial local-review confirmation pass on #1246's PR. Lower likelihood than the $file case, since $live comes from an already-successful gh api call, but the failure mode (full script abort vs. a clean FAIL) is identical. Filed separately to keep #1246's PR scoped to the payload-file reads it was assigned.
Activity
Quote a Printed Target, Guard a Live Read, and Fix Two Carried Claims (…
Promote Develop to Main: Settle Section 5 and the CRLF Chain (#1263)
Guard check_settings' Live Read of the Repository Response (#2088)