fix(apps): harden backend health probes - #5727
Conversation
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
First Principles Review (Fable 5, fork) — ✅ PASSPremise-level review of All checks done. The change reuses the existing First-Principles-Verdict: PASS A real authority-smuggling hole in app-authored health paths is closed at the one place URLs are built, reusing the existing hardened opener. What this change shipsIntent: stop an app manifest's
Depth check: the cause is app text concatenated into a URL, and the fix sits exactly there — [FIRST-PRINCIPLES-REVIEWED] c94f71e |
Design Review (Fable 5, fork) — ✅ PASSDesign-level review of All claims in the description have backing code, the validation reuses the existing hardened Design-Verdict: PASS Real authority-smuggling/proxy harm, closed at the one probe seam by reusing the existing hardened loopback opener — proportionate and fail-closed. [DESIGN-REVIEWED] c94f71e |
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed Review detailsBoth candidates are self-flagged low-confidence, and both describe deliberate fail-closed tightenings in a security-hardening PR, documented in the same diff's spec/manifest changes. Candidate 1 (redirect refusal): Candidate 2 (empty Step 2: The validation logic is sound — the leading No findings. [OPUS-REVIEWED] c94f71e |
3d0ef6b to
4c0b9a3
Compare
4c0b9a3 to
c45ef52
Compare
c45ef52 to
dbaa738
Compare
dbaa738 to
1bd2b91
Compare
e9d2c58 to
c47bc24
Compare
c47bc24 to
4118481
Compare
85799fe to
ce7f58b
Compare
ce7f58b to
7daabc7
Compare
7daabc7 to
74308f8
Compare
|
Full-diff overlap audit (current head There is still a real residual in this diff: Please rebase onto current |
|
👋 Hi! This PR's description is missing some required sections from our PR template. Workflow runs won't be auto-approved until the description is updated. Missing sections:
Please update your PR description to include these sections, then push or re-save the description. The workflows will be approved on the next cycle. |
bolichen97
left a comment
There was a problem hiding this comment.
Approving per triage sweep: readiness: passed, required check PR Readiness green, mergeable, no valid change requests or unresolved threads.
Problem / Motivation
#5929 already merged the backend liveness, generation-fencing, locking, retry, and tri-state reconciliation work that this older PR originally carried. One security residual remains absent from
main: the app-authoredbackend.healthCheckis concatenated into a URL without validation, and the probe uses the ordinary opener.Why it matters
A value such as
@example.com/can move the assembled URL authority away from loopback. The default opener also inherits proxy environment variables and follows redirects. A health check intended only for127.0.0.1therefore lacks a firm loopback-only boundary.What changed
backend.healthCheckbefore building a URL, requiring a valid port and an absolute restricted path that cannot move the authority or be silently normalized._health_probecontract.loopback_urlopen, which bypasses proxy environment variables and refuses redirects.Scope
This PR does not replay the supervisor or reconciliation state machine from the old branch. The generation, lock, retry, ownership, and tri-state behavior merged in #5929 remains unchanged.
Tests
test/test_app_backend.py+test/test_apps_backend_coverage.py: 272 passed, 9 skippedgit diff --check: passedRelated
The liveness portion of the original change is covered by #5929. This PR is limited to the remaining path-validation and no-proxy/no-redirect security boundary.
Contribution License Agreement
I agree to the terms of the Contribution License Agreement for this repository.