[release-4.18] OCPBUGS-99888: Cherry-pick CVE-2026-66138 fix (NTP command injection) - #198
[release-4.18] OCPBUGS-99888: Cherry-pick CVE-2026-66138 fix (NTP command injection)#198mariocr73 wants to merge 2 commits into
Conversation
Adds basic validation of the NTP server parameter to harden the usage of the NTP server time setting *AND* also uses shlex.quote to and removes shell=true from the execution invocation to prevent any possibliity of injecting a malicious command to be executed. Related-Bug: 2160050 Assisted-By: Claude Opus 4.6 Change-Id: I69e85a1c5040066674d90a6e12acc30cec96ba76 Signed-off-by: Julia Kreger <juliaashleykreger@gmail.com>
|
@mariocr73: This pull request references Jira Issue OCPBUGS-99888, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/retest-required |
The CVE-2026-66138 fix (d4926bf) calls ipaddress.ip_address() and shlex.quote() in the new _validate_ntp_server(), assuming both modules are already imported -- true on release-4.19+ (which carry an unrelated is_link_local feature that imports them) but not on this branch. Add the two missing imports so the cherry-picked fix actually runs; without them ci/prow/unit fails with NameError: name 'ipaddress' is not defined. Related: OCPBUGS-99888
|
/retest |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: elfosardo, mariocr73 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@mariocr73: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Cherry-picks upstream security fix d4926bf ("security: fix NTP command handling", CVE-2026-66138) onto the OCP 4.18 branch.
The value of the
ntp_serverconfig option was passed unsanitized into a shell command (chronyd -q '<query>',shell=True) insync_clock(), allowing arbitrary root command execution at early IPA boot. This patch adds input validation and removesshell=Truein favor ofshlex.quote().Upstream: https://review.opendev.org/c/openstack/ironic-python-agent/+/998486
OSSA: https://security.openstack.org/ossa/OSSA-2026-027.html
Related: OCPBUGS-99888