OAuth2 authorization code exposure via an untrusted datasource redirect origin
Description
An authenticated Appsmith user completing the OAuth2 authorization flow for a datasource could be redirected to an untrusted external site when the redirect origin is attacker-influenced. This affects Community and Enterprise editions, including Appsmith Cloud, when OAuth2 datasources are used. No non-default configuration is required beyond use of the affected datasource authorization flow.
Impact
A successful attack can expose OAuth2 authorization codes to an attacker-controlled domain and may enable phishing or credential theft. The attacker must persuade a victim with permission to configure or authorize the datasource to complete an affected authorization flow under attacker-influenced navigation conditions. Other Appsmith features and users who do not authorize OAuth2 datasources are not directly affected.
Affected and patched versions
Appsmith versions earlier than 2.4 are affected. Upgrade to 2.4 or later.
Workarounds
Until upgrading, limit OAuth2 datasource configuration and authorization to trusted administrators, and avoid beginning datasource authorization from untrusted links or pages.
After upgrading
Review OAuth provider and Appsmith logs for unexpected redirect destinations. If suspicious activity is found, revoke and reauthorize the affected datasource OAuth grants and review any credentials entered after an unexpected redirect.
Credits
Thanks to @mike197312 for reporting this issue.