oliver-zehentleitner / maity

hub: requests: answer() and the forwarding check share one answerer check (the seven checks are restated line for line)

Sign in to report

tsk-tj0w7gexsq3b Proposed

Audit round 6 (tsk-hgnbapyw7hnh), read at 046a4d3b. Kind: rule built twice.

What is wrong

  • routes/requests._refuse_unless_answerer (routes/requests.py:2197-2226) restates the checks of answer() (:2315-2340) nearly line for line: require_known, action_needs_owner, needs_a_human, runner_owner_only, _refuse_by_kind, may_answer, self_answer.
  • Both build the action_needs_owner and runner_owner_only 403s inline, although routes/placements._runner_owner_only (routes/placements.py:931) exists.

Proposal

  • answer() calls _refuse_unless_answerer, keeping _relayed_owner and the forwarded-holder check where they are (or the helper takes a hook for them); one runner_owner_only() in errors.

Effort / risk: S. Medium; the refusal order is pinned in test_proxy_go.