Skip to content

fix(nextcloud-talk): prevent shared proxy webhook lockouts - #126251

Merged
pgondhi987 merged 3 commits into
openclaw:mainfrom
pgondhi987:fix/fix-947
Aug 19, 2026
Merged

pgondhi987 merged 3 commits into
openclaw:mainfrom
pgondhi987:fix/fix-947

Conversation

@pgondhi987

@pgondhi987 pgondhi987 commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where Nextcloud Talk webhook deliveries behind a configured reverse proxy could be throttled by failed authentication requests from unrelated clients that shared the proxy connection address.

Why This Change Was Made

The webhook listener now uses OpenClaw's existing trusted-proxy client attribution for its failed-authentication rate-limit key. Direct connections keep their existing behavior, and forwarded client headers are honored only when the socket peer matches gateway.trustedProxies.

User Impact

A client that exhausts its own failed-authentication allowance no longer suppresses valid, correctly signed Nextcloud Talk deliveries from other clients behind the same trusted proxy.

Evidence

  • Exact head: 836e20b98590e388813c822a09e9fb02ce7a49cb
  • Entry points exercised: the real Nextcloud Talk HTTP webhook server and the monitor runtime's gateway-config handoff.
  • Fixed scenario: an invalidly signed forwarded client receives 401 and then 429; a different forwarded client with a valid signature still receives 200 and reaches webhook admission.
  • Fail-closed control: trusted proxies without usable forwarded identity retain separate socket-address buckets, so one proxy's failures do not suppress valid traffic through another proxy.
  • Benign control: valid signed bursts from one source continue to receive 200.
  • Trust boundary: forwarded headers affect attribution only when the direct peer is in the configured trusted-proxy list.
  • Environment: local Linux HTTP listener; no live Nextcloud instance or external reverse proxy was required.

Focused validation:

node scripts/run-vitest.mjs extensions/nextcloud-talk/src/monitor.replay.test.ts extensions/nextcloud-talk/src/monitor-runtime.abort.test.ts
Test Files  2 passed (2)
Tests       14 passed (14)

pnpm format:check --no-error-on-unmatched-pattern -- <five changed files>
All matched files use the correct format.

node scripts/run-oxlint.mjs --openclaw-focused-config --tsconfig config/tsconfig/oxlint.extensions.json <five changed files>
passed

scoped production and test tsgo projects
passed

git diff --check
passed

@clawsweeper

clawsweeper Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added channel: nextcloud-talk Channel integration: nextcloud-talk size: S maintainer Maintainer-authored PR labels Aug 19, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 19, 2026
@clawsweeper

clawsweeper Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 19, 2026, 3:50 AM ET / 07:50 UTC.

ClawSweeper review

What this changes

The PR passes existing gateway trusted-proxy settings into the Nextcloud Talk webhook listener so failed-signature limits are isolated by forwarded client when the socket peer is trusted.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open for protected maintainer handling. The patch correctly reuses the existing fail-closed trusted-proxy attribution contract and has no actionable correctness finding; exact-head CI and a maintainer disposition remain required.

Priority: P2
Reviewed head: 05a918be14fb2fa8b06ee23416dfe1ed36d725b6

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused real-listener proof and owner-boundary regression coverage support a clean, bounded repair.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The PR body describes an after-fix local production HTTP listener run with a real fetch client and observed 401, 429, and 200 outcomes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body describes an after-fix local production HTTP listener run with a real fetch client and observed 401, 429, and 200 outcomes.
Evidence reviewed 6 items Current-main failure point: Current main keys the Nextcloud Talk failed-authentication limiter solely from the socket peer, so requests arriving through one proxy share a bucket.
Patch owner-boundary repair: The branch replaces only the limiter key with the public request-attribution helper and forwards the existing gateway proxy settings from the monitor runtime.
Shared attribution contract: The imported SDK helper resolves forwarded headers only after the direct peer matches configured trusted proxies, otherwise preserves the direct address and fails closed for invalid trusted-proxy attribution.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs extensions/nextcloud-talk/src/monitor.replay.test.ts

Result: PASS (completed)

