Skip to content

fix: Teams Graph and media work with RFC2544 proxy DNS#107164

Open
galiniliev wants to merge 3 commits into
openclaw:mainfrom
galiniliev:bug-055-msteams-rfc2544-policy
Open

fix: Teams Graph and media work with RFC2544 proxy DNS#107164
galiniliev wants to merge 3 commits into
openclaw:mainfrom
galiniliev:bug-055-msteams-rfc2544-policy

Conversation

@galiniliev

Copy link
Copy Markdown
Contributor

Closes #107163

What Problem This Solves

Fixes an issue where Microsoft Teams plugin users in host-proxied deployments could have Graph requests and media downloads blocked when DNS resolves allowed external hosts to RFC2544 fake-IP addresses before egress interception.

Why This Change Was Made

The Teams plugin now passes a host-scoped SSRF policy with allowRfc2544BenchmarkRange for known Microsoft Graph hosts, and media downloads add the same RFC2544 opt-in only when the configured media host suffixes produce an actual hostname allowlist. The change stays in the Teams plugin boundary and does not allow arbitrary private-network targets.

User Impact

Teams Graph-backed operations and attachment/media handling can work in RFC2544 fake-IP proxy environments while keeping the existing hostname restrictions for Graph and media URLs.

Evidence

Behavior addressed: Microsoft Teams Graph and media guarded fetches rejected RFC2544 fake-IP DNS results before host-proxied egress could intercept the request.

Real environment tested: Local OpenClaw worktree with the Microsoft Teams extension Vitest config. Remote Blacksmith Testbox was attempted but blocked because the installed Crabbox binary reported version 0.12.0, while this repo requires Crabbox >=0.22.0 for the Blacksmith Testbox provider.

Exact steps or command run after this patch: node scripts/run-vitest.mjs extensions/msteams/src/graph.test.ts extensions/msteams/src/attachments/shared.test.ts and git diff --check.

Evidence after fix:

[test] starting test/vitest/vitest.extension-msteams.config.ts

 RUN  v4.1.9 /home/galini/GitHub/worktrees/bug-055-msteams-rfc2544-policy


 Test Files  2 passed (2)
      Tests  78 passed (78)
   Start at  05:21:03
   Duration  11.99s (transform 7.89s, setup 887ms, import 12.32s, tests 342ms, environment 0ms)

[test] passed 1 Vitest shard in 17.34s

Observed result after fix: The focused Teams tests pass, including assertions that relative Graph requests and absolute Graph pagination URLs carry a Graph-host-scoped RFC2544 policy, non-Graph absolute URLs do not receive that policy, media suffix allowlists add the RFC2544 opt-in, and wildcard media allowlists still return no SSRF policy.

What was not tested: No live Microsoft Teams tenant or host-proxied container was available, and no raw failed gateway run was present in the bug bundle. Remote Testbox proof was blocked by the local Crabbox version mismatch described above.

Before evidence:

Current-main source proof before the patch:
extensions/msteams/src/graph.ts requestGraph called fetchWithSsrFGuard without a policy.
extensions/msteams/src/graph.ts fetchGraphAbsoluteUrl called fetchWithSsrFGuard without a policy.
extensions/msteams/src/attachments/shared.ts resolveMediaSsrfPolicy returned only buildHostnameAllowlistPolicyFromSuffixAllowlist(allowHosts).

@openclaw-barnacle openclaw-barnacle Bot added channel: msteams Channel integration: msteams size: S maintainer Maintainer-authored PR labels Jul 14, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 14, 2026
@clawsweeper

clawsweeper Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 25, 2026, 4:33 PM ET / 20:33 UTC.

ClawSweeper review

What this changes

The PR adds host-scoped RFC2544 benchmark-range SSRF exceptions for Microsoft Graph requests and allowlisted Microsoft Teams media downloads, with focused regression assertions.

Merge readiness

Blocked until real behavior proof from a real setup is added - 4 items remain

Keep this PR open. The patch stays within the Microsoft Teams plugin and appears to preserve hostname restrictions while permitting the RFC2544 range only for approved Graph or media hosts, but it still has no after-fix host-proxy or Teams runtime evidence; focused Vitest output is supplemental only. The existing maintainer and security-boundary signals also require a human merge decision after that proof is supplied.

Priority: P2
Reviewed head: 371e707170b2309eff26bc7f3f8446c57f73265b
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation is focused and regression-tested, but the missing real proxy-runtime proof remains a merge gate for this security-boundary change.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR provides focused Vitest output and source assertions, but it explicitly lacks an after-fix Teams or host-proxy runtime run; add redacted live output, logs, or a reproducible proxy validation transcript before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR provides focused Vitest output and source assertions, but it explicitly lacks an after-fix Teams or host-proxy runtime run; add redacted live output, logs, or a reproducible proxy validation transcript before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 4 items Current-main behavior: Current main sends Graph requests through the guarded fetch without a policy, and its media policy is only the hostname suffix allowlist; RFC2544 results therefore remain blocked by the default guard.
Proposed security boundary: The branch restricts the RFC2544 exception to an exact Microsoft Graph hostname allowlist and to media policies that already have a concrete hostname allowlist; wildcard media allowlists remain policy-free.
Regression coverage: The branch adds assertions for relative Graph requests, absolute Graph pagination URLs, non-Graph absolute URLs, and media suffix allowlists. The PR body reports 78 focused tests passing, but also explicitly states that no live Teams tenant or host-proxied runtime was tested.
Findings None None.
Security None None.

