Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encrypting Confidential Data at Rest task implies recommendation against AES CBC is due to padding oracle risk #44169

Open
pwolanin opened this issue Dec 1, 2023 · 12 comments
Labels
language/en Issues or PRs related to English language needs-kind Indicates a PR lacks a `kind/foo` label and requires one. priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/security Categorizes an issue or PR as relevant to SIG Security. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@pwolanin
Copy link

pwolanin commented Dec 1, 2023

Maybe I'm missing something, but the comment that "CBC's vulnerability to padding oracle attacks. " is why aescbc is not recommended seems to be misguided or wrong.

Padding oracle attacks can only occur if the attacker can send many different versions of the encrypted data and have the server respond in a way that the attacker can determine that there was an invalid padding. e.g. see https://blog.cloudflare.com/padding-oracles-and-the-decline-of-cbc-mode-ciphersuites/

That article notes that AES-CBC is secure for encrypting static content. I think that matches how it's used for the secrets API I'd also hope that kubernetes stores the encrypted secrets using a MAC after encryption, which removes the padding oracle attack vector.

How does a padding oracle attack become relevant in this context?

re: https://kubernetes.io/docs/tasks/administer-cluster/encrypt-data/

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Dec 1, 2023
@utkarsh-singh1
Copy link
Contributor

/language en

@k8s-ci-robot k8s-ci-robot added the language/en Issues or PRs related to English language label Dec 1, 2023
@sftim
Copy link
Contributor

sftim commented Dec 1, 2023

/kind support

This does feel mostly like a support query. These docs were reviewed for technical accuracy; if they are wrong, we'd like evidence, rather than a question.

If you want to use the AES CBC mode, despite the project's recommendations, you can.

@k8s-ci-robot k8s-ci-robot added the kind/support Categorizes issue or PR as a support question. label Dec 1, 2023
@pwolanin
Copy link
Author

pwolanin commented Dec 1, 2023

It is not a support query. I think this is a technical inaccuracy in the docs - I do not think there is any padding oracle that exists in kubernetes. Indicating that aescbc is weak for that reason is inaccurate.

Obviously I can still use it, and we do use AES-CBC for similar purposes in code internal to our projects where we want to encrypt multiple secrets at rest using the same encryption key.

@sftim
Copy link
Contributor

sftim commented Dec 1, 2023

/remove-kind support
/priority awaiting-more-evidence
/sig security auth

@k8s-ci-robot k8s-ci-robot added priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. sig/security Categorizes an issue or PR as relevant to SIG Security. sig/auth Categorizes an issue or PR as relevant to SIG Auth. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. and removed kind/support Categorizes issue or PR as a support question. labels Dec 1, 2023
@sftim
Copy link
Contributor

sftim commented Dec 1, 2023

/retitle Encrypting Confidential Data at Rest task implies recommendation against AES CBC is due to padding oracle risk

@k8s-ci-robot k8s-ci-robot changed the title Encrypting Confidential Data at Rest - why is aescbc not recommended? Encrypting Confidential Data at Rest task implies recommendation against AES CBC is due to padding oracle risk Dec 1, 2023
@sftim
Copy link
Contributor

sftim commented Dec 1, 2023

Relevant but different to this issue's focus: we should add more of a concept guide to API encryption at rest. Then, the task page can focus on the “how”, with hyperlinks into the concept page for the “why” aspects.

@sftim
Copy link
Contributor

sftim commented Dec 1, 2023

I have some PRs including #43176 that aim to help around the topic of API encryption at rest, but either:

  • the quality is not yet right on those PRs
  • we're short of reviewer time

Help is welcome

@sftim
Copy link
Contributor

sftim commented Dec 1, 2023

What we actually recommend is KMS with a v2 plugin and a KEK that's never revealed to the Kubernetes API server. This is a security model I personally like, too.

@pwolanin
Copy link
Author

pwolanin commented Dec 1, 2023 via email

@sftim
Copy link
Contributor

sftim commented Dec 1, 2023

I'm inferring that in the absence of a formal proof around the lack of a padding oracle, precaution is good. The docs don't state this.

@pwolanin
Copy link
Author

pwolanin commented Dec 1, 2023 via email

@ibihim
Copy link

ibihim commented Jan 22, 2024

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language/en Issues or PRs related to English language needs-kind Indicates a PR lacks a `kind/foo` label and requires one. priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/security Categorizes an issue or PR as relevant to SIG Security. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Status: Backlog
Development

No branches or pull requests

5 participants