REDHAT-BUG-2476266: Medium severity cockpit-machines vulnerability
AIONLYREPORT package: cockpit-machines-348-1.el10 ------ Summary: RHSM Offline Token Exposure via Process Arguments in getAccessToken() (CWE-214): the package passes the RHSM offline token to a helper via argv, allowing local disclosure through process metadata while token validation is running. Requirements to exploit: An attacker needs local access to the host running Cockpit Machines, the ability to inspect another user's process metadata while the RHSM token-validation flow is active, and a deployment without /proc visibility restrictions that would otherwise block command-line inspection. Component affected: cockpit-machines; src/libvirtApi/rhel-images.ts getAccessToken(); src/scripts/rhsm/getaccesstoken.py Version affected: cockpit-machines-348-1.el10 Patch available: no released package fix established; proposed patch included below Version fixed: unknown Upstream coordination: Not notified. CVSS: CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N - 4.7 (MEDIUM) AV:L - Exploitation requires local access to the host where Cockpit Machines is running. AC:L - On systems without restrictive /proc settings, observing helper command lines is straightforward once the process starts. PR:L - A low-privileged local account is sufficient to inspect process metadata in affected configurations. UI:R - A user must trigger the RHSM offline-token validation flow so the helper process is spawned with the secret in argv. S:U - The impact stays within the same security scope. C:H - The exposed value is a sensitive RHSM offline token that can be used to request access tokens. I:N - This issue does not directly alter data or system state. A:N - This issue does not directly reduce service availability. Impact: Moderate. This issue can expose a high-value credential and therefore compromise confidentiality, but exploitation is local, timing-sensitive, and dependent on process-visibility configuration. Under Red Hat's severity guidance, that fits a confidentiality compromise that is real but less easily exploited than an Important issue. Embargo: no Reason: This is a local information disclosure issue with configuration-dependent exploitability and a straightforward remediation path. It does not present the kind of remotely exploitable or rapidly weaponizable condition that typically warrants embargo. Acknowledgement: Aisle Research Vulnerability Details: The RHSM offline token is serialized into JSON and passed to a Python helper as a command-line argument. The helper then reads the secret from sys.argv[1] and uses it as the refreshtoken parameter when requesting an access token: ts export function getAccessToken(offlineToken: string): cockpit.Spawn<string> { logDebug(Get access token); const arg = JSON.stringify({ offlineToken }); return python.spawn(getAccessTokenScript, [arg], { err: "message", environ: ['LCALL=C.UTF-8'] }); } py args = json.loads(sys.argv[1], strict=False) data = { "granttype": "refreshtoken", "clientid": "rhsm-api", "refreshtoken": args["offlineToken"] } Because the secret is present in argv, it can be exposed through process metadata such as ps, pgrep -af, or /proc/<pid>/cmdline while the helper is running. Reachability from the UI is direct through the Create VM RHEL download/token-validation flow. This is a local disclosure issue rather than a remote compromise; its practical exploitability depends on whether another local user can inspect that process metadata on the host. Steps to reproduce: 1. Start Cockpit Machines and open the Create VM flow. 2. Select Download an OS and choose a RHEL entry that requires an RHSM offline token. 3. Paste a valid or invalid offline token so the validation flow calls getAccessToken(). 4. From a second local shell on the same host, monitor the helper command line: bash while true; do pgrep -af getaccesstoken.py; sleep 0.1; done 5. Observe that the helper process command line contains JSON with the offlineToken value. If the host enforces restrictive /proc visibility settings such as hidepid, cross-user observation may be blocked. That limits exploitability, but it does not change the underlying secret-on-argv behavior. Mitigation: Until a fixed build is available, avoid validating RHSM offline tokens through this flow on shared systems where untrusted local users can inspect process metadata. Restrict /proc visibility so unprivileged users cannot view other users' command lines. Proposed Fix: Do not pass the offline token in argv. Spawn the helper without secret-bearing arguments and send the JSON payload over stdin instead. diff diff --git a/src/libvirtApi/rhel-images.ts b/src/libvirtApi/rhel-images.ts @@ export function getAccessToken(offlineToken: string): cockpit.Spawn<string> { logDebug(Get access token); const arg = JSON.stringify({ offlineToken });
return python.spawn(getAccessTokenScript, [arg], { err: "message", environ: ['LCALL=C.UTF-8'] }); + const proc = python.spawn(getAccessTokenScript, [], { err: "message", environ: ['LCALL=C.UTF-8'] }); + proc.input(JSON.stringify({ offlineToken })); + return proc; } diff --git a/src/scripts/rhsm/getaccesstoken.py b/src/scripts/rhsm/getaccesstoken.py @@ -args = json.loads(sys.argv[1], strict=False) +args = json.loads(sys.stdin.read(), strict=False)
------ This report was generated using AI technology. Always review AI-generated content prior to use
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
Until a fixed Cockpit Machines build is available, restrict /proc visibility so unprivileged users cannot inspect other users' command lines (e.g., enable restrictive /proc settings such as hidepid) because the RHSM offline token is exposed in the helper's argv.
Linux /proc visibility (hidepid= /proc restrictions) hidepid and /proc visibility so unprivileged users cannot read other users' /proc/<pid>/cmdline = restrict unprivileged users (use restrictive /proc visibility such as hidepid) - Configuration
Apply the proposed fix to avoid exposing the RHSM offline token in process arguments: change the helper invocation so the JSON payload containing the offlineToken is sent over stdin (and read it with sys.stdin) rather than placed in argv (previously parsed from sys.argv[1], e.g., args = json.loads(sys.argv[1], strict=False)).
cockpit-machines rhsm token-validation helper RHSM offline token transport mechanism (argv vs stdin) = pass offlineToken via stdin instead of argv
Event History
Frequently Asked Questions
Which environments are practically exposed?
Exposure is limited to hosts running Cockpit Machines where a local user can inspect another user's process metadata during RHSM token validation. Deployments with /proc visibility restrictions that prevent command-line inspection are not exposed through the described path.
What must an attacker be able to do?
The attacker needs local access, the ability to view another user's process metadata, and an opportunity to observe the helper while the RHSM token-validation flow is active. The issue affects confidentiality only; no integrity or availability impact is stated.
Is a released fix available?
No released package fix has been established. The fixed version is unknown, although a proposed patch is referenced in the report.
What can be done before a package fix is available?
Apply /proc visibility restrictions that block inspection of other users' command lines, since the described disclosure depends on reading helper process arguments. No other workaround is provided in the available data.