node scripts/run-vitest.mjs extensions/nextcloud-talk/src/monitor.replay.test.ts
runner@runnervm76f27:/tmp/clawsweeper-live-proof-126251-PmfKBV/target$ node scripts/run-vitest.mjs extensions/nextcloud-talk/src/monitor.replay.test.ts
node scripts/run-vitest.mjs extensions/nextcloud-talk/src/monitor.replay.test.ts
[test] starting test/vitest/vitest.extension-messaging.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-126251-PmfKBV/target

 ✓  extension-messaging  extensions/nextcloud-talk/src/monitor.replay.test.ts (11 tests) 105ms

 Test Files  1 passed (1)
      Tests  11 passed (11)
   Start at  07:51:31
   Duration  2.13s (transform 1.53s, setup 1.08s, import 582ms, tests 105ms, environment 0ms)

[test] passed 1 Vitest shard in 7.67s
runner@runnervm76f27:/tmp/clawsweeper-live-proof-126251-PmfKBV/target$ node scripts/run-vitest.mjs extensions/nextcloud-talk/src/monitor.replay.test.ts



































Assertions:

  • PASS expect_output: Test Files
  • PASS expect_output: passed

How this fits together

Nextcloud Talk accepts signed webhook HTTP requests and hands admitted events to its monitor runtime. Its authentication limiter blocks repeated bad signatures before admission, while gateway proxy settings decide whether client-address headers can safely identify that limiter bucket.

flowchart LR
A[Nextcloud Talk sender] --> B[Reverse proxy]
B --> C[Webhook listener]
C --> D[Trusted client attribution]
D --> E[Authentication limiter]
E --> F[Webhook admission]
F --> G[Monitor runtime]
Loading

Before merge

  • Resolve merge risk (P1) - The bug fix has a net +13 production-line delta to carry an existing global proxy contract through the plugin; this is justified by the necessary type and runtime handoff, with no smaller owner-boundary route identified.
  • Complete next step (P2) - The protected maintainer label requires explicit maintainer handling; no mechanical repair remains after this review.
Agent review details

Security

None.

PR surface

Source +13, Tests +45. Total +58 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 3 15 2 +13
Tests 2 45 0 +45
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 60 2 +58

Review metrics

Metric Value Why it matters
Production versus test delta production +15/-2; tests +45/-0 The production growth is limited to existing-config handoff, listener options, and the resolver call; the added tests cover the actual HTTP listener and runtime handoff.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain the shared SDK resolver approach and merge only after exact-head CI completes and the protected maintainer review confirms the intended proxy-attribution behavior.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Retain the shared SDK resolver approach and merge only after exact-head CI completes and the protected maintainer review confirms the intended proxy-attribution behavior.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: current main uses the shared proxy socket address as the limiter key, and the branch's real local HTTP-listener scenario exercises the separated forwarded-client outcome.

Is this the best way to solve the issue?

Yes. Reusing the existing gateway-owned resolver preserves its trusted-peer and fail-closed rules instead of adding channel-local forwarding-header policy.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 0151ef17b3d6.

Labels

Label changes:

  • add P2: This is a bounded reliability fix for a configured Nextcloud Talk webhook deployment rather than an urgent default-path outage.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body describes an after-fix local production HTTP listener run with a real fetch client and observed 401, 429, and 200 outcomes.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body describes an after-fix local production HTTP listener run with a real fetch client and observed 401, 429, and 200 outcomes.

