Skip to content

fix(msteams): require dot boundary for shared-link host suffix match - #123046

Merged
sallyom merged 3 commits into
openclaw:mainfrom
wanyongstar:fix/msteams-attachment-host-boundary
Aug 23, 2026
Merged

sallyom merged 3 commits into
openclaw:mainfrom
wanyongstar:fix/msteams-attachment-host-boundary

Conversation

@wanyongstar

@wanyongstar wanyongstar commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

fix(msteams): require a dot boundary when matching OneDrive/SharePoint shared-link host suffixes, so look-alike hosts like evil1drv.ms or notonedrive.com are no longer rewritten to the Graph shares endpoint

What Problem This Solves

When an MSTeams attachment URL points at a OneDrive/SharePoint shared link, the downloader rewrites it to the Graph /shares/{shareId}/driveItem/content endpoint instead of fetching it directly. The classifier decides this by matching the URL host against a suffix list (1drv.ms, onedrive.com, onedrive.live.com, .sharepoint.com, ...).

代码证据: in extensions/msteams/src/attachments/shared.ts, isGraphSharedLinkUrl used:

GRAPH_SHARED_LINK_HOST_SUFFIXES.some((suffix) => host === suffix || host.endsWith(suffix))

For the bare (non-dot-prefixed) suffixes this has no label boundary: evil1drv.ms.endsWith(1drv.ms) and notonedrive.com.endsWith(onedrive.com) are both true.

The impact is not just misclassification: tryBuildGraphSharesUrlForSharedLink base64url-encodes the attacker-controlled URL into a Graph /shares/ API path, so a look-alike host gets its content fetched through the Graph shares flow (with Graph credentials attached) instead of being treated as an ordinary external download.

Trigger condition: any attachment URL whose host ends with the literal string 1drv.ms, onedrive.com, or onedrive.live.com without being those hosts or their subdomains.

Root Cause

  • Violated invariant: the shared-link rewrite is an authentication-boundary decision (content is fetched via the Graph API with its auth context), but the host check was a raw suffix match.
  • The suffix list mixes dot-prefixed entries (.sharepoint.com, which carry their own boundary) with bare entries (1drv.ms, onedrive.com, onedrive.live.com, which do not), and the matcher treated both forms identically.

Why This Fix

  • Option A: rewrite the suffix list so every entry is dot-prefixed and keep host === suffix || host.endsWith(suffix). Works, but loses the exact-host matches for 1drv.ms/onedrive.com apex hosts unless extra entries are added.
  • Option B (chosen): keep the list as-is and make the matcher boundary-aware: host === suffix || host.endsWith(suffix.startsWith(".") ? suffix : "." + suffix). Bare suffixes now require a dot boundary for subdomain matches while exact matches still pass; dot-prefixed entries behave exactly as before.
  • Not chosen: switching to a full allowlist of known hosts — the SharePoint tenant space (*.sharepoint.com etc.) is intentionally open-ended.

