problem: key rotation for encrypted database values #12389
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Does your problem still exist on the latest Forgejo version?
Yes, the problem still exists (tested locally with the latest development version)
About your usage of Forgejo
Contributor of Forgejo
Member of the Forgejo security team.
Self-hosts Forgejo.
Co-Maintainer of Codeberg.org's Forgejo instance.
Problem description
Forgejo encrypt some values in the database via two ways:
Since keying was introduced the usages of
secrethave been converted tokeying. Today only one usage ofsecretis left:codeberg.org/forgejo/forgejo@b6658076a9/services/auth/source/ldap/source.go (L80)If the
SECRET_KEY(from which the encryption key is derived) is known via some way, the encrypted values in the database can be decrypted. There's no way in Forgejo to re-encrypt all of these values under a new key.Moreover, once key rotation is added the following code block is no longer needed.
codeberg.org/forgejo/forgejo@b6658076a9/modules/setting/security.go (L266-L271)This is issue was created as part of https://floss.social/@forgejo/116494296646568723; it is a long-standing known issue that hasn't previously been documented.
Potential workarounds
No response
Forgejo Version
N/A
Other details about your environment (software names and versions)
N/A
Solutions
Accepted solutions to address this problem will go here