Label justifications:

  • P2: This is a bounded reliability fix for a configured Nextcloud Talk webhook deployment rather than an urgent default-path outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body describes an after-fix local production HTTP listener run with a real fetch client and observed 401, 429, and 200 outcomes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body describes an after-fix local production HTTP listener run with a real fetch client and observed 401, 429, and 200 outcomes.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Recent current-main blame owns the original limiter line and history shows 40 contributions across the central Nextcloud Talk monitor files. (role: recent area contributor; confidence: high; commits: a89c56806887, 7a35e243c4df; files: extensions/nextcloud-talk/src/monitor.ts, extensions/nextcloud-talk/src/monitor-runtime.ts, extensions/nextcloud-talk/src/types.ts)
  • Pavan Kumar Gondhi: Prior merged proxy-hardening work introduced the shared trusted-proxy source-validation area that this PR consumes. (role: trusted-proxy contract contributor; confidence: medium; commits: 26c7da2d02ed; files: src/gateway/net.ts, src/plugin-sdk/webhook-ingress.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@pgondhi987

pgondhi987 commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor Author

ClawSweeper review

Reviewed August 19, 2026, 8:21 AM UTC.

What this changes

The branch passes existing Gateway trusted-proxy settings to the Nextcloud Talk webhook listener, keys failed-signature throttling by safely resolved client identity, and adds focused listener and configuration regression coverage.

PR surface: Source +15, Tests +104. Total +119 across 5 files.

Merge readiness

Result: ready for maintainer review.

Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit

Reviewed head: 836e20b98590

Review scores

  • Overall: 🐚 platinum hermit
  • Proof: 🦞 diamond lobster (sufficient)
  • Patch quality: 🐚 platinum hermit
  • Security: cleared

Verification

Status: sufficient

How this fits together

Nextcloud Talk sends signed HTTP webhooks to the plugin listener, which validates and rate-limits them before admitting accepted messages to the durable inbound spool. Gateway proxy settings determine whether forwarded addresses can safely distinguish clients behind a reverse proxy.

flowchart LR
  A[Nextcloud Talk] --> B[Reverse proxy]
  B --> C[Webhook listener]
  D[Gateway proxy policy] --> E[Resolve client bucket]
  C --> E
  E --> F{Rate limit and signature}
  F -->|Valid| G[Durable message spool]
  F -->|Invalid or limited| H[HTTP rejection]
Loading

Before merge

  • [P2] The listener now relies on the existing trusted-proxy contract: a configured proxy that preserves attacker-supplied X-Forwarded-For values can permit source spoofing and failed-authentication limiter evasion, as the Gateway documentation already warns.
  • [P2] The bug fix adds production +17/-2 lines; the net +15 growth is bounded typed plumbing for two existing configuration fields and the canonical resolver, rather than a duplicate policy path.
Review details

Best possible solution:

Retain the shared resolver's global fail-closed semantics and perform socket fallback only at the Nextcloud listener's non-authoritative rate-limit-key boundary; passing the two narrow fields is preferable to exposing the entire Gateway configuration.

Do we have a high-confidence way to reproduce the issue?

Yes: current main's socket-only key makes the shared-proxy failure source-reproducible, and the PR provides the concrete invalid-client, lockout, and valid-client request sequence through the production listener.

Is this the best way to solve the issue?

Yes: the local consumer fallback is the narrowest maintainable fix because changing the shared resolver to return a trusted proxy's socket address would weaken its fail-closed authentication contract.

AGENTS.md: found_applied

Codex review notes: model internal, reasoning high; reviewed against 88edcd1.

Label details

Label justifications:

  • P2: This is a bounded channel webhook availability bug affecting Nextcloud Talk deployments behind trusted reverse proxies.
  • merge-risk: 🚨 security-boundary: Merging expands trusted forwarded-client attribution into a failed-authentication limiter, so safe behavior depends on the documented trusted-proxy header-overwrite contract.
Evidence reviewed

PR surface:

Area Files Added Removed Net
Source 3 17 2 +15
Tests 2 123 19 +104
Docs 0 0 0 +0
Config 0 0 0 +0
Generated 0 0 0 +0
Other 0 0 0 +0
Total 5 140 21 +119
  • Current-main defect: Current main keys every Nextcloud Talk webhook behind a proxy by the direct socket address, so one client's failed signatures can lock out another client sharing that proxy.
  • Owner-boundary repair: The proposed listener uses the canonical trusted-proxy resolver, then falls back to the socket peer only for the rate-limit isolation key.
  • Configuration handoff: The monitor passes the two existing Gateway proxy-attribution settings into the plugin-owned webhook server without adding configuration keys or defaults.
  • Trusted-proxy contract: The shared resolver accepts forwarding headers only when the normalized socket peer matches gateway.trustedProxies and otherwise returns the direct address; unattributable trusted-proxy input remains undefined.
  • Invariant-sharing sibling: The SMS webhook already uses the same canonical resolver plus socket fallback specifically for rate-limit keys, supporting this as the established owner-boundary pattern.
  • Regression coverage: The tests exercise invalid and valid signed requests through the production HTTP listener with distinct forwarded clients, then verify that unattributed trusted proxies retain separate socket buckets.
  • Re-review continuity: The only post-review changes add the requested socket fallback and its two-proxy regression case; the other three changed files are unchanged from the previously reviewed head.
  • Feature history: Commit e403dec introduced the per-server failed-authentication limiter with the socket address as its key, establishing the regression provenance and original owner history.
  • Released behavior: Latest release v2026.7.1-2 contains the failed-authentication limiter and still keys it solely by the proxy socket address, so the fix has not shipped.
  • Dependency boundary: The patch depends on OpenClaw's Plugin SDK webhook-ingress helper and Node HTTP listener, not the Codex harness, runtime, or protocol; the Codex-specific inspection gate therefore does not apply.
  • Related-item check: The provided same-repository pull request 947 concerns unrelated Bird skill documentation; the NVIDIA tracking cross-reference is outside the same-repository cluster contract.

@pgondhi987

Copy link
Copy Markdown
Contributor Author

Behavior proof for exact head 836e20b98590e388813c822a09e9fb02ce7a49cb:

  • Real entry point: the Nextcloud Talk HTTP webhook listener, plus the monitor runtime's gateway-config handoff.
  • Fixed scenario: an invalidly signed forwarded client receives 401 and then 429; a different forwarded client with a valid signature receives 200 and reaches webhook admission.
  • Fail-closed scenario: when trusted proxies provide no usable forwarded identity, separate proxy socket addresses keep separate rate-limit buckets; one proxy's failures do not suppress a valid delivery through another.
  • Positive control: valid signed bursts from one source continue to receive 200.
  • Protected boundary: untrusted direct peers cannot select their bucket with forwarded headers; forwarded attribution is used only for configured trusted proxies, while missing attribution falls back to that proxy's direct socket.
  • Focused command: node scripts/run-vitest.mjs extensions/nextcloud-talk/src/monitor.replay.test.ts extensions/nextcloud-talk/src/monitor-runtime.abort.test.ts — 2 files and 14 tests passed.
  • Static validation: focused formatting, focused oxlint with --openclaw-focused-config, scoped production/test typechecks, and git diff --check passed.
  • Environment: local Linux HTTP listener and request-handler boundary. No live Nextcloud service or external reverse proxy was used; those resources were not required to exercise the repaired attribution and admission paths.

@pgondhi987

Copy link
Copy Markdown
Contributor Author

Verification before merge

  • Exact head: 836e20b98590e388813c822a09e9fb02ce7a49cb
  • Behavior: Nextcloud Talk webhook rate limits now use the canonical proxy-aware client IP resolver. Distinct forwarded clients behind a configured trusted proxy receive independent buckets, while requests without usable forwarding metadata retain the direct proxy socket as their fallback bucket.
  • Regression proof: the focused HTTP monitor test reproduced the shared-bucket failure before the fix. On this head, an invalid signed request reaches 429 without blocking a valid request from another forwarded client, and distinct proxy sockets remain isolated when forwarding metadata is unavailable.
  • Focused tests: node scripts/run-vitest.mjs extensions/nextcloud-talk/src/monitor.replay.test.ts extensions/nextcloud-talk/src/monitor-runtime.abort.test.ts — 2 files and 14 tests passed.
  • Static checks: focused formatting, extension-scoped production and test type checks, focused oxlint with --openclaw-focused-config, and git diff --check all passed.
  • Review: canonical local ClawSweeper review reached Platinum/B with zero findings. Both required local-diff security reviews completed with zero findings and affirmed that the change is sane, narrow, well designed, and complete for the repository security boundary.
  • Optional review stages: review-pr and autoreview were disabled for this run and were not invoked.
  • CI: 57 checks passed, 39 were skipped or neutral, and none failed or remained pending on this exact head.
  • Scope and risk: the change is confined to the Nextcloud Talk plugin, adds no config key or migration, and reuses the existing shared proxy-resolution contract. Regression risk is low. The owner-boundary fix is preferable to downstream retries or broader rate-limit exceptions.
  • Remaining proof gap: no live external Nextcloud server was available. The focused test exercises the real webhook monitor handler, signature validation, trusted-proxy configuration, forwarded headers, and rate-limit responses locally.

@pgondhi987
pgondhi987 merged commit 2020fc2 into openclaw:main Aug 19, 2026
21 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 20, 2026
…126251)

* fix(nextcloud-talk): isolate proxy webhook rate limits

* fix(nextcloud-talk): preserve proxy fallback buckets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: nextcloud-talk Channel integration: nextcloud-talk maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant