The vulnerability is an authorization bypass in OpenClaw's Discord integration due to slug collisions from name/tag-based allowlist entries. The analysis of the provided patches pinpoints the vulnerable logic within the function that prepares the allowlist for authorization checks.
The commit 747bb581b3f2264495e1fec5a0727d9f2ca1b6f1 is the primary fix for the runtime vulnerability. It modifies src/discord/monitor/provider.allowlist.ts and src/channels/allowlists/resolve-utils.ts. The key change is within the resolveDiscordAllowlistConfig function. Before the patch, this function would prepare an allowlist that contained the raw, ambiguous name/tag strings from the configuration. This list was then used by a downstream authorization function that performed a comparison based on normalized slugs, which is insecure. The patch alters resolveDiscordAllowlistConfig to use a new canonicalizeAllowlistWithResolvedIds function. This new logic resolves the name/tag entries to their unique Discord user IDs and replaces them in the allowlist that is used for authorization. This ensures that the check is performed against a stable, unique identifier, eliminating the possibility of a slug collision attack.
The other commit, f97c45c5b5e0698b6667bb5f6badc0cac7dabd12, adds a security audit tool to warn users about the presence of these insecure name-based configurations but does not fix the underlying runtime vulnerability. Therefore, resolveDiscordAllowlistConfig is identified as the key function that, prior to being patched, was instrumental in the vulnerability by supplying an insecurely structured allowlist to the authorization process.