security: certificates without an end-of-line character will not be loaded properly by the UI's TLS logic #71588
Labels
A-multitenancy
Related to multi-tenancy
A-webui
Triage label for DB Console (fka admin UI) issues. Add this if nothing else is clear.
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
release-blocker
Indicates a release-blocker. Use with branch-release-2x.x label to denote which branch is blocked.
Describe the problem
When using certificate authority files that do not have an end-of-line character at the end of a file, the
GetTenantTLSConfig
andGetUIClientTLSConfig
methods of CertificateManager will create unreadable certificate authority blobs.getTenantCACertLocked
will resolve to whatever certificate authority exists, regardless of if the code is running in a multi-tenant environment or not, which meansGetTenantTLSConfig
andGetUIClientTLSConfig
will always return two certificates in a blob.While
GetTenantTLSConfig
is only called in a multi-tenant environment,GetUIClientTLSConfig
is called in dedicated environments and will try to concatenate whatever certificates it receives fromgetUICACertLocked
andgetTenantCACertLocked
. As mentioned before, this could result in two copies ofca.crt
, or a combination of other certificate authorities.If the certificate does not have an end-of-line character, the resulting loaded certificate would appear as follows:
As this is not a valid PEM, an error will be received along the lines of:
To Reproduce
If possible, provide steps to reproduce the behavior:
ca.crt
on its own is acceptable)ca.crt
and other certificate authorities. (For example, usingtruncate -s -1 ca.crt
)Expected behavior
Only the UI certificate authority should be loaded and no error should occur.
Additional context
This issue was introduced by a PR (#71248) to fix a security issue in the multi-tenant environment. Unfortunately I missed this issue during code review.
The text was updated successfully, but these errors were encountered: