mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-30 04:06:34 +09:00
fix(opensearch): disable the Base64 intrinsics hit by CVE-2026-114938
CVE-2026-114938 is an out-of-bounds write in the AVX-512 VBMI Base64
decoder of OpenJDK 17.0.6 and later, reachable on x86-64 hosts with
attacker-supplied Base64. OpenSearch decodes the Basic credentials of a
request before it authenticates it, so a tenant's cluster is exposed to
anyone who can reach its HTTP port.
Two of the three versions this chart offers bundle an affected JDK:
opensearchproject/opensearch:3.0.0 carries 21.0.7 and 2.11.1 carries
17.0.8. 1.3.20 carries 11.0.25, which is not affected. OpenSearch has
not released a build on a patched JDK yet.
Start the nodes with -XX:-UseBASE64Intrinsics, which removes the
vulnerable code path and leaves the other AVX-512 optimizations in
place. It is delivered as a jvm.options.d file mounted from a
ConfigMap, because neither obvious route works: bin/opensearch-env
unsets JAVA_TOOL_OPTIONS, and setting nodePools[].jvm makes the
operator stop sizing the heap from the memory request. The operator
mounts general.additionalVolumes into the node pools and the bootstrap
pod alike.
Rolling this out restarts every OpenSearch cluster once.
Tested with helm unittest, and by starting 3.0.0, 2.11.1 and 1.3.20
with the file mounted: each server JVM runs with the flag, and the heap
passed in OPENSEARCH_JAVA_OPTS still applies.
Assisted-by: LLM
Signed-off-by: Andrey Kolkov <androndo@gmail.com>
(cherry picked from commit 65f0943710)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
e4bfcbf280
commit
bdac8ef210
3 files changed
+65
No files matched your search
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ .Release.Name }}-jvm-options
|
||||
data:
|
||||
# -XX:-UseBASE64Intrinsics turns off the AVX-512 Base64 decoder hit by
|
||||
# CVE-2026-114938: OpenSearch decodes the Basic credentials of a request
|
||||
# before it authenticates it, and the image may bundle an OpenJDK that
|
||||
# predates the fix.
|
||||
cozystack.options: |
|
||||
-XX:-UseBASE64Intrinsics
|
||||
@@ -17,6 +17,18 @@ spec:
|
||||
version: {{ include "opensearch.versionMap" $ }}
|
||||
httpPort: 9200
|
||||
{{- /*
|
||||
JVM options go in as a jvm.options.d file because neither other route works:
|
||||
bin/opensearch-env unsets JAVA_TOOL_OPTIONS, and setting nodePools[].jvm makes
|
||||
the operator stop sizing the heap from the memory request.
|
||||
*/}}
|
||||
additionalVolumes:
|
||||
- name: jvm-options
|
||||
path: /usr/share/opensearch/config/jvm.options.d/cozystack.options
|
||||
subPath: cozystack.options
|
||||
restartPods: true
|
||||
configMap:
|
||||
name: {{ .Release.Name }}-jvm-options
|
||||
{{- /*
|
||||
The operator's own way to raise vm.max_map_count is a privileged init
|
||||
container in every OpenSearch pod, and the PodSecurity level tenant
|
||||
namespaces run at refuses that before any pod exists. The sysctl comes from
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
suite: opensearch JVM options
|
||||
|
||||
release:
|
||||
name: test-os
|
||||
namespace: tenant-test
|
||||
|
||||
set:
|
||||
_cluster:
|
||||
cluster-domain: cozy.local
|
||||
|
||||
tests:
|
||||
- it: ships the Base64 intrinsics switch as a jvm.options.d file
|
||||
template: templates/jvm-options.yaml
|
||||
asserts:
|
||||
- isKind:
|
||||
of: ConfigMap
|
||||
- equal:
|
||||
path: metadata.name
|
||||
value: test-os-jvm-options
|
||||
- equal:
|
||||
path: data["cozystack.options"]
|
||||
value: |
|
||||
-XX:-UseBASE64Intrinsics
|
||||
|
||||
- it: mounts that file into every pod of the cluster
|
||||
template: templates/opensearch.yaml
|
||||
documentSelector:
|
||||
path: kind
|
||||
value: OpenSearchCluster
|
||||
asserts:
|
||||
- contains:
|
||||
path: spec.general.additionalVolumes
|
||||
content:
|
||||
name: jvm-options
|
||||
path: /usr/share/opensearch/config/jvm.options.d/cozystack.options
|
||||
subPath: cozystack.options
|
||||
restartPods: true
|
||||
configMap:
|
||||
name: test-os-jvm-options
|
||||
# setting jvm would stop the operator sizing the heap from the memory request
|
||||
- notExists:
|
||||
path: spec.nodePools[0].jvm
|
||||
Reference in new issue
Block a user