Skip to content

[2026.9.36] fix(security): scope patched MSAL to affected credential consumers - #187287

Merged
RomneyDa merged 3 commits into
extended-stable/2026.9.33from
security/scoped-msal-credentials-20261029
Oct 29, 2026
Merged

RomneyDa merged 3 commits into
extended-stable/2026.9.33from
security/scoped-msal-credentials-20261029

Conversation

@RomneyDa

Copy link
Copy Markdown
Member

Summary

Scope MSAL Node 7.1.1 only to affected Teams apps 2.1.0 and Azure Identity 4.13.3 consumers. Minimal lock regeneration and real-SDK regression. Unaffected 3.x/4.x consumers remain untouched.

Necessity and source

Extended stable resolves vulnerable MSAL 5.6.0 and 6.0.1, within GHSA-xcx6-jx8p-x3h5 (>=5.0.0-beta.0 <7.1.0). A mocked baseline demonstrates response-controlled routing entering attacker discovery, while 7.1.1 ignores it. This does not establish an end-to-end OpenClaw credential exploit: inspected production app/certificate token flows use client_credentials.

Microsoft upstream PR #8901, commit f550958586475dbfeb1cd44be14a2d653728850e, authored by Robbie-Microsoft, restricts instance-aware inputs and sanitizes authorization-code responses. This is an explicit local dependency integration, not a source cherry-pick. Regression preserved from aggregate 8e6f7bd by roboclaw-bot; requested RomneyDa trailer retained. Maintained consumer releases still request affected MSAL majors; selecting 7.1.1 avoids the too-new 7.1.2 release without weakening release-age gates.

Validation

31 tests passed, including real Teams/Azure adapters and synthetic malicious-routing checks. Full extension-test typecheck, focused lint, formatting, frozen install, dependency graph and diff checks pass. No live-tenant credentials used. Audit removes this advisory; unrelated findings remain.

Train and gates

Base extended-stable/2026.9.33 at e93b50a. Stable/beta adaptations are separate work. DRAFT, not RFR: full-context independent canonical review, required hosted checks and live-tenant/broader qualification remain outstanding.

The live GHSA-xcx6-jx8p-x3h5 range is >=5.0.0-beta.0 <7.1.0. This active extended-stable graph resolves Teams apps 2.1.0 to 5.6.0 and Azure Identity 4.13.3 to 6.0.1; do not force unaffected 3.x/4.x consumers across majors.

