The vulnerability, identified as GHSA-gc9r-867r-j85f, lies in the openclaw package's handling of Microsoft Teams SSO invoke activities. The core issue is a missing authorization check. By analyzing the provided patch commit 80b1fa17bfc3f6a668492f0326ea52f48bb89776, I identified the exact location of the fix.
The patch modifies extensions/msteams/src/monitor-handler.ts. The function registerMSTeamsHandlers is responsible for setting up activity handlers. Inside this function, the onInvoke handler for SSO activities (signin/tokenExchange, signin/verifyState) was missing a crucial step. It would proceed with the SSO flow without first checking if the sender was on the configured allowlist.
The fix introduces a new function, isSigninInvokeAuthorized, which centralizes sender authorization logic. This function is now called at the beginning of the SSO invoke handling process within registerMSTeamsHandlers. If the sender is not authorized, the function returns early, preventing any further processing of the SSO request.
The vulnerable function is therefore registerMSTeamsHandlers, as it contained the flawed logic that failed to perform the necessary authorization. During runtime exploitation, this function's onInvoke handler would be on the call stack when an unauthorized SSO invoke is received.