The vulnerability lies in the OpenFGA playground endpoint, which, when enabled with preshared-key authentication, would expose the key in the HTML source of the playground page. The analysis of the patch between the last vulnerable version (v1.13.1) and the first patched version (v1.14.0) revealed the exact code changes made to fix this issue. The commit 81373f28921554ab41232af10f762180d461a776 contains the security fix.
The core of the vulnerability was in the ServerContext.runPlaygroundServer function in cmd/run/run.go. This function previously allowed the playground to run with preshared authentication, which led to the key being passed to and rendered by the HTML template. The patch modifies this function to only allow the none authentication method when the playground is enabled.
Additionally, a faulty validation function, Config.VerifyBinarySettings in pkg/server/config/config.go, was identified. This function was supposed to validate server settings but incorrectly permitted the vulnerable configuration. The patch strengthens this validation to prohibit enabling the playground with any authentication method other than none. Both functions are therefore identified as vulnerable, one for executing the vulnerable logic and the other for failing to prevent it.