fix(work-items): fail closed when a gitea label page is not an array - #3655
Conversation
|
Claude finished @kyle-sexton's task in 1m 43s —— View job Security review
No security issues found in this diff. This PR is itself a security-hardening fix: Checked for the usual concerns and found nothing exploitable in this diff:
One out-of-scope observation, not a finding against this PR: |
|
Last security-reviewed head: |
A 200 object or HTML body was treated as iterable, so jq length of an object (its key count) looked like a one-item page. Type-check each label page after the HTTP-status gate. Co-authored-by: ksextonmelodic <ksextonmelodic@gmail.com>
The #3484 fixture expected exit 5 (label not found after the walk stopped). Fail-closed type checking now exits 1 with an explicit adapter error and still refuses to page or POST. Co-authored-by: ksextonmelodic <ksextonmelodic@gmail.com>
8713516 to
89f0a28
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Claude finished @kyle-sexton's task in 1m 25s —— View job Security review —
|
|
Claude finished @kyle-sexton's task in 18s —— View job Code review — skipped
Skip gate hit: PR is closed (state = MERGED). Per the For reference, this PR was already reviewed on this head SHA by the security lane (see the earlier comment above) with no issues found, and it has since merged. |
|
Claude has reviewed this PR 1 time. The lane skips further automatic reviews after 5; deleting this comment resets the count. |
Closes #3439
Summary
The gitea adapter's label walk treated any 200 body as iterable. A proxy error page or auth-redirect object has
jq lengthequal to its key count, so the walk accepted garbage instead of erroring.Fix
Add
wit_gitea_require_arrayincommon.sh(jq 'type' == array) and call it after every label-pagewit_gitea_require_okincreate-item.sh. A non-array 200 now exits 1 withexpected a JSON array, does not request page 2, and does not POST an issue.work-items 0.39.48 -> 0.39.49 (rebased onto #3647).
Verification
create-item.test.sh49/49 andcommon.test.sh69/69 after updating the #3484 fixture from expected exit 5 to exit 1.Related
Refs #3647
Refs #3651
Refs #3484