User Impact

  • Affected scenarios: MSTeams attachments whose URL host is a look-alike of a OneDrive host (e.g. https://notonedrive.com/x, https://evil1drv.ms/x, https://fakeonedrive.live.com/x).
  • Before: such URLs were treated as shared links and rewritten to https://graph.microsoft.com/v1.0/shares/u!<base64url(attacker-url)>/driveItem/content.
  • After: only genuine OneDrive/SharePoint hosts (exact or proper subdomains) are rewritten; look-alikes fall through to the normal download path.
  • Behavior change: legitimate shared links (https://1drv.ms/b/s!..., https://onedrive.live.com/view.aspx?..., https://contoso.sharepoint.com/...) are unaffected.

Evidence

  • Behavior or issue addressed: look-alike hosts sharing OneDrive suffixes were classified as shared links and rewritten to the Graph shares endpoint.
  • Real environment tested: worktree wt-msteams-attachment-host-boundary on latest origin/main, running the real exported tryBuildGraphSharesUrlForSharedLink from extensions/msteams/src/attachments/shared.ts via tsx. No mocks: this is a pure URL-classification function.
  • Exact steps or command run after this patch:
    $ node node_modules/tsx/dist/cli.mjs msteams-attachment-host-boundary.proof.mjs
    $ npx vitest run extensions/msteams/src/attachments/shared.test.ts
  • Evidence after fix (8/8 PASS):
    PASS https://notonedrive.com/x -> shared-link=false
    PASS https://evil1drv.ms/x -> shared-link=false
    PASS https://fakeonedrive.live.com/x -> shared-link=false
    PASS https://evilsharepoint.com/x -> shared-link=false
    PASS https://contoso.sharepoint.com/x -> shared-link=true
    PASS https://onedrive.com/share/abc -> shared-link=true
    PASS https://1drv.ms/b/s!AkxYabc -> shared-link=true
    PASS https://onedrive.live.com/view.aspx?resid=ABC -> shared-link=true
    RESULT: ALL PASS

Before (on main, same script, exit code 1):

FAIL https://notonedrive.com/x -> shared-link=true rewritten=https://graph.microsoft.com/v1.0/shares/u!aHR0cHM6Ly9ub3RvbmVkcml2ZS5jb20veA/driveItem/content
FAIL https://evil1drv.ms/x -> shared-link=true rewritten=https://graph.microsoft.com/v1.0/shares/u!aHR0cHM6Ly9ldmlsMWRydi5tcy94/driveItem/content
FAIL https://fakeonedrive.live.com/x -> shared-link=true rewritten=...
RESULT: 3 FAILURES (bug present)
  • What was not tested: a live Microsoft tenant call. That is not required for this deterministic pre-I/O routing boundary; the production downloader test uses mocked network I/O to observe the selected URL and token behavior.

Real Behavior Proof

Maintainer validation ran the real production downloadMSTeamsAttachments path at exact head 5f6c0f00bde747f8b459f4cdb403f294ba81da3e in fresh sanitized AWS Crabbox leases. Both used --no-hydrate; the trusted bootstrap verified no instance-role credentials, and each lease had public networking with no Tailscale. Fail-fast sentinels covered injected/global fetch, Graph request, DNS resolution, and token-provider boundaries.

HTTP trusted-host rejection (run run_8ab7c935e8e7):

{"head":"5f6c0f00bde747f8b459f4cdb403f294ba81da3e","input":"http://onedrive.com/direct.pdf","networkRequests":0,"graphRequests":0,"dnsResolutions":0,"tokenRequests":0,"media":[{"kind":"document","hasPath":false}],"result":"rejected-before-io"}

HTTPS look-alike rejection under the real default attachment policy, with no allowlist overrides (run run_b2af35a5d7ab):

{"head":"5f6c0f00bde747f8b459f4cdb403f294ba81da3e","policy":"default","input":"https://notonedrive.com/direct.pdf","networkRequests":0,"graphRequests":0,"dnsResolutions":0,"tokenRequests":0,"media":[{"kind":"document","hasPath":false}],"result":"rejected-before-io"}

Both commands exited 0 with empty stderr, proving the forbidden inputs stop before Graph dispatch, DNS/network I/O, or token acquisition.

Tests and Validation

  • npx vitest run extensions/msteams/src/attachments/shared.test.ts — 56/56 passed, including new regression cases in the isGraphSharedLinkUrl matrix: notonedrive.com, evil1drv.ms, fakeonedrive.live.com, and evilsharepoint.com all classify as non-shared-link.
  • npx oxlint --deny=warn on both changed files — 0 warnings, 0 errors.
  • Before/after real-behavior proof logs are embedded above.

Regression Test Plan

  • Coverage level: unit test on the real exported classifier (existing it.each matrix in the test file).
  • Target test file: extensions/msteams/src/attachments/shared.test.ts
  • Scenario locked in: suffix-sharing look-alike hosts never classify as shared links, while legitimate OneDrive/SharePoint hosts (apex and subdomains) still do.
  • Why this is the smallest reliable guardrail: it pins the exact matcher that gates the Graph shares rewrite, using the exact look-alike inputs that previously passed.

@clawsweeper

clawsweeper Bot commented Aug 13, 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: msteams Channel integration: msteams size: XS labels Aug 13, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. 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 13, 2026
@clawsweeper

clawsweeper Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 22, 2026, 9:40 PM ET / August 23, 2026, 01:40 UTC.

ClawSweeper review

What this changes

The PR makes Microsoft Teams shared-link detection require HTTPS and a DNS-label boundary before routing an attachment through authenticated Microsoft Graph downloads.

Regression provenance

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

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this PR open for normal merge handling. Current main still uses the unsafe raw suffix check; the PR’s HTTPS and label-boundary predicate is the narrow compatible repair, and the prior matcher/proof blockers are addressed.

Priority: P1
Reviewed head: 5f6c0f00bde747f8b459f4cdb403f294ba81da3e

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused security repair with direct classifier and downloader coverage plus exact-head production-path rejection proof.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR body provides exact-head production-owner traces for both an HTTPS look-alike and an HTTP trusted host, each rejected before Graph dispatch, token acquisition, DNS, or network I/O.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body provides exact-head production-owner traces for both an HTTPS look-alike and an HTTP trusted host, each rejected before Graph dispatch, token acquisition, DNS, or network I/O.
Evidence reviewed 7 items Current-main defect: Current main accepts any hostname ending in a listed suffix, so bare entries such as onedrive.com have no DNS-label boundary.
Owner boundary and caller: Attachment resolution rewrites a positive match to Graph, and the downloader subsequently retries authenticated requests only for auth-allowlisted URLs.
Narrow compatible predicate: The patch parses once, rejects non-HTTPS URLs, and requires a dot before bare suffixes while preserving the existing dotted SharePoint subdomain-only entries.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs extensions/msteams/src/attachments/shared.test.ts

Result: FAIL (partial) — step 2 expect_output Graph shared-link helpers: expected terminal output was not visible within 30 seconds: "Graph shared-link helpers"

node scripts/run-vitest.mjs extensions/msteams/src/attachments/shared.test.ts
runner@runnervm76f27:/tmp/clawsweeper-live-proof-123046-aFjIad/target$ node scripts/run-vitest.mjs extensions/msteams/src/attachments/shared.test.ts
node scripts/run-vitest.mjs extensions/msteams/src/attachments/shared.test.ts
[test] starting test/vitest/vitest.extension-msteams.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-123046-aFjIad/target

 ✓  extension-msteams  extensions/msteams/src/attachments/shared.test.ts (57 tests) 214ms

 Test Files  1 passed (1)
      Tests  57 passed (57)
   Start at  01:41:25
   Duration  3.61s (transform 2.58s, setup 973ms, import 2.07s, tests 214ms, environment 0ms)

[test] passed 1 Vitest shard in 9.59s
runner@runnervm76f27:/tmp/clawsweeper-live-proof-123046-aFjIad/target$ node scripts/run-vitest.mjs extensions/msteams/src/attachments/shared.test.ts
[test] starting test/vitest/vitest.extension-msteams.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-123046-aFjIad/target

 ✓  extension-msteams  extensions/msteams/src/attachments/shared.test.ts (57 tests) 165ms

 Test Files  1 passed (1)
      Tests  57 passed (57)
   Start at  01:41:35
   Duration  1.92s (transform 838ms, setup 450ms, import 1.08s, tests 165ms, environment 0ms)

[test] passed 1 Vitest shard in 7.94s
runner@runnervm76f27:/tmp/clawsweeper-live-proof-123046-aFjIad/target$






















Assertions:

  • FAIL expect_output: Graph shared-link helpers

How this fits together

Microsoft Teams attachment handling classifies OneDrive and SharePoint URLs before choosing the authenticated Microsoft Graph shares endpoint or ordinary attachment handling. This predicate controls whether Graph token acquisition and Graph I/O can be reached.

flowchart LR
  A[Teams attachment URL] --> B[URL parsing]
  B --> C[HTTPS and host-boundary check]
  C -->|trusted shared link| D[Graph shares route]
  C -->|not a shared link| E[Attachment policy]
  D --> F[Graph token and download]
  E --> G[Normal attachment result]
Loading

Before merge

  • Resolve merge risk (P1) - The changed predicate is an authentication-routing boundary; future consolidation must retain the dotted SharePoint entries as subdomain-only rather than normalizing them into apex-or-subdomain allowlist entries.
  • Resolve merge risk (P1) - Production code is net +4 lines; that growth is justified by the explicit HTTPS and DNS-label checks, and a net-neutral rewrite would obscure the distinct compatibility rule.
Agent review details

Security

None.

PR surface

Source +4, Tests +34. Total +38 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 8 4 +4
Tests 2 40 6 +34
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 48 10 +38

Review metrics

Metric Value Why it matters
Production versus test LOC production +8/-4 (net +4); tests +40/-6 (net +34) The small production increase implements the security boundary, while most change is focused regression coverage at classifier and downloader boundaries.

Merge-risk options

Maintainer options:

  1. Merge the bounded routing repair (recommended)
    Keep the local dotted-suffix treatment and merge after the usual exact-head CI and GitHub mergeability gates.

Technical review

Best possible solution:

Retain the local parse-once predicate, merge it through normal exact-head gates, and preserve its tests for both trusted shared links and suffix-sharing look-alikes.

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

Yes. Current main's raw suffix predicate accepts the named look-alike hosts, while the exact-head classifier and downloader tests cover their rejection before Graph routing.

Is this the best way to solve the issue?

Yes. The local predicate is the narrowest maintainable fix because the shared hostname helper would erase the meaningful dotted SharePoint distinction and alter apex-host behavior.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides exact-head production-owner traces for both an HTTPS look-alike and an HTTP trusted host, each rejected before Graph dispatch, token acquisition, DNS, or network I/O.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster. Replaced prior rating: 🦐 gold shrimp.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P1: Current main can route a look-alike attachment URL into the authenticated Graph shares flow.
  • merge-risk: 🚨 security-boundary: The changed URL classifier determines whether untrusted attachment input can reach Graph token acquisition and authenticated I/O.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster. Replaced prior rating: 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Sufficient (live_output): The PR body provides exact-head production-owner traces for both an HTTPS look-alike and an HTTP trusted host, each rejected before Graph dispatch, token acquisition, DNS, or network I/O.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides exact-head production-owner traces for both an HTTPS look-alike and an HTTP trusted host, each rejected before Graph dispatch, token acquisition, DNS, or network I/O.

Evidence

What I checked:

Likely related people:

  • sallyom: Authored the exact-head HTTPS repair and the production-path routing test, and recorded the compatible local-matcher decision. (role: recent area contributor; confidence: high; commits: 8eedf44ab6eb, 5f6c0f00bde7; files: extensions/msteams/src/attachments.test.ts, extensions/msteams/src/attachments/shared.ts)
  • Peter Steinberger: Current-main blame attributes the raw shared-link classifier and suffix list to the available main-history commit; predecessor history is incomplete locally. (role: current-main line attribution; confidence: medium; commits: 963fafbb1652; files: extensions/msteams/src/attachments/shared.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.

History

Review history (10 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-19T11:51:42.303Z sha 6c6a963e7e265ad1b9c870c6cfea26987a930533 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-22T20:33:43.683Z sha d29aebe982cc9e25c5398199a73acdd46c87b52a :: needs maintainer review before merge. :: none
  • reviewed 2026-08-22T20:44:43.516Z sha d29aebe982cc9e25c5398199a73acdd46c87b52a :: needs changes before merge. :: [P2] Preserve subdomain-only SharePoint matching
  • reviewed 2026-08-22T22:03:50.516Z sha 6c6a963e7e265ad1b9c870c6cfea26987a930533 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-22T22:35:02.510Z sha 629ccfa0eef2a1043cb003ae5fa0eb69b185036f :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-22T23:11:19.049Z sha 629ccfa0eef2a1043cb003ae5fa0eb69b185036f :: needs real behavior proof before merge. :: [P1] Reject non-HTTPS links before Graph shares routing
  • reviewed 2026-08-22T23:53:13.036Z sha 5f6c0f0 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-23T01:15:19.440Z sha 5f6c0f0 :: needs real behavior proof before merge. :: [P2] Reuse the canonical HTTPS suffix matcher

@sallyom sallyom self-assigned this Aug 22, 2026
@sallyom

sallyom commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

Update: I removed the maintainer refactor after hosted review identified that it changed SharePoint apex-host routing. The branch is back to the contributor's original narrow boundary fix at 6c6a963e; fresh exact-head CI and ClawSweeper are running.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed 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 22, 2026
@sallyom
sallyom force-pushed the fix/msteams-attachment-host-boundary branch from d29aebe to 6c6a963 Compare August 22, 2026 21:57
@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 22, 2026
@sallyom
sallyom force-pushed the fix/msteams-attachment-host-boundary branch from 6c6a963 to 629ccfa Compare August 22, 2026 22:29
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 22, 2026
wanyongstar and others added 3 commits August 22, 2026 19:30
Look-alike hosts such as evil1drv.ms, notonedrive.com, or
fakeonedrive.live.com satisfied the bare endsWith() check in
isGraphSharedLinkUrl and were rewritten to the Graph shares endpoint.
Match bare suffixes on a label boundary instead: exact host or a
dot-prefixed suffix.
@sallyom
sallyom force-pushed the fix/msteams-attachment-host-boundary branch from 629ccfa to 5f6c0f0 Compare August 22, 2026 23:47
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 22, 2026
@sallyom

sallyom commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Maintainer decision: declining the P2 canonical-matcher change.

  • The canonical helper treats normalized suffix entries as apex-or-subdomain, while this classifier intentionally keeps .sharepoint.* entries subdomain-only. Passing the dotted entries directly would reject valid tenant hosts; normalizing them would newly admit SharePoint apex hosts. This would recreate the regression from the earlier reverted maintainer commit.
  • The current parse-once HTTPS and label-boundary predicate is therefore the narrow compatible fix.
  • I also added exact-head default-policy proof for https://notonedrive.com/direct.pdf

@sallyom sallyom added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 23, 2026
@sallyom

sallyom commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Maintainer landing review complete for exact head 5f6c0f00bde747f8b459f4cdb403f294ba81da3e.

  • Best fix: keep the parse-once HTTPS and DNS-label-boundary predicate; it preserves the dotted SharePoint subdomain-only contract that the generic helper would erase.
  • Exact-head CI: openclaw/ci-gate run 32606160409 passed.
  • Focused verification: node scripts/run-vitest.mjs extensions/msteams/src/attachments/shared.test.ts passed 57/57 twice in the latest ClawSweeper run.
  • Production-owner proof: sanitized AWS Crabbox runs run_8ab7c935e8e7 and run_b2af35a5d7ab show the HTTP trusted host and default-policy HTTPS look-alike both stop with zero Graph, token, DNS, or network calls.
  • Fresh pre-land review: .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main reported no accepted/actionable findings (0.99 correctness confidence).

No live Microsoft tenant call was made because the changed deterministic boundary must reject before external I/O; the exact-head production-downloader traces cover that final effect directly. ClawSweeper now reports proof sufficient and no findings. Proceeding through the native exact-merge gates.

@sallyom
sallyom merged commit a38b88a into openclaw:main Aug 23, 2026
128 checks passed
@sallyom

sallyom commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 23, 2026
…penclaw#123046)

* fix(msteams): require dot boundary for shared-link host suffix match

Look-alike hosts such as evil1drv.ms, notonedrive.com, or
fakeonedrive.live.com satisfied the bare endsWith() check in
isGraphSharedLinkUrl and were rewritten to the Graph shares endpoint.
Match bare suffixes on a label boundary instead: exact host or a
dot-prefixed suffix.

* test(msteams): cover lookalike download routing

* fix(msteams): require https for shared links

---------

Co-authored-by: sallyom <[email protected]>
Rorqualx pushed a commit to Rorqualx/cortex that referenced this pull request Aug 23, 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 merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants