Skip to content

fix(vcs): stop printing request params on provider errors - #14826

Merged
ChiragAgg5k merged 1 commit into
mainfrom
fix/vcs-provider-error-output
Oct 22, 2026
Merged

ChiragAgg5k merged 1 commit into
mainfrom
fix/vcs-provider-error-output

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Summary

Utopia\VCS\Adapter::call() echoed the method, path, full request params and response body to stdout whenever a provider answered with a 500. Request params can include webhook secrets and other credentials, and that output ends up in worker logs. The echo is removed; callers already receive the status code and body in the returned response and handle errors from there.

Test plan

  • bin/monorepo check vcs
  • Unit tier of bin/monorepo test vcs; new AdapterCallTest runs call() against a local php -S server that always returns 500 and asserts nothing is written to output (fails without the fix)
  • Package e2e tier in CI (the local run hit composer's 300s process timeout against the GitLab container; the change does not touch those paths)

Related: appwrite-labs/cloud#6674

Adapter::call() echoed the full request params to stdout whenever a provider answered 500. Those params include webhook secrets and other credentials, and the output lands in worker logs. Callers already get the status code and body in the returned response.
@luxor-code-review

luxor-code-review Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Review complete. No blocking issues — approved ✅; 1 nitpick below.

🧹 Nitpicks (1) — 🟢 1 low
  • 🟢 Reserve-then-release test port can be stolen (AdapterCallTest.php:23) — The test picks a port by binding a socket and immediately closing it before launching php -S on that address (packages/vcs/tests/AdapterCallTest.php:23-32).

This PR fixes a secret-leakage issue in the VCS HTTP adapter by dropping the echo of failed-response output, and introduces a real-socket test harness for adapter calls.

Files Change
packages/vcs/src/Adapter.php Removes the echo of provider error output that could expose webhook request params on 500 responses.
packages/vcs/tests/AdapterCallTest.php New test launching a local php -S server to exercise adapter call() error paths.
packages/vcs/tests/ProviderGitea.php Test double exposing the protected call() method.
packages/vcs/tests/Fixtures/server-error.php Fixture returning a 500 response to simulate a provider outage.

Reviewed commit: 3394e27

@ChiragAgg5k ChiragAgg5k self-assigned this Oct 22, 2026
@ghost

ghost commented Oct 22, 2026 •

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

The sensitive request and response data is no longer printed, and the change preserves the existing response contract.

Removed the VCS adapter's stdout dump when a provider returns HTTP 500, leaving the response available through the existing return value. Added a regression test that checks a 500 response does not emit output and a test-only Gitea adapter and fixture server to exercise the request path.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 4
File Change
packages/vcs/src/Adapter.php Removed the HTTP 500 response logging from Adapter::call().
packages/vcs/tests/AdapterCallTest.php Added coverage for the adapter's returned 500 response and absence of output.
packages/vcs/tests/Fixtures/server-error.php Added a local server fixture that returns a JSON 500 response.
packages/vcs/tests/ProviderGitea.php Added a test-only Gitea subclass exposing the protected call path.

Reviewed 3394e27 · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Tier S · Looks good to merge. Summary

@ChiragAgg5k

Copy link
Copy Markdown
Member Author

On the port nitpick: php -S can't take an already-bound socket, so some reserve-then-release gap is unavoidable. The gap is a few milliseconds on loopback. If another process grabs the port in that window, php -S exits, and the test is still talking to a server that answers every request with a 500. The readiness loop then either passes against that server or fails with 'The local server did not start' rather than passing silently. I'm leaving it as is.

@github-actions

Copy link
Copy Markdown

✨ Benchmark results

Comparing main (before) → fix/vcs-provider-error-output (after).

Metric Before After Change
🚀 Requests/sec 196.81 202.57 ⚪ +2.9%
⏱️ Latency P50 85.87 ms 85.85 ms ⚪ 0%
⏱️ Latency P95 209.68 ms 198.23 ms 🟢 -5.5%
Per-scenario breakdown & investigation details

Metrics below reflect the current branch (after). Δ P95 compares against the base.

Scenario P50 (ms) P95 (ms) Requests RPS Δ P95 (ms)
API total 85.85 198.23 12,540 202.57 -11.45
Account 159.7 279.08 660 11.52 -55.46
TablesDB 81.6 146.07 6,820 114.31 -14.32
Storage 83.67 196.22 3,300 56.42 +15.51
Functions 120.42 238.37 1,760 30.63 -22.18

Top API waits (after)

API request Max wait (ms)
account.name.update 496.13
account.get 436.68
storage.files.create 433.52
storage.buckets.create 422.11
account.prefs.update 421.91

@github-actions

Copy link
Copy Markdown

Security rules

No new WARNING or ERROR findings from security rules.

6 existing findings tracked in .semgrep/baseline.json
  • php.appwrite.guest-write-without-abuse-limit (3)
  • php.appwrite.secret-compare-timing (1)
  • php.appwrite.weak-secret-env-default (2)

Posted by Checks / Rules. Re-runs update this comment in place. Rule details and baseline: .semgrep/README.md.

@ChiragAgg5k
ChiragAgg5k merged commit 0d3dfba into main Oct 22, 2026
39 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the fix/vcs-provider-error-output branch October 22, 2026 17:29
Tapraj-Pathak pushed a commit to Tapraj-Pathak/appwrite that referenced this pull request Oct 24, 2026
…r-output

fix(vcs): stop printing request params on provider errors

(cherry picked from commit 0d3dfba)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant