Bug 2558781 (CVE-2026-115220)
| Summary: | CVE-2026-115220 insights-core: insights-core: Symlink-Based Local File Disclosure in `eap_json_reports` Collection Path | ||
|---|---|---|---|
| Product: | [Other] Security Response | Reporter: | OSIDB Bzimport <bzimport> |
| Component: | vulnerability | Assignee: | Product Security <prodsec-ir-bot> |
| Status: | NEW --- | QA Contact: | |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | unspecified | CC: | anthomas, aprice, ehelms, ggainey, hoberger, jdobes, jholecek, jpasqual, jsamir, juwatts, kaycoth, kgaikwad, lpele, mdellweg, mhulan, nmoumoul, oezr, orabin, osousa, pcreech, rchan, rhel-process-autobot, sarad, sdawley, security-response-team, smallamp, sprizend, tmalecek, watson-tool-maintainers, zzhou |
| Target Milestone: | --- | Keywords: | Security |
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | --- | |
| Doc Text: |
A flaw was found in insights-core. This vulnerability allows information disclosure when the collection process improperly follows symbolic links in temporary directories. A local attacker with write access to the report upload directory can create a symbolic link pointing to sensitive system files. When a higher-privileged collection routine executes, the contents of the targeted file are copied into the collection archive, exposing restricted data.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | Type: | --- | |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Deadline: | 2026-12-01 | ||
AI_ONLY_REPORT package: insights-core-3.7.4-1.el10_2 ------ Summary: Symlink-Based Local File Disclosure in `eap_json_reports` Collection Path: a lower-privileged local user who can write to `/var/tmp/insights-runtimes/uploads/` can cause privileged collection to follow a symlink and include the target file's contents in collected output. Requirements to exploit: A local attacker needs low-privilege write access to `/var/tmp/insights-runtimes/uploads/`, a later collection run with privileges sufficient to read the symlink target, a target file whose modification time falls within the datasource's 24-hour selection window, and a way to access the resulting archive, retained output, or uploaded contents. Component affected: `insights-core-3.7.4-1.el10_2`; `insights/specs/datasources/eap_reports.py` (`eap_report_files`), `insights/specs/datasources/_init_.py` (`get_recent_files`), and the `eap_json_reports` `foreach_collect` path in `insights/specs/default.py` Version affected: `insights-core-3.7.4-1.el10_2`, when the `eap_json_reports` host-collection path is used and `/var/tmp/insights-runtimes/uploads/` is writable by a lower-privileged user or service account 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:H/PR:L/UI:N/S:U/C:H/I:N/A:N - 4.7 (MEDIUM) AV:L - Exploitation requires local access to create a symlink in the uploads directory. AC:H - Exploitation depends on several conditions: write access to that directory, a later higher-privilege collection run, the 24-hour mtime filter, and attacker access to resulting collected data. PR:L - A low-privileged local account or service account with write access is sufficient. UI:N - No separate victim interaction is required once those conditions exist and collection runs. S:U - The impact remains within the collector's security authority. C:H - Root-readable file contents can be disclosed into collected output. I:N - The available evidence shows disclosure, not modification. A:N - The available evidence does not show service interruption or resource exhaustion. Impact: Moderate. This flaw can disclose sensitive local files, but exploitation is local and conditional rather than easy: it depends on a writable collection directory, a later privileged collection run, the datasource's 24-hour file-selection window, and access to the resulting archive or uploaded data. Under Red Hat's severity guidance, that is more consistent with Moderate than Important because the confidentiality impact can be significant when the prerequisites are met, but the issue is not broadly exposed or straightforward to exploit. Embargo: no Reason: The issue is local and configuration-dependent, and straightforward operational mitigation exists while a code fix is prepared. Acknowledgement: Aisle Research Vulnerability Details: The `eap_report_files` datasource enumerates recent files from `/var/tmp/insights-runtimes/uploads/` and returns those paths to the `eap_json_reports` collection path without rejecting symlinks. The helper below uses `os.path.getmtime()`, which follows symlinks, so a symlink is treated as a normal candidate and selected based on the target file's modification time: ```python EAP_REPORTS_JSON_PATH = os.path.join(root, "var/tmp/insights-runtimes/uploads/") final_files = get_recent_files(EAP_REPORTS_JSON_PATH, last_modify_hours=24, latest_count=10) if final_files: return [f[len(root) :] for f in final_files] ``` ```python for parent_path, _, report_files in os.walk(target_path): for one_file in report_files: t_full_file = os.path.join(parent_path, one_file) file_time = os.path.getmtime(t_full_file) if (current_time - file_time) // 3600 < last_modify_hours: latest_files[t_full_file] = file_time ``` Those returned paths are later opened as normal files during collection: ```python with open(self.path, "r", encoding="utf-8", errors="surrogateescape") as f: content = [l.rstrip("\n") for l in f] ``` Based on the available code path, no earlier symlink rejection is evident in this flow. If a lower-privileged local user can place a symlink in `/var/tmp/insights-runtimes/uploads/`, and collection later opens it with higher privileges, the target file's contents can be copied into collected output under `var/tmp/insights-runtimes/uploads/<name>`. The issue is therefore a confidentiality problem. The available evidence does not establish direct file modification, privilege escalation, or denial of service. The issue is not fully arbitrary in practice. The datasource only selects files whose target modification time is within the last 24 hours, so an unchanged older file may not be collected. A fresh root-only file provides a deterministic proof of concept; an example such as `/etc/shadow` would only be selected if its target modification time is sufficiently recent. Steps to reproduce: 1. Create a fresh root-only test file: ```bash sudo mkdir -p /root echo "INSIGHTS_SYMLINK_TEST_SECRET" | sudo tee /root/insights-secret.txt >/dev/null sudo chmod 600 /root/insights-secret.txt ``` 2. Create the uploads directory and make it writable to a low-privileged test user: ```bash sudo mkdir -p /var/tmp/insights-runtimes/uploads sudo chown root:root /var/tmp/insights-runtimes/uploads sudo chmod 733 /var/tmp/insights-runtimes/uploads ``` 3. As that low-privileged user, place a symlink in the uploads directory: ```bash ln -sf /root/insights-secret.txt /var/tmp/insights-runtimes/uploads/report.json ``` 4. Run collection as root with `insights-client --no-upload` or an equivalent host-collection flow. 5. Inspect the resulting collected output for `var/tmp/insights-runtimes/uploads/report.json` and confirm that it contains `INSIGHTS_SYMLINK_TEST_SECRET`. Mitigation: Until a code fix is shipped, keep `/var/tmp/insights-runtimes/uploads/` writable only by the trusted component that is expected to produce the report files, and do not grant generic low-privileged users write access there. Limiting access to retained archives or other collected output also reduces practical exposure. Proposed Fix: Reject symlinks and other non-regular files in `get_recent_files`, and use `lstat()` so the selection step does not follow symlinks. ```diff diff --git a/insights/specs/datasources/_init_.py b/insights/specs/datasources/_init_.py — a/insights/specs/datasources/_init_.py +++ b/insights/specs/datasources/_init_.py @@ -10,6 +10,7 @@ import os +import stat import time @@ -72,8 +73,17 @@ def get_recent_files(target_path, last_modify_hours=24, latest_count=0): for parent_path, _, report_files in os.walk(target_path): for one_file in report_files: t_full_file = os.path.join(parent_path, one_file) file_time = os.path.getmtime(t_full_file) + try: + st = os.lstat(t_full_file) # do not follow symlinks + except OSError: + continue + if stat.S_ISLNK(st.st_mode) or not stat.S_ISREG(st.st_mode): + continue + file_time = st.st_mtime if (current_time - file_time) // 3600 < last_modify_hours: latest_files[t_full_file] = file_time ``` ------ This report was generated using AI technology. Always review AI-generated content prior to use