Issue Description
During a security review of our customized Discourse deployment, we found a potential sensitive information disclosure in the Admin > Settings interface regarding OAuth2 client secrets.
Details
-
In the admin configuration page, the OAuth2 client secret (and potentially other sensitive tokens/keys) are shown in plain text, rather than being masked (e.g. with asterisks).
-
Administrators are required to directly input the plain secret into the settings. Anyone with access to the admin UI can see the entire secret.
-
If an attacker gains access (even temporarily) to an admin session, they could easily obtain the client secret and use it for unauthorized OAuth2 token requests or to forge requests to third-party services.
Security Impact
-
Plain text exposure of secrets in the admin UI increases the risk of credential leakage.
-
The lack of masking is not in line with security best practices for handling secrets.
-
The secrets/tokens could be abused for privilege escalation, impersonation, or further attacks against integrated services.
Questions
-
Is there a plan to mask sensitive fields like OAuth2 secrets in the admin settings UI (e.g., display as ****** with the option to reveal if necessary)?
-
Are there recommended approaches or plugins to enhance the protection of sensitive credentials in Discourse deployments?
-
Has this issue been discussed previously? Any workarounds available until an official fix?
Thank you for your attention to this important security concern!