How this fits together

The Microsoft Teams plugin makes guarded outbound requests to Microsoft Graph and approved attachment hosts. Its SSRF policy validates the resolved destination before the request proceeds, so the policy controls whether proxied DNS results can reach the configured egress path.

flowchart LR
  A[Teams operation or attachment] --> B[Teams plugin request builder]
  B --> C[Approved Graph or media host]
  C --> D[Host-scoped SSRF policy]
  D --> E[DNS resolution and proxy egress]
  E --> F[Microsoft Graph or media response]
  F --> G[Teams plugin result]
Loading

Decision needed

Question Recommendation
After a real host-proxy run demonstrates the intended behavior, should OpenClaw accept this narrowly host-scoped RFC2544 exception for the Teams plugin? Require proxy-runtime proof, then accept the narrow exception: Obtain redacted evidence for Graph and media traffic through the intended host proxy, then merge only if the hostname-scoped boundary remains intact.

Why: The code changes a security boundary: whether RFC2544 proxy DNS is an acceptable exception for approved Microsoft endpoints is a maintainer policy decision, not something focused mocks can settle.

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR provides focused Vitest output and source assertions, but it explicitly lacks an after-fix Teams or host-proxy runtime run; add redacted live output, logs, or a reproducible proxy validation transcript before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - Merging relaxes a reserved-address SSRF check for selected external hostnames; a real host-proxy run must confirm the exception reaches the intended egress interceptor without broadening access beyond those hosts.
  • Resolve merge risk (P1) - The branch is behind current main, so the exact head should be rebased or its merge result refreshed after real behavior proof is added.
Agent review details

Security

None.

PR surface

Source +27, Tests +41. Total +68 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 31 4 +27
Tests 2 42 1 +41
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 73 5 +68

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #107163
Summary: This PR is the explicit candidate fix for the linked RFC2544 Teams Graph/media bug; it should remain open until the candidate is proven and merged.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Add real proxy-runtime proof before merge (recommended)
    Run a redacted Teams Graph request and an allowlisted media download with approved names resolving into RFC2544 through the host proxy, while confirming an unapproved hostname remains blocked.
  2. Accept the boundary change without live proof
    Maintainers may explicitly accept the focused test coverage as sufficient, while owning the remaining uncertainty about the deployed proxy path.

Technical review

Best possible solution:

Retain the narrow Teams-plugin policy design, add redacted after-fix evidence from an RFC2544 DNS plus host-proxy deployment for both a Graph request and an allowlisted media download, then review the rebased merge result.

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

No, not at runtime. The source path and focused mocks clearly establish where RFC2544 DNS results are rejected, but neither the issue nor this PR provides a current after-fix Teams or host-proxy execution.

Is this the best way to solve the issue?

Yes, conditionally. Keeping the exception in the Teams plugin and binding it to existing hostname restrictions is the narrow maintainable fix, provided real proxy-path evidence confirms the security boundary.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded Microsoft Teams integration failure affecting host-proxied deployments rather than a broad core-runtime outage.
  • merge-risk: 🚨 security-boundary: The patch intentionally permits a normally blocked RFC2544 DNS range for selected external hostnames, so the security exception needs deployment-level confirmation.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR provides focused Vitest output and source assertions, but it explicitly lacks an after-fix Teams or host-proxy runtime run; add redacted live output, logs, or a reproducible proxy validation transcript before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Current-main behavior: Current main sends Graph requests through the guarded fetch without a policy, and its media policy is only the hostname suffix allowlist; RFC2544 results therefore remain blocked by the default guard. (extensions/msteams/src/graph.ts:69, d8f099ebede3)
  • Proposed security boundary: The branch restricts the RFC2544 exception to an exact Microsoft Graph hostname allowlist and to media policies that already have a concrete hostname allowlist; wildcard media allowlists remain policy-free. (extensions/msteams/src/graph.ts:19, 371e707170b2)
  • Regression coverage: The branch adds assertions for relative Graph requests, absolute Graph pagination URLs, non-Graph absolute URLs, and media suffix allowlists. The PR body reports 78 focused tests passing, but also explicitly states that no live Teams tenant or host-proxied runtime was tested. (extensions/msteams/src/graph.test.ts:235, 371e707170b2)
  • Related bug ownership: The PR explicitly links the matching Teams RFC2544 bug report, which remains open until this candidate fix is reviewed and merged. (371e707170b2)

Likely related people:

  • giodl73-repo: Authored the two latest commits on this PR, including the policy refinement and resolver-test adjustment; current-main provenance was not sufficient to identify a stronger historical owner in this read-only review. (role: recent contributor on the proposed Teams SSRF-policy path; confidence: low; commits: 8eb7605b2dfb, 371e707170b2; files: extensions/msteams/src/graph.ts, extensions/msteams/src/attachments/shared.ts, extensions/msteams/src/graph.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add redacted after-fix Graph and media evidence from an RFC2544 DNS plus host-proxy setup.
  • Refresh the branch against current main after the runtime proof is added.

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.

History

Review history (2 earlier review cycles)
  • reviewed 2026-07-14T11:09:32.808Z sha 5e85d3a :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-25T18:29:11.484Z sha 8eb7605 :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. label Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: msteams Channel integration: msteams maintainer Maintainer-authored PR merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Teams Graph/media guarded fetches reject RFC2544-proxied hosts

2 participants