Use the mature 7.1.1 package containing Microsoft upstream fix f550958586475dbfeb1cd44be14a2d653728850e (AzureAD/microsoft-authentication-library-for-js#8901, Robbie-Microsoft). No upstream source was copied or cherry-picked. The scoped pnpm integration is local implementation; retain the real-SDK regression originally authored in aggregate 8e6f7bd by roboclaw-bot.

Co-authored-by: RomneyDa <[email protected]>
@clawsweeper

clawsweeper Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added channel: msteams Channel integration: msteams size: S labels Oct 29, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 29, 2026
@RomneyDa
RomneyDa marked this pull request as ready for review October 29, 2026 04:33
@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 29, 2026
@clawsweeper

clawsweeper Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

Pins MSAL Node 7.1.1 for two affected credential consumers and preserves those scoped overrides in managed npm installs.

Example: An extended-stable Teams installation uses @microsoft/teams.apps 2.1.0.

  • Before: The dependency resolves MSAL Node 5.6.0, within the advisory’s affected range.
  • After: It resolves MSAL Node 7.1.1 through both workspace and managed npm override policies.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The scoped implementation is useful and resolves the prior finding, but synthetic transport coverage does not satisfy the security-boundary proof requirement.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Extended-stable Teams installations resolve credential dependencies covered by a published information-disclosure advisory.
Reason: The maintainer-authored direction removes affected dependency resolutions while preserving consumer scope and the existing installer owner.

Merge readiness

⛔ Blocked before merge - 4 items remain

Keep open: this maintainer-authored security repair remains useful, and the previous scoped-pin finding is resolved; no definite introduced code defect was found.

Priority: P2
Reviewed head: d4b5d6ea76736b7576616bbf00741e9cdee5459e

Before merge

  • Add real behavior proof - Authority-chain proof required: supplied coverage runs Teams, Azure Identity, and MSAL against synthetic transports; provide redacted terminal output or logs using the actual HTTP client to show permitted redemption at the configured Microsoft authority and no credential-bearing request to attacker.invalid, removing API keys, IPs, phone numbers, and non-public endpoints. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Resolve security review attention item - No introduced bypass was identified, but the changed credential-routing boundary still needs final-effect qualification.
  • Resolve merge risk - The PR author must qualify the cross-major MSAL replacement at the credential-routing boundary before merge, including rejection of an attacker-controlled redemption destination.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

None.

Tests

  • Missing end-to-end proof: Missing are actual transport traces for allowed and attacker-directed redemption, plus shipped fresh-install and published-release upgrade runs preserving existing plugin state and local overrides.
Agent review details

How this fits together

Workspace dependency policy enters the managed npm override adapter, which writes installer manifests; Teams and Azure Identity then use the resolved MSAL dependency for token acquisition.

flowchart TD
A[Workspace overrides] --> B[pnpm dependency resolution]
A --> C[Managed npm override adapter]
C --> D[Plugin install manifest]
B --> E[Teams and Azure Identity]
D --> E
E --> F[MSAL token acquisition]
F --> G[Microsoft authority]
Loading

Technical review

Best possible solution:

Retain the scoped pins and shared npm translation, then qualify credential routing and installed-state compatibility on this release train.

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

The base lockfile establishes affected MSAL resolutions and upstream confirms the vulnerable authorization-code contract; this does not reproduce an OpenClaw credential exploit.

Is this the best way to solve the issue?

Exact-consumer pins plus translation in the existing override producer address both installation paths without globally upgrading unrelated consumers.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against e125921a28eb.

Merge-risk options

Maintainer options:

  1. Qualify the credential boundary (recommended)
    The PR author should provide actual HTTP-boundary evidence for permitted redemption and attacker-routing rejection before merge.

Provenance checked

  • Managed npm override normalization changes intended behavior with a stated reason (e00d46b: Normalize unsupported pnpm selectors before npm planning to prevent parser failures and stale peer retention.)
  • Managed override ownership and manifest lifecycle keeps the original intent (5d55717: Apply host security overrides to external plugin roots and track owned keys so later updates preserve unrelated local overrides.)

Testing

Proof path: in-process harness.

Security

Needs attention: No introduced bypass was identified, but the changed credential-routing boundary still needs final-effect qualification.

Evidence

What I checked:

  • Pinned introduction and resolved prior finding: The introduced diff adds exact-parent MSAL pins and translates supported selectors into nested npm overrides without retaining a competing implementation. (src/infra/npm-managed-root-overrides.ts:48, d4b5d6ea7673)
  • Current main still contains affected dependencies: Current main resolves MSAL Node 5.6.0 and 6.0.1, although its Teams and Azure Identity consumer versions differ from this extended-stable train. (pnpm-lock.yaml:3654, e125921a28eb)
  • Authoritative dependency security contract: The patch directly changes the MSAL dependency used by credential consumers, making its contract relevant: GHSA-xcx6-jx8p-x3h5 affects authorization-code flows in versions >=5.0.0-beta.0 <7.1.0; Robbie-Microsoft’s upstream fix sanitizes response-controlled routing before redemption. (lib/msal-node/src/client/ConfidentialClientApplication.ts, f55095858647)
  • Supplied proof uses synthetic transports: The Teams test replaces fetch, the Azure test injects sendRequest, and the malicious-routing tests replace MSAL’s network client; the complete PR body and contributor comments supply no final HTTP-boundary artifact. (extensions/msteams/src/sdk.msal-compat.test.ts:113, d4b5d6ea7673)
  • Existing normalization intent: The earlier producer repair deliberately removed pnpm-only selectors before npm planning while preserving compatible rules; this PR explains its narrower change by translating exact-parent rules into npm-supported syntax. (src/infra/npm-managed-root.ts:273, e00d46b19b63)
  • Exact-head check state: All returned checks for the reviewed head are successful or skipped, and GitHub reports a clean merge; these checks do not establish credential-boundary behavior. (d4b5d6ea7673)

Likely related people:

  • Vincent Koc: Raw commit 5d55717 adds src/infra/npm-managed-root.ts:158 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 5d557171b3cd; files: src/infra/npm-managed-root.ts)
  • Peter Steinberger: Raw commit 7f0781f adds src/infra/npm-managed-root.ts:156 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 7f0781faa67d; files: src/infra/npm-managed-root.ts)
  • wangyan2026: Raw commit e00d46b adds src/infra/npm-managed-root.ts:315 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: e00d46b19b63; files: src/infra/npm-managed-root.ts)

