Hello,
last week we pushed an update 3.19.2 which contained a fix for CVE-2026-12423. It was reported that provisioning tokens are not validated correctly and attacker can get access to (hashed) root passwords, or other sensitive data stored in Foreman inventory and rendered via templates. Due to various reasons, I jumped on the issue late and did a quick patch that broke some non-standard provisioning workflows.
This thread is my explanation of what happened and ask for a feedback on this. I would like to solve this the next week once we come to a good solution.
Foreman uses several ways on how to pair the incoming requests for unattended template calls:
- Token. These are UUIDs generated randomly when a host enters a build mode. These are unique enough piece of information that can be used to pair the incoming requests nicely without relying on other methods.
- IP. When token is not available (disabled, or the workflow cannot use it), then Foreman tries to find the host by its IP (TCP HTTP remote IP) and it respects HTTP proxy forwarding header as well. This is useful for OS installers which cannot use arbitrary HTTP parameters.
- MAC. For some workflows, specifically iPXE and some bootdisks,
macHTTP parameter is passed and this is matched against Foreman NIC inventory the similar way as IP is done.
The change
After the update, all the unattended requests require token to be present, this breaks:
- Generic bootdisk (needs MAC)
- Generic subnet bootdisk (needs MAC)
- iPXE (needs MAC)
We informed users to disable tokens in order to continue provisioning. However, this only works in environments with managed DHCP where IP address can be used. The change was rolled out only for Redhat (and compatible) families of OSes, so other OSes (Debian/Ubuntu) currently are not affected by the change. At least not in the stable update.
Now, tokens were never considered to be a way to block or protect the templates, they were merely a way to pair requests. This was my initial concern when I saw the ticket, but in a time crunch I decided to do this enforcement solution. Since I was worried this could break things, I narrowed it down to just Redhat family systems.
Solutions
I have two solutions in mind currently.
The first one is to make token enforcement optional, I already filed a Jira/Redmine/PR for this. The idea is simple: the default value of a newly created global setting (yeah) is to keep users safe and enforce tokens. Advanced users with bootdisk/ipxe can turn this off.
However, now that I think about it, tokens are relatively easy to acquire. Everytime a host is in build mode, PXELinux/Grub/iPXE templates are available for download on TFTP and HTTPBoot smart proxies. While both services do not allow listing of files, an attacker can be guessing MAC addresses freely and this is relatively easy thing to do since MAC address space is small e.g. when hardware vendor is known.
And this is exactly the same problem that was reported, except it was reported on the Foreman endpoint rather than TFTP/HTTPBoot service. For any kind of network provisioning, at least one of the two services must be enabled. For this reason, I am thinking if it is not better simply to revert the token enforcement patch completely and document the security limitations.
Opinions?