Version in base suite: 29.0.5-0+deb13u3 Base version: ironic_29.0.5-0+deb13u3 Target version: ironic_29.0.5-0+deb13u4 Base file: /srv/ftp-master.debian.org/ftp/pool/main/i/ironic/ironic_29.0.5-0+deb13u3.dsc Target file: /srv/ftp-master.debian.org/policy/pool/main/i/ironic/ironic_29.0.5-0+deb13u4.dsc changelog | 22 patches/CVE-2026-115638_OSSA-2026-049_Chunk-gzip-decompressions-and-enforce-a-limit.patch | 282 +++ patches/CVE-2026-89419_OSSA-2026-048_Security-Fix-maintenance-state-update-policy-bypass.patch | 134 + patches/CVE-2026-90458_OSSA-2026-047_Validate-BMC-subscription-IDs-in-Redfish-vendor-passthrough-methods.patch | 271 +++ patches/CVE-2026-90461_Add-image_server_auth_hosts-to-restrict-credential-scope.patch | 743 ++++++++++ patches/OSSN-0106_Add_api_enable_ramdisk_endpoints_config_option.patch | 14 patches/series | 4 7 files changed, 1463 insertions(+), 7 deletions(-) dpkg-source: warning: cannot verify inline signature for /srv/release.debian.org/tmp/tmprnl90mvx/ironic_29.0.5-0+deb13u3.dsc: no acceptable signature found dpkg-source: warning: cannot verify inline signature for /srv/release.debian.org/tmp/tmprnl90mvx/ironic_29.0.5-0+deb13u4.dsc: no acceptable signature found diff -Nru ironic-29.0.5/debian/changelog ironic-29.0.5/debian/changelog --- ironic-29.0.5/debian/changelog 2026-06-16 10:46:11.000000000 +0000 +++ ironic-29.0.5/debian/changelog 2026-09-24 17:06:22.000000000 +0000 @@ -1,3 +1,25 @@ +ironic (1:29.0.5-0+deb13u4) trixie-security; urgency=medium + + * CVE-2026-90461 / OSSN-0110: Ironic may send a username and password to + an unexpected remote host when Image Service is configured for HTTP(S) + Basic Authentication. Applied upstream patch: "Add + image_server_auth_hosts to restrict credential scope". + (Closes: #1148451, #1150425). + * CVE-2026-90458 / OSSA-2026-047: Redfish vendor_passthru method allows path + injection via ID. Applied upstream patch "Validate BMC subscription IDs + in Redfish vendor passthrough methods" (Closes: #1151656): + - CVE-2026-90458_OSSA-2026-047_Validate-BMC-subscription-IDs-in-....patch + * CVE-2026-89419 / OSSA-2026-048: Ironic allows generic node update for + maintenance setting. Applied upstream patch "Security: Fix maintenance + state update policy bypass" (Closes: #1151657): + - CVE-2026-89419_OSSA-2026-048_Security-Fix-maintenance-state-up....patch + * CVE-2026-115638 / OSSA-2026-049: Ironic Conductor DoS via gzip bomb + configdrive. Applied upstream patch "Chunk gzip decompressions and + enforce a limit" (Closes: #1152544): + - CVE-2026-115638_OSSA-2026-049_Chunk-gzip-decompressions-and-enf....patch + + -- Thomas Goirand Thu, 24 Sep 2026 19:06:22 +0200 + ironic (1:29.0.5-0+deb13u3) trixie-security; urgency=medium * Add follow-up patch for CVE-2026-46447 (erata1): "Fix kernel parameter diff -Nru ironic-29.0.5/debian/patches/CVE-2026-115638_OSSA-2026-049_Chunk-gzip-decompressions-and-enforce-a-limit.patch ironic-29.0.5/debian/patches/CVE-2026-115638_OSSA-2026-049_Chunk-gzip-decompressions-and-enforce-a-limit.patch --- ironic-29.0.5/debian/patches/CVE-2026-115638_OSSA-2026-049_Chunk-gzip-decompressions-and-enforce-a-limit.patch 1970-01-01 00:00:00.000000000 +0000 +++ ironic-29.0.5/debian/patches/CVE-2026-115638_OSSA-2026-049_Chunk-gzip-decompressions-and-enforce-a-limit.patch 2026-09-24 17:06:22.000000000 +0000 @@ -0,0 +1,282 @@ +Description: Chunk gzip decompressions and enforce a limit + Prior to this change, any tenant authorized to deploy machines with + configdrive could push a base64-encoded gzip bomb as the configdrive and + cause an out of memory or out of disk space condition on an Ironic + conductor. + . + Now, we chunk the configdrives and apply a limit of 64MiB -- the same + limit enforced by Ironic Python Agent (and the size of the partition we + create). + . + This is being tracked as CVE-2026-115638. + . + NOTE(JayF): This is the combination of two master changes: one with the + code fix and an inaccurate release note and one that corrects the + release note. + . + NOTE(JayF): From stable/2026.2 -> stable/2026.1, added an import for + ironic.common.exception to the unit tests. + . + NOTE(JayF): From stable/2025.2 -> stable/2025.1, removed code that was + supporting configdrive network_data metdata edits; this feature did not + ship in 2025.1. +Author: Jay Faulkner +Date: Thu, 22 Oct 2026 10:11:21 -0700 +Origin: upstream, https://review.opendev.org/c/openstack/ironic/+/1012134 +Bug: https://launchpad.net/bugs/2171814 +Last-Update: 2026-11-02 + +diff --git a/ironic/common/kickstart_utils.py b/ironic/common/kickstart_utils.py +index a05f5df..6cefe75 100644 +--- a/ironic/common/kickstart_utils.py ++++ b/ironic/common/kickstart_utils.py +@@ -12,7 +12,6 @@ + # License for the specific language governing permissions and limitations + # under the License. + import base64 +-import gzip + import io + import os + import tempfile +@@ -103,8 +102,7 @@ + raise exception.InstanceDeployFailure(error_msg) + + try: +- with gzip.GzipFile(fileobj=iso_gz_obj, mode='rb') as f: +- config_drive_iso = f.read() ++ config_drive_iso = utils.decompress_gzip(iso_gz_obj) + except Exception as exc: + error_msg = "Decoding/Extraction of config drive failed: %s" % exc + raise exception.InstanceDeployFailure(error_msg) +diff --git a/ironic/common/utils.py b/ironic/common/utils.py +index 9dff165..bfb0e73 100644 +--- a/ironic/common/utils.py ++++ b/ironic/common/utils.py +@@ -23,6 +23,7 @@ + import copy + import datetime + import errno ++import gzip + import hashlib + import ipaddress + import os +@@ -76,6 +77,20 @@ + + USING_SQLITE = None + ++# Maximum decompressed size, in bytes, of a configuration drive that Ironic ++# is willing to process. This matches the maximum size of the configuration ++# drive partition created by ironic-python-agent (64 MiB), so a legitimate ++# configuration drive can never usefully exceed this value. The limit guards ++# against gzip "decompression bombs", where a small compressed payload expands ++# to a huge amount of data and exhausts the conductor's disk or memory. ++MAX_CONFIGDRIVE_SIZE = 64 * units.Mi ++ ++# Size of the chunks read while streaming gzip decompression. Reading in ++# chunks keeps the list of buffers bounded and lets us stop decompressing as ++# soon as the size limit is exceeded, instead of materializing the whole ++# stream in memory first. ++_GZIP_DECOMPRESS_CHUNK_SIZE = units.Mi ++ + + def execute(*cmd, use_standard_locale=False, log_stdout=True, **kwargs): + """Convenience wrapper around oslo's execute() method. +@@ -1183,3 +1198,41 @@ + LOG.error('ISO path evaluation identified a file name based ' + 'transversal attempt.') + raise exception.InvalidContent() ++ ++ ++def decompress_gzip(configdrive_fileobj, max_size=None): ++ """Decompress gzip data, limiting the decompressed size. ++ ++ Decompress gzip-compressed data from a binary file-like object and ++ return the decompressed bytes, refusing to produce more than ++ ``max_size`` bytes of output. This guards against gzip "decompression ++ bombs" where a tiny compressed payload expands to a huge amount of data, ++ exhausting the conductor's disk or memory. ++ ++ :param configdrive_fileobj: A binary file-like object positioned at the ++ start of the gzip-compressed data. ++ :param max_size: The maximum number of decompressed bytes to accept. ++ Defaults to :data:`MAX_CONFIGDRIVE_SIZE`. ++ :returns: The decompressed contents as ``bytes``. ++ :raises: exception.InvalidContent if the decompressed data would exceed ++ ``max_size``. ++ """ ++ if max_size is None: ++ max_size = MAX_CONFIGDRIVE_SIZE ++ ++ chunks = [] ++ total = 0 ++ with gzip.GzipFile(mode='rb', fileobj=configdrive_fileobj) as gz: ++ while True: ++ chunk = gz.read(_GZIP_DECOMPRESS_CHUNK_SIZE) ++ if not chunk: ++ break ++ total += len(chunk) ++ if total > max_size: ++ LOG.error('Configuration drive decompressed size exceeded ' ++ 'the maximum allowed size of %(max)s bytes; ' ++ 'refusing to continue decompressing to prevent ' ++ 'resource exhaustion.', {'max': max_size}) ++ raise exception.InvalidContent() ++ chunks.append(chunk) ++ return b''.join(chunks) +diff --git a/ironic/drivers/modules/image_utils.py b/ironic/drivers/modules/image_utils.py +index 56ccb7d..ae8244a 100644 +--- a/ironic/drivers/modules/image_utils.py ++++ b/ironic/drivers/modules/image_utils.py +@@ -15,10 +15,8 @@ + + import base64 + import functools +-import gzip + import json + import os +-import shutil + import tempfile + from urllib import parse as urlparse + +@@ -276,10 +274,9 @@ + comp_tmpfile_obj.write(base64.b64decode(content)) + comp_tmpfile_obj.seek(0) + +- gz = gzip.GzipFile(fileobj=comp_tmpfile_obj, mode='rb') + with tempfile.NamedTemporaryFile( + dir=CONF.tempdir, suffix='.img') as image_tmpfile_obj: +- shutil.copyfileobj(gz, image_tmpfile_obj) ++ image_tmpfile_obj.write(utils.decompress_gzip(comp_tmpfile_obj)) + image_tmpfile_obj.flush() + return prepare_disk_image(task, image_tmpfile_obj.name, + prefix='configdrive') +diff --git a/ironic/tests/unit/common/test_kickstart_utils.py b/ironic/tests/unit/common/test_kickstart_utils.py +index 125bb47..a0d71de 100644 +--- a/ironic/tests/unit/common/test_kickstart_utils.py ++++ b/ironic/tests/unit/common/test_kickstart_utils.py +@@ -13,12 +13,14 @@ + # under the License. + + import base64 ++import gzip + import os + from unittest import mock + + from oslo_config import cfg + import pycdlib + ++from ironic.common import exception + from ironic.common import kickstart_utils as ks_utils + from ironic.conductor import task_manager + from ironic.drivers.modules import ipxe +@@ -183,3 +185,11 @@ + mock_record, rockridge=True + ) + mock_iso.get_file_from_iso_fp.assert_not_called() ++ ++ @mock.patch.object(ks_utils.utils, 'MAX_CONFIGDRIVE_SIZE', 1024) ++ def test_decode_and_extract_config_drive_iso_bomb(self): ++ bomb = base64.b64encode( ++ gzip.compress(b'\x00' * (64 * 1024))).decode() ++ self.assertRaises(exception.InstanceDeployFailure, ++ ks_utils.decode_and_extract_config_drive_iso, ++ bomb) +diff --git a/ironic/tests/unit/common/test_utils.py b/ironic/tests/unit/common/test_utils.py +index cf8e62d..3adbcae 100644 +--- a/ironic/tests/unit/common/test_utils.py ++++ b/ironic/tests/unit/common/test_utils.py +@@ -16,6 +16,8 @@ + import copy + import datetime + import errno ++import gzip ++import io + import os + import os.path + import shutil +@@ -1124,3 +1126,24 @@ + + source = utils.get_route_source('XXX') + self.assertIsNone(source) ++ ++ ++class DecompressGzipTestCase(base.TestCase): ++ ++ def test_decompress_gzip(self): ++ data = b'some configuration drive contents' ++ decompressed = utils.decompress_gzip(io.BytesIO(gzip.compress(data))) ++ self.assertEqual(data, decompressed) ++ ++ def test_decompress_gzip_max_size_default(self): ++ # The cap must stay in sync with the 64 MiB configuration drive ++ # partition created by ironic-python-agent. ++ self.assertEqual(64 * 1024 * 1024, utils.MAX_CONFIGDRIVE_SIZE) ++ ++ def test_decompress_gzip_bomb(self): ++ # A tiny compressed payload that would expand far beyond the limit ++ # must be rejected instead of being decompressed in full. ++ bomb = io.BytesIO(gzip.compress(b'\x00' * (8 * 1024 * 1024))) ++ self.assertRaises(exception.InvalidContent, ++ utils.decompress_gzip, bomb, ++ max_size=1024 * 1024) +diff --git a/ironic/tests/unit/drivers/modules/test_image_utils.py b/ironic/tests/unit/drivers/modules/test_image_utils.py +index 26825df..a472291 100644 +--- a/ironic/tests/unit/drivers/modules/test_image_utils.py ++++ b/ironic/tests/unit/drivers/modules/test_image_utils.py +@@ -13,7 +13,9 @@ + # License for the specific language governing permissions and limitations + # under the License. + ++import base64 + import collections ++import gzip + import os + import tempfile + from unittest import mock +@@ -21,6 +23,7 @@ + from oslo_config import cfg + from oslo_utils import uuidutils + ++from ironic.common import exception + from ironic.common import image_service + from ironic.common import images + from ironic.common import states +@@ -416,6 +419,16 @@ + result = image_utils.prepare_configdrive_image(task, content) + self.assertEqual(expected_url, result) + ++ @mock.patch.object(image_utils.utils, 'MAX_CONFIGDRIVE_SIZE', 1024) ++ def test_prepare_configdrive_image_gzip_bomb(self): ++ bomb = base64.b64encode( ++ gzip.compress(b'\x00' * (64 * 1024))).decode() ++ with task_manager.acquire(self.context, self.node.uuid, ++ shared=True) as task: ++ self.assertRaises(exception.InvalidContent, ++ image_utils.prepare_configdrive_image, ++ task, bomb) ++ + @mock.patch.object(image_utils.ImageHandler, 'unpublish_image', + autospec=True) + def test_cleanup_iso_image(self, mock_unpublish): +diff --git a/releasenotes/notes/configdrive-gzip-limits-2c48c6e3f41ee0d1.yaml b/releasenotes/notes/configdrive-gzip-limits-2c48c6e3f41ee0d1.yaml +new file mode 100644 +index 0000000..da325b6 +--- /dev/null ++++ b/releasenotes/notes/configdrive-gzip-limits-2c48c6e3f41ee0d1.yaml +@@ -0,0 +1,16 @@ ++security: ++ - | ++ Fixes an issue where an Ironic conductor could experience a memory or disk ++ exhaustion condition when a tenant provides a gzip bomb instead of a valid ++ configdrive. Any tenant authorized to deploy machines could trigger this by ++ supplying a base64-encoded gzip payload that Ironic decompresses while ++ preparing the configdrive for deployment. ++ ++ This affected deployments using the Anaconda deploy interface and the ++ ``redfish-virtual-media`` boot interface. ++ ++ Now, Ironic decompresses configdrives in bounded chunks and rejects any ++ configdrive that expands to more than 64MiB -- the same limit enforced by ++ Ironic Python Agent (and the size of the partition it creates). ++ ++ This security issue is tracked as CVE-2026-115638. diff -Nru ironic-29.0.5/debian/patches/CVE-2026-89419_OSSA-2026-048_Security-Fix-maintenance-state-update-policy-bypass.patch ironic-29.0.5/debian/patches/CVE-2026-89419_OSSA-2026-048_Security-Fix-maintenance-state-update-policy-bypass.patch --- ironic-29.0.5/debian/patches/CVE-2026-89419_OSSA-2026-048_Security-Fix-maintenance-state-update-policy-bypass.patch 1970-01-01 00:00:00.000000000 +0000 +++ ironic-29.0.5/debian/patches/CVE-2026-89419_OSSA-2026-048_Security-Fix-maintenance-state-update-policy-bypass.patch 2026-09-24 17:06:22.000000000 +0000 @@ -0,0 +1,134 @@ +Description: Security: Fix maintenance state update policy bypass + Fixes maintenance state update requests bypassing set_maintenance policy + checks due to a missing '/maintenance' and 'maintenance_reason' + endpoints in the patch validation gate. + . + Addresses CVE-2026-89419. +Author: Afonne-CID +Date: Tue, 08 Sep 2026 16:46:13 +0100 +Origin: upstream, https://review.opendev.org/c/openstack/ironic/+/1011869 +Bug: https://launchpad.net/bugs/2166510 +Bug-Debian: https://bugs.debian.org/1151657 +Last-Update: 2026-10-22 + +diff --git a/ironic/api/controllers/v1/node.py b/ironic/api/controllers/v1/node.py +index 5573091..6595e1c 100644 +--- a/ironic/api/controllers/v1/node.py ++++ b/ironic/api/controllers/v1/node.py +@@ -3072,7 +3072,9 @@ + ('/retired', 'baremetal:node:update:retired'), + ('/shard', 'baremetal:node:update:shard'), + ('/parent_node', 'baremetal:node:update:parent_node'), +- ('/disable_power_off', 'baremetal:node:update:disable_power_off') ++ ('/disable_power_off', 'baremetal:node:update:disable_power_off'), ++ ('/maintenance', 'baremetal:node:set_maintenance'), ++ ('/maintenance_reason', 'baremetal:node:set_maintenance') + ) + for p in patch: + # Process general direct path to policy map +diff --git a/ironic/tests/unit/api/controllers/v1/test_node.py b/ironic/tests/unit/api/controllers/v1/test_node.py +index 9056cd1..ccccd08 100644 +--- a/ironic/tests/unit/api/controllers/v1/test_node.py ++++ b/ironic/tests/unit/api/controllers/v1/test_node.py +@@ -7109,10 +7109,19 @@ + autospec=True) + @mock.patch.object(objects.Node, 'get_by_uuid', autospec=True) + @mock.patch.object(rpcapi.ConductorAPI, 'update_node', autospec=True) +- def test_set_node_maintenance_mode(self, mock_update, mock_get, +- mock_notify): ++ @mock.patch.object(policy, 'authorize', autospec=True) ++ def test_set_node_maintenance_mode(self, mock_authorize, mock_update, ++ mock_get, mock_notify): ++ ++ authorized_rules = [] ++ def mock_authorize_function(rule, target, creds): ++ authorized_rules.append(rule) ++ return True ++ mock_authorize.side_effect = mock_authorize_function ++ + self._test_set_node_maintenance_mode(mock_update, mock_get, + 'fake_reason', self.node.uuid) ++ self.assertIn('baremetal:node:set_maintenance', authorized_rules) + mock_notify.assert_has_calls([mock.call(mock.ANY, mock.ANY, + 'maintenance_set', + obj_fields.NotificationLevel.INFO, +diff --git a/ironic/tests/unit/api/test_rbac_project_scoped.yaml b/ironic/tests/unit/api/test_rbac_project_scoped.yaml +index 6f5c460..5eaa1e2 100644 +--- a/ironic/tests/unit/api/test_rbac_project_scoped.yaml ++++ b/ironic/tests/unit/api/test_rbac_project_scoped.yaml +@@ -863,6 +863,58 @@ + headers: *lessee_member_headers + assert_status: 403 + ++owner_admin_can_patch_maintenance: ++ path: '/v1/nodes/{owner_node_ident}' ++ method: patch ++ headers: *owner_admin_headers ++ assert_status: 503 ++ body: &maintenance_set_patch ++ - op: replace ++ path: /maintenance ++ value: true ++ ++owner_manager_can_patch_maintenance: ++ path: '/v1/nodes/{owner_node_ident}' ++ method: patch ++ headers: *owner_manager_headers ++ assert_status: 503 ++ body: *maintenance_set_patch ++ ++owner_member_can_patch_maintenance: ++ path: '/v1/nodes/{owner_node_ident}' ++ method: patch ++ headers: *owner_member_headers ++ assert_status: 503 ++ body: *maintenance_set_patch ++ ++lessee_admin_can_patch_maintenance: ++ path: '/v1/nodes/{lessee_node_ident}' ++ method: patch ++ headers: *lessee_admin_headers ++ assert_status: 503 ++ body: *maintenance_set_patch ++ ++lessee_manager_can_patch_maintenance: ++ path: '/v1/nodes/{lessee_node_ident}' ++ method: patch ++ headers: *lessee_manager_headers ++ assert_status: 503 ++ body: *maintenance_set_patch ++ ++lessee_member_cannot_patch_maintenance: ++ path: '/v1/nodes/{lessee_node_ident}' ++ method: patch ++ headers: *lessee_member_headers ++ assert_status: 403 ++ body: *maintenance_set_patch ++ ++third_party_admin_cannot_patch_maintenance: ++ path: '/v1/nodes/{owner_node_ident}' ++ method: patch ++ headers: *third_party_admin_headers ++ assert_status: 404 ++ body: *maintenance_set_patch ++ + third_party_admin_cannot_set_maintenance: + path: '/v1/nodes/{owner_node_ident}/maintenance' + method: put +diff --git a/releasenotes/notes/cve-2026-89419-maintenance-policy-c3a38911afa411d2.yaml b/releasenotes/notes/cve-2026-89419-maintenance-policy-c3a38911afa411d2.yaml +new file mode 100644 +index 0000000..a1893a9 +--- /dev/null ++++ b/releasenotes/notes/cve-2026-89419-maintenance-policy-c3a38911afa411d2.yaml +@@ -0,0 +1,11 @@ ++security: ++ - | ++ Fixes an issue where issuing a PATCH to ``/v1/nodes`` containing ++ ``/maintenance`` would bypass the more specific ++ ``baremetal:node:set_maintenance`` policy and instead be evaluated ++ as ``baremetal:node:update``. For clouds running default Ironic policy, ++ this means someone with member role in the project indicated in ++ ``node.lessee`` could change the maintenance state of the node ++ unexpectedly. ++ ++ This security fix is tracked in OSSA-2026-048 and CVE-2026-89419. diff -Nru ironic-29.0.5/debian/patches/CVE-2026-90458_OSSA-2026-047_Validate-BMC-subscription-IDs-in-Redfish-vendor-passthrough-methods.patch ironic-29.0.5/debian/patches/CVE-2026-90458_OSSA-2026-047_Validate-BMC-subscription-IDs-in-Redfish-vendor-passthrough-methods.patch --- ironic-29.0.5/debian/patches/CVE-2026-90458_OSSA-2026-047_Validate-BMC-subscription-IDs-in-Redfish-vendor-passthrough-methods.patch 1970-01-01 00:00:00.000000000 +0000 +++ ironic-29.0.5/debian/patches/CVE-2026-90458_OSSA-2026-047_Validate-BMC-subscription-IDs-in-Redfish-vendor-passthrough-methods.patch 2026-09-24 17:06:22.000000000 +0000 @@ -0,0 +1,271 @@ +Description: Validate BMC subscription IDs in Redfish vendor passthrough methods + Previously no validation (other than presence) of BMC subscription IDs + was performed. This opened the possibility of an attacker crafting a + malicious BMC subscription ID which would allow the attacker to issue + arbitrary HTTP DELETEs (via delete_subscription) and arbitrary HTTP GETs + (via get_subscription) on the BMC's Redfish root under the conductor's + BMC-admin identity. + . + Addresses CVE-2026-90458. +Author: Clif Houck +Date: Thu, 17 Sep 2026 09:59:21 -0500 +Origin: upstream, https://review.opendev.org/c/openstack/ironic/+/1011868 +Bug: https://launchpad.net/bugs/2166507 +Bug-Debian: https://bugs.debian.org/1151656 +Last-Update: 2026-10-22 + +diff --git a/ironic/common/validate.py b/ironic/common/validate.py +new file mode 100644 +index 0000000..d1c597f +--- /dev/null ++++ b/ironic/common/validate.py +@@ -0,0 +1,37 @@ ++# Licensed under the Apache License, Version 2.0 (the "License"); you may ++# not use this file except in compliance with the License. You may obtain ++# a copy of the License at ++# ++# http://www.apache.org/licenses/LICENSE-2.0 ++# ++# Unless required by applicable law or agreed to in writing, software ++# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT ++# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the ++# License for the specific language governing permissions and limitations ++# under the License. ++ ++# Consider extra, national, and punctuation character sets from RFC 1738 ++# illegal. ++URL_ILLEGAL_CHARS = [ ++ '!', '*', '\'', '(', ')', ',', '{', '}', '|', '\\', '^', '~', '[', ']', ++ '`', '<', '>', '#', '%', '"' ++] ++ ++ ++def is_bmc_subscription_id_valid(bmc_subscription_id: str) -> bool: ++ """Validate BMC IDs to be sent to Redfish subscription endpoints. ++ ++ Note there's no well-defined type or schema for these subscription IDs. ++ Therefore we try to reject illegal characters or some short illegal ++ substrings. ++ """ ++ for ic in URL_ILLEGAL_CHARS: ++ if ic in bmc_subscription_id: ++ return False ++ ++ # Dots '.' are allowed... but we consider double dots '..' illegal since ++ # they could be misused for traversal. ++ if '..' in bmc_subscription_id: ++ return False ++ ++ return True +diff --git a/ironic/drivers/modules/redfish/vendor.py b/ironic/drivers/modules/redfish/vendor.py +index b54050b..1ae6c14 100644 +--- a/ironic/drivers/modules/redfish/vendor.py ++++ b/ironic/drivers/modules/redfish/vendor.py +@@ -22,6 +22,7 @@ + from ironic.common import exception + from ironic.common.i18n import _ + from ironic.common import metrics_utils ++from ironic.common import validate + from ironic.drivers import base + from ironic.drivers.modules.redfish import boot as redfish_boot + from ironic.drivers.modules.redfish import utils as redfish_utils +@@ -206,9 +207,15 @@ + """Verify that the args input are valid.""" + # We can only check if the kwargs contain the id field. + +- if not kwargs.get('id'): ++ bmc_subscription_id = kwargs.get('id') ++ if not bmc_subscription_id: + raise exception.InvalidParameterValue(_("id can't be None")) + ++ if not validate.is_bmc_subscription_id_valid(bmc_subscription_id): ++ raise exception.InvalidParameterValue(_( ++ "Invalid BMC subscription ID value: '%s'") % ++ bmc_subscription_id) ++ + @METRICS.timer('RedfishVendorPassthru.delete_subscription') + @base.passthru(['DELETE'], async_call=False, + description=_("Delete a subscription on a node. " +@@ -225,22 +232,26 @@ + try: + event_service = redfish_utils.get_event_service(task.node) + redfish_subscriptions = event_service.subscriptions +- bmc_id = kwargs.get('id') ++ ++ bmc_subscription_id = kwargs.get('id') ++ + # NOTE(iurygregory): some BMCs doesn't report the last / + # in the path for the resource, since we will add the ID + # we need to make sure the separator is present. + separator = "" if redfish_subscriptions.path[-1] == "/" else "/" + +- resource = redfish_subscriptions.path + separator + bmc_id ++ resource = redfish_subscriptions.path + separator + \ ++ bmc_subscription_id + subscription = redfish_subscriptions.get_member(resource) + msg = (_('Sucessfuly deleted subscription %(id)s on node ' +- '%(node)s') % {'id': bmc_id, 'node': task.node.uuid}) ++ '%(node)s') % {'id': bmc_subscription_id, ++ 'node': task.node.uuid}) + subscription.delete() + LOG.debug(msg) + except sushy.exceptions.SushyError as e: + error_msg = (_('Redfish delete_subscription failed for ' + 'subscription %(id)s on node %(node)s. ' +- 'Error: %(error)s') % {'id': bmc_id, ++ 'Error: %(error)s') % {'id': bmc_subscription_id, + 'node': task.node.uuid, + 'error': e}) + LOG.error(error_msg) +@@ -285,18 +296,24 @@ + try: + event_service = redfish_utils.get_event_service(task.node) + redfish_subscriptions = event_service.subscriptions +- bmc_id = kwargs.get('id') ++ ++ bmc_subscription_id = kwargs.get('id') ++ if not validate.is_bmc_subscription_id_valid(bmc_subscription_id): ++ raise exception.InvalidParameterValue(_( ++ "Invalid BMC ID value: '%s'") % bmc_subscription_id) ++ + # NOTE(iurygregory): some BMCs doesn't report the last / + # in the path for the resource, since we will add the ID + # we need to make sure the separator is present. + separator = "" if redfish_subscriptions.path[-1] == "/" else "/" +- resource = redfish_subscriptions.path + separator + bmc_id ++ resource = redfish_subscriptions.path + separator + \ ++ bmc_subscription_id + subscription = event_service.subscriptions.get_member(resource) + return self._filter_subscription_fields(subscription.json) + except sushy.exceptions.SushyError as e: + error_msg = (_('Redfish get_subscription failed for ' + 'subscription %(id)s on node %(node)s. ' +- 'Error: %(error)s') % {'id': bmc_id, ++ 'Error: %(error)s') % {'id': bmc_subscription_id, + 'node': task.node.uuid, + 'error': e}) + LOG.error(error_msg) +diff --git a/ironic/tests/unit/common/test_validate.py b/ironic/tests/unit/common/test_validate.py +new file mode 100644 +index 0000000..4e0ef7e +--- /dev/null ++++ b/ironic/tests/unit/common/test_validate.py +@@ -0,0 +1,48 @@ ++# Licensed under the Apache License, Version 2.0 (the "License"); you may ++# not use this file except in compliance with the License. You may obtain ++# a copy of the License at ++# ++# http://www.apache.org/licenses/LICENSE-2.0 ++# ++# Unless required by applicable law or agreed to in writing, software ++# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT ++# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the ++# License for the specific language governing permissions and limitations ++# under the License. ++ ++from ironic.common import validate ++ ++from ironic.tests import base ++ ++from ddt import data ++from ddt import ddt ++from ddt import unpack ++ ++ ++def annotate(name, *args): ++ class AnnotatedList(list): ++ pass ++ ++ al = AnnotatedList([*args]) ++ al.__name__ = name ++ return al ++ ++ ++@ddt ++class ValidateTestCase(base.TestCase): ++ @data( ++ annotate('good id', '1', True), ++ annotate('another good id', 'some.string', True), ++ annotate('bad because of ..', 'some...string', False), ++ *[annotate( ++ f"Character {c} is considered invalid", ++ f'some_id{c}rest_of_id', ++ False,) for c in validate.URL_ILLEGAL_CHARS] ++ ) ++ @unpack ++ def test_bmc_subscription_id_valid(self, ++ bmc_subscription_id: str, ++ expected_result: bool): ++ self.assertEqual( ++ expected_result, ++ validate.is_bmc_subscription_id_valid(bmc_subscription_id)) +diff --git a/ironic/tests/unit/drivers/modules/redfish/test_vendor.py b/ironic/tests/unit/drivers/modules/redfish/test_vendor.py +index a878905..ce510b0 100644 +--- a/ironic/tests/unit/drivers/modules/redfish/test_vendor.py ++++ b/ironic/tests/unit/drivers/modules/redfish/test_vendor.py +@@ -124,7 +124,7 @@ + **kwargs + ) + +- def test_validate_invalid_delete_subscription(self): ++ def test_validate_missing_delete_subscription(self): + with task_manager.acquire(self.context, self.node.uuid, + shared=True) as task: + kwargs = {} # Empty missing id key +@@ -133,6 +133,15 @@ + task.driver.vendor.validate, task, 'delete_subscription', + **kwargs) + ++ def test_validate_invalid_delete_subscription(self): ++ with task_manager.acquire(self.context, self.node.uuid, ++ shared=True) as task: ++ kwargs = {'id': 'bad..id'} ++ self.assertRaises( ++ exception.InvalidParameterValue, ++ task.driver.vendor.validate, task, 'delete_subscription', ++ **kwargs) ++ + @mock.patch.object(redfish_utils, 'get_event_service', autospec=True) + def test_delete_subscription(self, mock_get_event_service): + kwargs = {'id': '30'} +@@ -237,6 +246,26 @@ + task, **kwargs) + + @mock.patch.object(redfish_utils, 'get_event_service', autospec=True) ++ def test_get_subscription_invalid_subscription_id(self, ++ mock_get_event_service): ++ kwargs = {'id': '3..0'} ++ mock_subscriptions = mock.MagicMock() ++ mock_evt_serv = mock_get_event_service.return_value ++ mock_evt_serv.subscriptions = mock_subscriptions ++ mock_subscriptions.path.return_value = \ ++ "/redfish/v1/EventService/Subscriptions/" ++ uri = "/redfish/v1/EventService/Subscriptions/" + kwargs.get('id') ++ mock_subscriptions.get_member.side_effect = [ ++ sushy.exceptions.ResourceNotFoundError('GET', uri, mock.Mock()) ++ ] ++ ++ with task_manager.acquire(self.context, self.node.uuid, ++ shared=True) as task: ++ self.assertRaises(exception.InvalidParameterValue, ++ task.driver.vendor.get_subscription, ++ task, **kwargs) ++ ++ @mock.patch.object(redfish_utils, 'get_event_service', autospec=True) + def test_create_subscription(self, mock_get_event_service): + subscription_json = { + "@odata.context": "", +diff --git a/releasenotes/notes/validate-bmc-subscription-id-redfish-vendor-passthru-50b5a20681a9e039.yaml b/releasenotes/notes/validate-bmc-subscription-id-redfish-vendor-passthru-50b5a20681a9e039.yaml +new file mode 100644 +index 0000000..53c0732 +--- /dev/null ++++ b/releasenotes/notes/validate-bmc-subscription-id-redfish-vendor-passthru-50b5a20681a9e039.yaml +@@ -0,0 +1,8 @@ ++--- ++security: ++ - | ++ Add validation for BMC subscription IDs used to get or delete BMC ++ subscriptions via redfish vendor passthru. Note that there's no explicit ++ specification for what constitutes a valid or invalid BMC subscription ID, ++ therefore validation consists of forbidding illegal characters and ++ substrings. Addresses CVE-2026-90458. diff -Nru ironic-29.0.5/debian/patches/CVE-2026-90461_Add-image_server_auth_hosts-to-restrict-credential-scope.patch ironic-29.0.5/debian/patches/CVE-2026-90461_Add-image_server_auth_hosts-to-restrict-credential-scope.patch --- ironic-29.0.5/debian/patches/CVE-2026-90461_Add-image_server_auth_hosts-to-restrict-credential-scope.patch 1970-01-01 00:00:00.000000000 +0000 +++ ironic-29.0.5/debian/patches/CVE-2026-90461_Add-image_server_auth_hosts-to-restrict-credential-scope.patch 2026-09-24 17:06:22.000000000 +0000 @@ -0,0 +1,743 @@ +Author: Julia Kreger +Date: Tue, 04 Aug 2026 09:55:31 -0700 +Description: [PATCH] Add image_server_auth_hosts to restrict credential scope + When image_server_auth_strategy is configured, the operator's + image server credentials are sent to every host from which images + are requested. A tenant-authenticated user can set image_source + to an attacker-controlled URL, triggering the conductor to send + the operator's credentials to that host. + . + Adds a new [deploy]image_server_auth_hosts configuration option + that allows operators to restrict which hosts receive image server + credentials. When the list is configured, only matching hosts + receive credentials. When not configured, existing behavior is + preserved for backwards compatibility. + . + Adds a new [deploy]image_server_auth_permit_unknown_hosts boolean + option (default True). When True and image_server_auth_hosts is + not configured, credentials are sent to all hosts preserving + existing behavior. When False, credentials are only sent to hosts + in image_server_auth_hosts. The default will change to False in + the 2026.2 release. + . + Adds security warnings to image_server_user and + image_server_password help text alerting operators that credentials + may be sent to all hosts if image_server_auth_hosts is not + configured. + . + Host matching considers the http, https and oci schemes. Only the + hostname is compared; the port is intentionally ignored, so an + entry such as images.example.com matches regardless of the port + used in the image URL. Schemes that do not transmit credentials to + a remote host, such as file:// and bare references without a scheme + (e.g. a Glance image UUID), are always permitted. + . + The credential filtering is applied in these code paths: + - gen_auth_from_conf_user_pass() for conductor-side HTTP requests + - write_image() to prevent forwarding credentials to IPA when + the image download URL is not in the permitted list + - get_image_service_auth_override() for the OCI registry fallback + to image_server_user/image_server_password. This gates the only + path by which the global image_server credentials reach an OCI + registry; the host filtered on (image_source) is the host the + OCI client authenticates against. +Bug: https://launchpad.net/bugs/2162816 +Bug-Debian: https://bugs.debian.org/1148451 +Assisted-By: Claude Code - Claude Opus 4.6 +Change-Id: I41122a0de8ffc8bef0434fa9a2b5a54dfde3473b +Signed-off-by: Julia Kreger +Origin: upstream, https://review.opendev.org/c/openstack/ironic/+/1003598 +Last-Update: 2026-09-21 + +diff --git a/doc/source/admin/user-image-basic-auth.rst b/doc/source/admin/user-image-basic-auth.rst +index 59331ab..74d2eb0 100644 +--- a/doc/source/admin/user-image-basic-auth.rst ++++ b/doc/source/admin/user-image-basic-auth.rst +@@ -28,6 +28,13 @@ + The authentication strategy configuration affects the download process + for images downloaded by the conductor or the ironic-python-agent. + ++.. note:: ++ The default value of ``image_server_auth_strategy`` is ``noauth``. ++ When the default is in effect, no credentials are configured or ++ sent, and none of the options described in this document have any ++ effect. The considerations below only apply to operators who have ++ explicitly set ``image_server_auth_strategy`` to ``http_basic``. ++ + Example + ------- + +@@ -43,6 +50,71 @@ + image_server_password = password + ... + ++Restricting credential scope ++---------------------------- ++ ++When ``image_server_auth_strategy`` is explicitly set to ``http_basic``, ++Ironic will send the configured credentials to **every** host from which ++images are requested. This means that if a user supplies an image URL ++pointing to a host the operator does not control, the operator's image ++server credentials will be sent to that host. ++ ++.. important:: ++ This only applies when the operator has explicitly changed ++ ``image_server_auth_strategy`` from its default value of ``noauth`` ++ to ``http_basic``. Deployments using the default ``noauth`` strategy ++ do not send any credentials and are not affected. ++ ++To mitigate this, operators may configure ``image_server_auth_hosts`` with a ++list of trusted hostnames or domain suffixes. When this option is configured, ++credentials will only be sent to hosts matching an entry in the list. ++Requests to hosts not in the list will proceed without credentials. ++ ++Entries may be exact hostnames (e.g. ``images.example.com``) or domain ++suffixes prefixed with a dot (e.g. ``.example.com``). A suffix entry matches ++any hostname under that domain, so ``.example.com`` matches ++``images.example.com`` and ``backup.example.com`` but does not match the ++bare ``example.com``. ++ ++This filtering is applied both when the conductor itself retrieves images ++and when determining whether to supply credentials to the ++ironic-python-agent for image downloads. ++ ++.. code-block:: ini ++ ++ [deploy] ++ ... ++ image_server_auth_strategy = http_basic ++ image_server_user = username ++ image_server_password = password ++ image_server_auth_hosts = images.example.com,.internal ++ ... ++ ++.. note:: ++ In this release, ``image_server_auth_permit_unknown_hosts`` defaults ++ to ``True``. When ``image_server_auth_hosts`` is not configured, ++ credentials are therefore still sent to every host, preserving the ++ prior behavior. To restrict credentials in this release, either ++ configure ``image_server_auth_hosts`` or set ++ ``image_server_auth_permit_unknown_hosts`` to ``False``. The default ++ of ``image_server_auth_permit_unknown_hosts`` will change to ++ ``False`` in the 2026.2 release, after which credentials are not sent ++ to any host unless ``image_server_auth_hosts`` is configured. ++ ++.. note:: ++ Only the hostname is considered when matching entries; the port is ++ ignored. An entry of ``images.example.com`` therefore matches ++ ``images.example.com`` regardless of the port used in the image URL. ++ ++.. note:: ++ Each Ironic conductor operates an HTTP server for serving boot ++ artifacts and locally cached images to nodes. This endpoint, ++ configured via ``[deploy]http_url``, is designed to support ++ unauthenticated access and does not require image server ++ credentials. Operators should not include the conductor's own ++ HTTP server hostname in the ``image_server_auth_hosts`` list ++ as it serves no purpose in that context. ++ + Known limitations + ----------------- + +@@ -50,7 +122,17 @@ + implemented via the global Ironic configuration thus it doesn't provide node + specific customization options. + +-When ``image_server_auth_strategy`` is set to any valid value all image +-sources will be treated with the same authentication strategy and Ironic will +-use the same credentials against all sources. ++When ``image_server_auth_strategy`` is set to ``http_basic`` and ++``image_server_auth_hosts`` is not configured, all image sources will be ++treated with the same authentication strategy and Ironic will use the same ++credentials against all sources. Operators who have configured ++``http_basic`` authentication are encouraged to configure ++``image_server_auth_hosts`` to restrict which hosts receive credentials. + ++.. note:: ++ The default value of ``image_server_auth_permit_unknown_hosts`` will ++ change from ``True`` to ``False`` in the 2026.2 release. After that ++ change, operators who have configured ``http_basic`` authentication ++ must also explicitly configure ``image_server_auth_hosts`` for ++ credentials to be sent. Operators are encouraged to configure ++ ``image_server_auth_hosts`` before the 2026.2 release. +diff --git a/ironic/common/image_service.py b/ironic/common/image_service.py +index 209f636..7a4ccb9 100644 +--- a/ironic/common/image_service.py ++++ b/ironic/common/image_service.py +@@ -89,6 +89,71 @@ + return None + + ++def is_host_auth_permitted(image_href): ++ """Check if credentials should be sent to the host in image_href. ++ ++ When ``[deploy]image_server_auth_hosts`` is configured, the image ++ URL's hostname must match an entry in the list for credentials to ++ be sent. ++ ++ When ``[deploy]image_server_auth_hosts`` is not configured, the ++ behavior depends on ++ ``[deploy]image_server_auth_permit_unknown_hosts``: ++ ++ * ``True`` (default): credentials are sent to all hosts, preserving ++ backwards-compatible behavior. ++ * ``False``: credentials are not sent to any host unless it is ++ listed in ``image_server_auth_hosts``. ++ ++ Schemes which do not transmit credentials to a remote host, such ++ as ``file://`` and bare references without a scheme (e.g. a Glance ++ image UUID), are always permitted. Remote schemes which may carry ++ credentials, namely ``http``, ``https`` and ``oci``, are subject to ++ host filtering. ++ ++ Entries in the list may be exact hostnames or domain suffixes ++ prefixed with a dot. For example, ``.example.com`` matches ++ ``images.example.com`` and ``backup.example.com`` but does ++ not match the bare ``example.com``. ++ ++ :param image_href: URL of the image being accessed. ++ :returns: True if credentials may be sent, False otherwise. ++ """ ++ parsed = urlparse.urlparse(image_href) ++ if parsed.scheme not in ('http', 'https', 'oci'): ++ return True ++ permitted_hosts = CONF.deploy.image_server_auth_hosts ++ if not permitted_hosts: ++ if CONF.deploy.image_server_auth_permit_unknown_hosts: ++ return True ++ LOG.debug( ++ 'Credentials will not be sent for image %s ' ++ 'because image_server_auth_hosts is not ' ++ 'configured and ' ++ 'image_server_auth_permit_unknown_hosts ' ++ 'is False.', image_href) ++ return False ++ # NOTE(TheJulia): Match on the hostname only; the port is ++ # intentionally ignored so that an entry such as ++ # ``images.example.com`` matches regardless of the port used ++ # in the image URL. ``parsed.hostname`` excludes any port. ++ hostname = parsed.hostname ++ if not hostname: ++ return False ++ for entry in permitted_hosts: ++ if entry.startswith('.'): ++ if hostname.endswith(entry): ++ return True ++ elif hostname == entry: ++ return True ++ LOG.debug( ++ 'Credentials will not be sent for image %s ' ++ 'because host %s is not in the permitted ' ++ 'image_server_auth_hosts list.', ++ image_href, hostname) ++ return False ++ ++ + class HttpImageService(BaseImageService): + """Provides retrieval of disk images using HTTP.""" + +@@ -120,6 +185,8 @@ + image_server_password = None + + if CONF.deploy.image_server_auth_strategy == 'http_basic': ++ if not is_host_auth_permitted(image_href): ++ return None + HttpImageService.verify_basic_auth_cred_format( + CONF.deploy.image_server_user, + CONF.deploy.image_server_password, +@@ -1086,6 +1153,20 @@ + 'username': '', + 'password': node.driver_info.get('image_pull_secret'), + } ++ # TODO(TheJulia): Allow users to supply per-node HTTP basic ++ # auth credentials via instance_info, removing the need ++ # for global credentials. See bug 2162816. ++ elif (CONF.deploy.image_server_user ++ and CONF.deploy.image_server_password ++ and is_host_auth_permitted( ++ node.instance_info.get('image_source', ''))): ++ # Fallback to image_server_user and image_server_password ++ # if configured on the deploy interface and the image ++ # source host is permitted to receive credentials. ++ return { ++ 'username': CONF.deploy.image_server_user, ++ 'password': CONF.deploy.image_server_password, ++ } + # In the future, we likely want to add logic here to enable condutor + # configuration housed credentials. + else: +diff --git a/ironic/conf/deploy.py b/ironic/conf/deploy.py +index 3811ff6..efe4e2c 100644 +--- a/ironic/conf/deploy.py ++++ b/ironic/conf/deploy.py +@@ -45,13 +45,79 @@ + mutable=True, + help=_("Can be used by any authentication strategy that " + "requires username credential. Currently utilized by " +- "the http_basic authentication strategy.")), ++ "the http_basic authentication strategy. This " ++ "option has no effect when " ++ "``image_server_auth_strategy`` is set to " ++ "``noauth`` (the default). WARNING: When " ++ "``image_server_auth_strategy`` is set to " ++ "``http_basic`` and ``image_server_auth_hosts`` " ++ "is not configured, this credential will be sent " ++ "to every host from which images are requested, " ++ "including user-supplied URLs. Operators are " ++ "strongly encouraged to configure " ++ "``image_server_auth_hosts`` to restrict which " ++ "hosts receive credentials.")), + cfg.StrOpt('image_server_password', + mutable=True, + secret=True, + help=_("Can be used by any authentication strategy that " + "requires password credential. Currently utilized by " +- "the http_basic authentication strategy.")), ++ "the http_basic authentication strategy. This " ++ "option has no effect when " ++ "``image_server_auth_strategy`` is set to " ++ "``noauth`` (the default). WARNING: When " ++ "``image_server_auth_strategy`` is set to " ++ "``http_basic`` and ``image_server_auth_hosts`` " ++ "is not configured, this credential will be sent " ++ "to every host from which images are requested, " ++ "including user-supplied URLs. Operators are " ++ "strongly encouraged to configure " ++ "``image_server_auth_hosts`` to restrict which " ++ "hosts receive credentials.")), ++ cfg.ListOpt('image_server_auth_hosts', ++ default=[], ++ mutable=True, ++ help=_("Operators may optionally configure a list of " ++ "host names which credentials may be supplied " ++ "to as a part of image retrieval. This option " ++ "only takes effect when " ++ "``image_server_auth_strategy`` is set to a " ++ "value other than ``noauth`` (the default). " ++ "When ``image_server_auth_strategy`` is " ++ "``noauth``, no credentials are sent regardless " ++ "of this setting. If this option is not " ++ "configured, image server credentials will be " ++ "sent to every host which images are requested " ++ "from. If configured, only matching hosts will " ++ "be sent credentials. Entries may be exact " ++ "hostnames (e.g. ``images.example.com``) or " ++ "domain suffixes prefixed with a dot " ++ "(e.g. ``.example.com`` to match all hosts " ++ "under that domain). This is a security feature " ++ "to prevent leakage of image server credentials " ++ "to untrusted hosts.")), ++ cfg.BoolOpt('image_server_auth_permit_unknown_hosts', ++ default=True, ++ mutable=True, ++ help=_("This option only takes effect when " ++ "``image_server_auth_strategy`` is set to a " ++ "value other than ``noauth`` (the default) and " ++ "``image_server_auth_hosts`` is not configured. " ++ "When set to True, image server credentials " ++ "will be sent to all hosts from which images " ++ "are requested. This preserves backwards " ++ "compatible behavior but risks leaking " ++ "credentials to untrusted hosts. When set to " ++ "False, credentials will only be sent to hosts " ++ "explicitly listed in " ++ "``image_server_auth_hosts``. " ++ "DEPRECATED: The default value of this option " ++ "will change to False in the 2026.2 release. " ++ "Operators who have configured " ++ "``image_server_auth_strategy`` to ``http_basic``" ++ " should configure ``image_server_auth_hosts`` " ++ "and set this option to False before that " ++ "release.")), + cfg.URIOpt('external_http_url', + schemes=['http', 'https'], + help=_("URL of the ironic-conductor node's HTTP server for " +diff --git a/ironic/drivers/modules/agent.py b/ironic/drivers/modules/agent.py +index 39f25bb..9ee97e6 100644 +--- a/ironic/drivers/modules/agent.py ++++ b/ironic/drivers/modules/agent.py +@@ -713,11 +713,14 @@ + 'stream_raw_images': CONF.agent.stream_raw_images, + } + +- if (CONF.deploy.image_server_auth_strategy != 'noauth'): ++ if (CONF.deploy.image_server_auth_strategy != 'noauth' ++ and image_service.is_host_auth_permitted( ++ node.instance_info['image_url'])): + image_info['image_server_auth_strategy'] = \ + CONF.deploy.image_server_auth_strategy +- image_info['image_server_user'] = CONF.deploy.image_server_user +- image_info['image_server_password'] =\ ++ image_info['image_server_user'] = \ ++ CONF.deploy.image_server_user ++ image_info['image_server_password'] = \ + CONF.deploy.image_server_password + + if node.instance_info.get('image_checksum'): +diff --git a/ironic/tests/unit/common/test_image_service.py b/ironic/tests/unit/common/test_image_service.py +index c5621cb..5143a15 100644 +--- a/ironic/tests/unit/common/test_image_service.py ++++ b/ironic/tests/unit/common/test_image_service.py +@@ -364,6 +364,49 @@ + self.service.gen_auth_from_conf_user_pass(self.href) + self.assertIsNone(return_auth) + ++ def test_gen_auth_from_conf_user_pass_host_permitted(self): ++ cfg.CONF.set_override('image_server_auth_strategy', ++ 'http_basic', 'deploy') ++ cfg.CONF.set_override('image_server_password', ++ 'SpongeBob', 'deploy') ++ cfg.CONF.set_override('image_server_user', ++ 'SquarePants', 'deploy') ++ cfg.CONF.set_override('image_server_auth_hosts', ++ ['127.0.0.1'], 'deploy') ++ return_auth = \ ++ self.service.gen_auth_from_conf_user_pass(self.href) ++ expected = requests.auth.HTTPBasicAuth( ++ 'SquarePants', 'SpongeBob') ++ self.assertEqual(expected, return_auth) ++ ++ def test_gen_auth_from_conf_user_pass_host_denied(self): ++ cfg.CONF.set_override('image_server_auth_strategy', ++ 'http_basic', 'deploy') ++ cfg.CONF.set_override('image_server_password', ++ 'SpongeBob', 'deploy') ++ cfg.CONF.set_override('image_server_user', ++ 'SquarePants', 'deploy') ++ cfg.CONF.set_override('image_server_auth_hosts', ++ ['trusted.example.com'], 'deploy') ++ return_auth = \ ++ self.service.gen_auth_from_conf_user_pass(self.href) ++ self.assertIsNone(return_auth) ++ ++ def test_gen_auth_from_conf_user_pass_hosts_empty(self): ++ cfg.CONF.set_override('image_server_auth_strategy', ++ 'http_basic', 'deploy') ++ cfg.CONF.set_override('image_server_password', ++ 'SpongeBob', 'deploy') ++ cfg.CONF.set_override('image_server_user', ++ 'SquarePants', 'deploy') ++ cfg.CONF.set_override('image_server_auth_hosts', ++ [], 'deploy') ++ return_auth = \ ++ self.service.gen_auth_from_conf_user_pass(self.href) ++ expected = requests.auth.HTTPBasicAuth( ++ 'SquarePants', 'SpongeBob') ++ self.assertEqual(expected, return_auth) ++ + @mock.patch.object(requests, 'head', autospec=True) + def _test_show(self, head_mock, mtime, mtime_date): + head_mock.return_value.status_code = http_client.OK +@@ -1337,7 +1380,240 @@ + res = image_service.get_image_service_auth_override(test_node) + self.assertIsNone(res) + ++ def test_get_image_service_auth_override_config_fallback(self): ++ """Test fallback to CONF.deploy.image_server_user/password.""" ++ cfg.CONF.set_override('image_server_user', 'config_user', 'deploy') ++ cfg.CONF.set_override('image_server_password', 'config_pass', ++ 'deploy') ++ test_node = mock.Mock() ++ test_node.instance_info = {} ++ test_node.driver_info = {} ++ res = image_service.get_image_service_auth_override(test_node) ++ self.assertDictEqual({'username': 'config_user', ++ 'password': 'config_pass'}, res) ++ ++ def test_get_image_service_auth_override_config_fallback_oci_host(self): ++ """Config fallback is sent when the oci host is permitted.""" ++ cfg.CONF.set_override('image_server_user', 'config_user', 'deploy') ++ cfg.CONF.set_override('image_server_password', 'config_pass', ++ 'deploy') ++ cfg.CONF.set_override('image_server_auth_hosts', ++ ['registry.example.com'], 'deploy') ++ test_node = mock.Mock() ++ test_node.instance_info = { ++ 'image_source': 'oci://registry.example.com/img@sha256:' ++ + 'a' * 64} ++ test_node.driver_info = {} ++ res = image_service.get_image_service_auth_override(test_node) ++ self.assertDictEqual({'username': 'config_user', ++ 'password': 'config_pass'}, res) ++ ++ def test_get_image_service_auth_override_config_fallback_oci_denied(self): ++ """Config fallback is withheld when the oci host is not permitted.""" ++ cfg.CONF.set_override('image_server_user', 'config_user', 'deploy') ++ cfg.CONF.set_override('image_server_password', 'config_pass', ++ 'deploy') ++ cfg.CONF.set_override('image_server_auth_hosts', ++ ['registry.example.com'], 'deploy') ++ test_node = mock.Mock() ++ test_node.instance_info = { ++ 'image_source': 'oci://evil.attacker.com/img@sha256:' ++ + 'a' * 64} ++ test_node.driver_info = {} ++ res = image_service.get_image_service_auth_override(test_node) ++ self.assertIsNone(res) ++ + def test_is_container_registry_url(self): + self.assertFalse(image_service.is_container_registry_url(None)) + self.assertFalse(image_service.is_container_registry_url('https://')) + self.assertTrue(image_service.is_container_registry_url('oci://.')) ++ ++ ++class IsHostAuthPermittedTestCase(base.TestCase): ++ ++ def test_empty_list_permits_all(self): ++ cfg.CONF.set_override('image_server_auth_hosts', ++ [], 'deploy') ++ self.assertTrue( ++ image_service.is_host_auth_permitted( ++ 'http://any.host.example.com/image')) ++ ++ def test_host_in_list_permitted(self): ++ cfg.CONF.set_override('image_server_auth_hosts', ++ ['images.example.com'], 'deploy') ++ self.assertTrue( ++ image_service.is_host_auth_permitted( ++ 'https://images.example.com/fedora.qcow2')) ++ ++ def test_host_not_in_list_denied(self): ++ cfg.CONF.set_override('image_server_auth_hosts', ++ ['images.example.com'], 'deploy') ++ self.assertFalse( ++ image_service.is_host_auth_permitted( ++ 'https://evil.attacker.com/image')) ++ ++ def test_file_scheme_always_permitted(self): ++ cfg.CONF.set_override('image_server_auth_hosts', ++ ['images.example.com'], 'deploy') ++ self.assertTrue( ++ image_service.is_host_auth_permitted( ++ 'file:///tmp/image.qcow2')) ++ ++ def test_no_hostname_denied(self): ++ cfg.CONF.set_override('image_server_auth_hosts', ++ ['images.example.com'], 'deploy') ++ self.assertFalse( ++ image_service.is_host_auth_permitted( ++ 'http:///path/only')) ++ ++ def test_multiple_hosts_in_list(self): ++ cfg.CONF.set_override('image_server_auth_hosts', ++ ['img1.example.com', ++ 'img2.example.com'], ++ 'deploy') ++ self.assertTrue( ++ image_service.is_host_auth_permitted( ++ 'https://img2.example.com/fedora.qcow2')) ++ self.assertFalse( ++ image_service.is_host_auth_permitted( ++ 'https://img3.example.com/fedora.qcow2')) ++ ++ def test_domain_suffix_match(self): ++ cfg.CONF.set_override('image_server_auth_hosts', ++ ['.example.com'], 'deploy') ++ self.assertTrue( ++ image_service.is_host_auth_permitted( ++ 'https://images.example.com/fedora.qcow2')) ++ ++ def test_domain_suffix_nested_match(self): ++ cfg.CONF.set_override('image_server_auth_hosts', ++ ['.example.com'], 'deploy') ++ self.assertTrue( ++ image_service.is_host_auth_permitted( ++ 'https://a.b.example.com/fedora.qcow2')) ++ ++ def test_domain_suffix_no_bare_match(self): ++ cfg.CONF.set_override('image_server_auth_hosts', ++ ['.example.com'], 'deploy') ++ self.assertFalse( ++ image_service.is_host_auth_permitted( ++ 'https://example.com/fedora.qcow2')) ++ ++ def test_domain_suffix_no_partial_match(self): ++ cfg.CONF.set_override('image_server_auth_hosts', ++ ['.example.com'], 'deploy') ++ self.assertFalse( ++ image_service.is_host_auth_permitted( ++ 'https://notexample.com/fedora.qcow2')) ++ ++ def test_mixed_exact_and_suffix(self): ++ cfg.CONF.set_override('image_server_auth_hosts', ++ ['exact.host.com', ++ '.internal'], ++ 'deploy') ++ self.assertTrue( ++ image_service.is_host_auth_permitted( ++ 'https://exact.host.com/image')) ++ self.assertTrue( ++ image_service.is_host_auth_permitted( ++ 'https://images.internal/image')) ++ self.assertFalse( ++ image_service.is_host_auth_permitted( ++ 'https://other.external.com/image')) ++ ++ def test_permit_unknown_hosts_true_no_list(self): ++ cfg.CONF.set_override('image_server_auth_hosts', ++ [], 'deploy') ++ cfg.CONF.set_override( ++ 'image_server_auth_permit_unknown_hosts', ++ True, 'deploy') ++ self.assertTrue( ++ image_service.is_host_auth_permitted( ++ 'http://any.host.example.com/image')) ++ ++ def test_permit_unknown_hosts_false_no_list(self): ++ cfg.CONF.set_override('image_server_auth_hosts', ++ [], 'deploy') ++ cfg.CONF.set_override( ++ 'image_server_auth_permit_unknown_hosts', ++ False, 'deploy') ++ self.assertFalse( ++ image_service.is_host_auth_permitted( ++ 'http://any.host.example.com/image')) ++ ++ def test_permit_unknown_hosts_false_with_list(self): ++ cfg.CONF.set_override('image_server_auth_hosts', ++ ['images.example.com'], ++ 'deploy') ++ cfg.CONF.set_override( ++ 'image_server_auth_permit_unknown_hosts', ++ False, 'deploy') ++ self.assertTrue( ++ image_service.is_host_auth_permitted( ++ 'https://images.example.com/fedora.qcow2')) ++ self.assertFalse( ++ image_service.is_host_auth_permitted( ++ 'https://evil.attacker.com/image')) ++ ++ def test_port_is_ignored_for_match(self): ++ cfg.CONF.set_override('image_server_auth_hosts', ++ ['images.example.com'], 'deploy') ++ self.assertTrue( ++ image_service.is_host_auth_permitted( ++ 'https://images.example.com:8080/fedora.qcow2')) ++ self.assertFalse( ++ image_service.is_host_auth_permitted( ++ 'https://evil.attacker.com:8080/image')) ++ ++ def test_port_is_ignored_for_suffix_match(self): ++ cfg.CONF.set_override('image_server_auth_hosts', ++ ['.example.com'], 'deploy') ++ self.assertTrue( ++ image_service.is_host_auth_permitted( ++ 'https://images.example.com:8080/fedora.qcow2')) ++ ++ def test_oci_host_in_list_permitted(self): ++ cfg.CONF.set_override('image_server_auth_hosts', ++ ['registry.example.com'], 'deploy') ++ self.assertTrue( ++ image_service.is_host_auth_permitted( ++ 'oci://registry.example.com/project/img@sha256:' ++ + 'a' * 64)) ++ ++ def test_oci_host_not_in_list_denied(self): ++ cfg.CONF.set_override('image_server_auth_hosts', ++ ['registry.example.com'], 'deploy') ++ self.assertFalse( ++ image_service.is_host_auth_permitted( ++ 'oci://evil.attacker.com/project/img@sha256:' ++ + 'a' * 64)) ++ ++ def test_oci_domain_suffix_match(self): ++ cfg.CONF.set_override('image_server_auth_hosts', ++ ['.example.com'], 'deploy') ++ self.assertTrue( ++ image_service.is_host_auth_permitted( ++ 'oci://registry.example.com/project/img@sha256:' ++ + 'a' * 64)) ++ ++ def test_oci_permit_unknown_hosts_false_no_list(self): ++ cfg.CONF.set_override('image_server_auth_hosts', ++ [], 'deploy') ++ cfg.CONF.set_override( ++ 'image_server_auth_permit_unknown_hosts', ++ False, 'deploy') ++ self.assertFalse( ++ image_service.is_host_auth_permitted( ++ 'oci://registry.example.com/project/img@sha256:' ++ + 'a' * 64)) ++ ++ def test_oci_permit_unknown_hosts_true_no_list(self): ++ cfg.CONF.set_override('image_server_auth_hosts', ++ [], 'deploy') ++ cfg.CONF.set_override( ++ 'image_server_auth_permit_unknown_hosts', ++ True, 'deploy') ++ self.assertTrue( ++ image_service.is_host_auth_permitted( ++ 'oci://registry.example.com/project/img@sha256:' ++ + 'a' * 64)) +diff --git a/ironic/tests/unit/drivers/modules/test_agent.py b/ironic/tests/unit/drivers/modules/test_agent.py +index 64b2633..94e8888 100644 +--- a/ironic/tests/unit/drivers/modules/test_agent.py ++++ b/ironic/tests/unit/drivers/modules/test_agent.py +@@ -1517,6 +1517,42 @@ + 'deploy') + self._test_write_image() + ++ def test_write_image_basic_auth_host_permitted(self): ++ cfg.CONF.set_override('image_server_auth_strategy', ++ 'http_basic', ++ 'deploy') ++ cfg.CONF.set_override('image_server_user', ++ 'SpongeBob', ++ 'deploy') ++ cfg.CONF.set_override('image_server_password', ++ 'SquarePants', ++ 'deploy') ++ cfg.CONF.set_override('image_server_auth_hosts', ++ ['image'], ++ 'deploy') ++ self._test_write_image( ++ additional_expected_image_info={ ++ 'image_server_auth_strategy': 'http_basic', ++ 'image_server_user': 'SpongeBob', ++ 'image_server_password': 'SquarePants' ++ } ++ ) ++ ++ def test_write_image_basic_auth_host_denied(self): ++ cfg.CONF.set_override('image_server_auth_strategy', ++ 'http_basic', ++ 'deploy') ++ cfg.CONF.set_override('image_server_user', ++ 'SpongeBob', ++ 'deploy') ++ cfg.CONF.set_override('image_server_password', ++ 'SquarePants', ++ 'deploy') ++ cfg.CONF.set_override('image_server_auth_hosts', ++ ['trusted.example.com'], ++ 'deploy') ++ self._test_write_image() ++ + def test_write_image_with_no_proxy_without_proxies(self): + self._test_write_image( + additional_driver_info={'image_no_proxy': '.eggs.com'} +diff --git a/releasenotes/notes/image-server-auth-hosts-cve-2162816-3eb3ee215084ba53.yaml b/releasenotes/notes/image-server-auth-hosts-cve-2162816-3eb3ee215084ba53.yaml +new file mode 100644 +index 0000000..a934c48 +--- /dev/null ++++ b/releasenotes/notes/image-server-auth-hosts-cve-2162816-3eb3ee215084ba53.yaml +@@ -0,0 +1,19 @@ ++--- ++security: ++ - | ++ When ``[deploy]image_server_auth_strategy`` is set to ++ ``http_basic`` (not the default), configured credentials were ++ sent to every host from which images are requested, including ++ user-supplied URLs. This also applies to ``oci://`` image ++ sources, which can fall back to ``http_basic`` credentials, and ++ are subject to the same filtering. Operators using the default ++ ``noauth`` strategy are not affected. A new ++ ``[deploy]image_server_auth_hosts`` option lets operators ++ restrict which hosts receive credentials by specifying exact ++ hostnames or domain suffixes (e.g. ``.example.com``). A ++ companion ``[deploy]image_server_auth_permit_unknown_hosts`` ++ option (default ``True``) preserves backwards compatibility; ++ its default will change to ``False`` in 2026.2. Operators ++ using ``http_basic`` should configure both options. See ++ `bug 2162816 `_ ++ for details. diff -Nru ironic-29.0.5/debian/patches/OSSN-0106_Add_api_enable_ramdisk_endpoints_config_option.patch ironic-29.0.5/debian/patches/OSSN-0106_Add_api_enable_ramdisk_endpoints_config_option.patch --- ironic-29.0.5/debian/patches/OSSN-0106_Add_api_enable_ramdisk_endpoints_config_option.patch 2026-06-16 10:46:11.000000000 +0000 +++ ironic-29.0.5/debian/patches/OSSN-0106_Add_api_enable_ramdisk_endpoints_config_option.patch 2026-09-24 17:06:22.000000000 +0000 @@ -28,7 +28,7 @@ =================================================================== --- ironic.orig/doc/source/install/refarch/common.rst +++ ironic/doc/source/install/refarch/common.rst -@@ -169,13 +169,18 @@ networks. +@@ -177,13 +177,18 @@ networks. to the provisioning/cleaning/rescuing network. .. note:: @@ -54,7 +54,7 @@ =================================================================== --- ironic.orig/ironic/api/controllers/v1/ramdisk.py +++ ironic/ironic/api/controllers/v1/ramdisk.py -@@ -96,7 +96,12 @@ class LookupController(rest.RestControll +@@ -127,7 +127,12 @@ class LookupController(rest.RestControll state is not allowed for the lookup. :raises: IncompleteLookup if neither node UUID nor any valid MAC address was provided. @@ -67,7 +67,7 @@ if not api_utils.allow_ramdisk_endpoints(): raise exception.NotFound() -@@ -193,7 +198,12 @@ class HeartbeatController(rest.RestContr +@@ -204,7 +209,12 @@ class HeartbeatController(rest.RestContr :raises: NoValidHost if RPC topic for node could not be retrieved. :raises: NotFound if requested API version does not allow this endpoint. @@ -84,7 +84,7 @@ =================================================================== --- ironic.orig/ironic/common/policy.py +++ ironic/ironic/common/policy.py -@@ -1445,7 +1445,7 @@ utility_policies = [ +@@ -1528,7 +1528,7 @@ utility_policies = [ policy.DocumentedRuleDefault( name='baremetal:driver:ipa_lookup', check_str='', @@ -97,7 +97,7 @@ =================================================================== --- ironic.orig/ironic/conf/api.py +++ ironic/ironic/conf/api.py -@@ -73,6 +73,17 @@ opts = [ +@@ -74,6 +74,17 @@ opts = [ "[oslo_middleware]enable_proxy_headers_parsing " "option or configure [api]public_endpoint option " "to set URLs in responses to the SSL terminated one.")), @@ -119,7 +119,7 @@ =================================================================== --- ironic.orig/ironic/tests/unit/api/controllers/v1/test_ramdisk.py +++ ironic/ironic/tests/unit/api/controllers/v1/test_ramdisk.py -@@ -87,6 +87,15 @@ class TestLookup(test_api_base.BaseApiTe +@@ -90,6 +90,15 @@ class TestLookup(test_api_base.BaseApiTe self.assertIsNotNone(data['config']['agent_token']) self.assertNotEqual('******', data['config']['agent_token']) @@ -135,7 +135,7 @@ def test_nothing_provided(self): response = self.get_json( '/lookup', -@@ -201,6 +210,18 @@ class TestLookup(test_api_base.BaseApiTe +@@ -218,6 +227,18 @@ class TestLookup(test_api_base.BaseApiTe @mock.patch.object(rpcapi.ConductorAPI, 'get_topic_for', lambda *n: 'test-topic') class TestHeartbeat(test_api_base.BaseApiTest): diff -Nru ironic-29.0.5/debian/patches/series ironic-29.0.5/debian/patches/series --- ironic-29.0.5/debian/patches/series 2026-06-16 10:46:11.000000000 +0000 +++ ironic-29.0.5/debian/patches/series 2026-09-24 17:06:22.000000000 +0000 @@ -13,3 +13,7 @@ CVE-2026-54423-Add_operator_configurable_step_disallow_lists.patch CVE-2026-54423-block_vendor.send_raw.patch OSSN-0106_Add_api_enable_ramdisk_endpoints_config_option.patch +CVE-2026-90461_Add-image_server_auth_hosts-to-restrict-credential-scope.patch +CVE-2026-90458_OSSA-2026-047_Validate-BMC-subscription-IDs-in-Redfish-vendor-passthrough-methods.patch +CVE-2026-89419_OSSA-2026-048_Security-Fix-maintenance-state-update-policy-bypass.patch +CVE-2026-115638_OSSA-2026-049_Chunk-gzip-decompressions-and-enforce-a-limit.patch