CVE-2021-3121: Processes may panic upon receipt of malicious protobuf messages #101435
Labels
area/security
kind/bug
Categorizes issue or PR as related to a bug.
official-cve-feed
Issues or PRs related to CVEs officially announced by Security Response Committee (SRC)
sig/api-machinery
Categorizes an issue or PR as relevant to SIG API Machinery.
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.
Issue Details
A security issue was discovered in code generated by the gogo protobuf compiler used by Kubernetes. The gogo protobuf compiler issue has been assigned CVE-2021-3121 and is also known as the “skippy peanut butter bug”.
A program which uses affected code to handle a malicious protobuf message could panic.
The Kubernetes Product Security Committee has tested the API server using a malicious message, and we believe that there is no security impact to Kubernetes. When an authenticated user sent the malicious message to the API server, a panic occurred. However, the panic handler recovered and the API server continued without interruption (except to the malicious requestor, who received no response).
Generated protobuf files are part of several Kubernetes repositories, and any downstream projects which vendor in these repos should evaluate whether there is any security impact to their project.
Affected Components and Configurations
Any golang components which use handler code created by the gogo protbuf compiler, which accept protobuf messages and do not gracefully handle panics in the unmarshalling codepath may be affected.
The following Linux command can be used to detect affected generated code within a codebase:
Although we do not believe there is any security impact to Kubernetes, we have updated all generated protobufs out of an abundance of caution and as a courtesy to any downstream consumers who may be affected. The following PRs addressed this issue in Kubernetes:
Master branch: #98477, #101306
1.21 branch: #98477 (in 1.21.0), #101325 (in 1.21.1)
1.20 branch: #100501 (in 1.20.6), #101326 (in 1.20.7)
1.19 branch: #100515 (in 1.19.10), #101327 (in 1.19.11)
1.18 branch: #100514 (in 1.18.18), #101335 (in 1.18.19)
For other generated protobuf go handlers, the issue can be remediated by upgrading the gogo protobuf compiler to a fixed version (v1.3.2 or later), then regenerating affected protobuf code with the updated protobuf compiler.
Mitigations
Disabling support for protobuf messages may be one possible mitigation for any affected product.
Also, graceful panic handling in message handlers mitigates the bug.
Detection
If you use generated protobuf code in a product and you observe a process exiting with messages similar to the following, a malicious user may be exploiting this defect:
References
The text was updated successfully, but these errors were encountered: