The vulnerability is an open redirect on the error page of Mattermost. The analysis of the provided commit dad6bd7a1509054580a0898bbc0e026aac3b30cb shows a change in the ErrorPage component in webapp/channels/src/components/error_page/error_page.tsx. The patch reveals that the returnTo query parameter was being used directly to construct a redirect link. The vulnerable code, <Link to={params.get('returnTo') as string}>, reads the parameter from the URL and uses it as the target of a Link. This allows an attacker to specify an external, malicious URL in the returnTo parameter. The fix replaces this with <Link to={returnTo}>, where returnTo is a validated variable. Therefore, the ErrorPage component, specifically its rendering logic, is the vulnerable function.