PR surface

Source +29, Tests +254, Config +2, Other -7. Total +278 across 6 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 2 72 43 +29
Tests 2 254 0 +254
Docs 0 0 0 0
Config 1 2 0 +2
Generated 0 0 0 0
Other 1 12 19 -7
Total 6 340 62 +278

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The train resolves dependencies covered by a published advisory, but the inspected OpenClaw app-token flows use client credentials and no end-to-end exploit is established.
  • merge-risk: 🚨 security-boundary: The dependency replacement changes authorization-response routing protection, and final credential-destination behavior remains unqualified.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rank-up moves

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

  • Add final-effect proof that the actual HTTP client redeems at the configured Microsoft authority and sends no credential-bearing request to attacker.invalid.
  • Show fresh installation and upgrade from the latest published release applicable to this train, preserving plugin state and local overrides while resolving MSAL 7.1.1.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-29T04:42:51.297Z sha ea375ff :: needs real behavior proof before merge. :: [P2] [P2] Preserve the scoped MSAL pins in managed npm installs

Reviewed October 29, 2026, 2:36 AM ET / 06:36 UTC (Revision 2).

@RomneyDa RomneyDa changed the title fix(security): scope patched MSAL to affected credential consumers [2026.9.36] fix(security): scope patched MSAL to affected credential consumers Oct 29, 2026
@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 29, 2026
@RomneyDa
RomneyDa merged commit a768c14 into extended-stable/2026.9.33 Oct 29, 2026
221 checks passed
@RomneyDa
RomneyDa deleted the security/scoped-msal-credentials-20261029 branch October 29, 2026 06:42
RomneyDa added a commit that referenced this pull request Oct 29, 2026
Align extended-stable installer coverage with the exact-parent override normalization from #187287. Keep strict first-install ownership and alias-free retry assertions.

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
Release adaptation: carry the npm companion from #187287 onto the existing stable override owner. Translate exact-parent, unversioned-child selectors without widening other scopes or carrying the donor’s old dependency graph. #187294 contains the equivalent companion; no separate pick is needed.

(cherry picked from commit a768c14)

Co-authored-by: RomneyDa <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
Release adaptation: target Teams Apps 2.1.1 and MSAL 7.1.2, already used by Azure Identity. Keep Azure Identity and other selectors unchanged. Verify the installed SDK edge and normal client-credentials token acquisition using synthetic HTTP fixtures.

Companion audit: the release-only donor and sibling carriers are outside the pinned main scan; exact PR and topic searches found no main follow-up. This branch carries the managed npm translation from #187287; #187294 is equivalent. The beta carrier c0b1a23 confirms the same scoped version and needs no separate pick.

(cherry picked from commit ea375ff)

Co-authored-by: RomneyDa <[email protected]>
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. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: M 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.

2 participants