/

CVE-2026-44941

Severity:

HIGH RISK

(8.4)

Path Traversal (CWE-23) in libzypp repomd keyhint parsing

CVE-2026-44941

Analyzed

Vulnerability type

Category:

Path Traversal

CWE:

CWE-23

Impact:

Arbitrary File Write as Root

Severity:

HIGH RISK

(8.4)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A relative path traversal flaw in libzypp's handling of the keyhint option within repomd.xml allows a malicious repository to write files outside the intended directory.

When a system consumes an attacker-controlled repository, this condition can lead to arbitrary file injection or overwrite as root, potentially enabling full system compromise.

Affected context

This vulnerability arises in environments where libzypp is used to manage software repositories and updates.

It becomes relevant when a client is configured, intentionally or accidentally, to trust or consume metadata from a repository whose contents can be influenced by an attacker.

The issue specifically involves parsing the repomd.xml metadata and honoring the keyhint option without adequately constraining or normalizing relative paths, allowing writes outside the expected repository or cache directory structure.

Exploit preconditions

  • Attack surface: Package management infrastructure that uses libzypp to parse repomd.xml from configured repositories.
  • Required access: Ability to supply or control a repository, mirror, or metadata source consumed by libzypp (e.g., malicious repository URL, DNS/HTTP manipulation, or compromise of a third-party repo).
  • Trigger point: Processing of repomd.xml metadata, specifically the keyhint option, during repository refresh or package operations.
  • Why exploitation is possible: The keyhint value is treated as a filesystem path without sufficient normalization or enforcement of a safe base directory, so relative path segments can traverse directories and target arbitrary locations writable by the libzypp process, which typically runs with root privileges.

Why this happens

The core issue is improper validation and normalization of file paths sourced from untrusted repository metadata.

libzypp accepts the keyhint field from repomd.xml and uses it to construct a file path, but fails to robustly reject or sanitize path constructs such as ../ that escape the intended directory.

This pattern is characteristic of CWE-23: Relative Path Traversal, where untrusted relative paths are concatenated or resolved against a base directory without enforcing strict boundaries or whitelisting safe locations.

As a result, an attacker can cause the application to read or write files in unintended directories under root-level privileges.

Potential impact

  • Injection of new files in privileged system locations (e.g., configuration directories).
  • Overwrite of existing system files that may influence service behavior or security posture.
  • Introduction of malicious trusted keys or key configuration that undermines package verification.
  • Facilitation of privilege escalation or persistent backdoors by modifying startup scripts or systemd units.
  • Disruption of system operation through corruption of critical configuration or data files.

General mitigation guidance

Effective mitigation focuses on constraining file path handling and reducing trust in external metadata:

  • Normalize and validate all paths derived from repository metadata before use, rejecting entries containing directory traversal markers or absolute paths.
  • Resolve paths against a fixed, known-safe base directory and enforce that the final canonical path remains within that directory.
  • Treat metadata fields such as keyhint as untrusted input, applying strict allowlists for acceptable filenames or subdirectories.
  • Run package management operations with the minimum necessary privileges and separate roles where possible, so that metadata processing does not automatically imply unrestricted root-level filesystem access.
  • Implement defense-in-depth by validating repository origins and signatures to reduce the likelihood of consuming attacker-controlled metadata.

How teams detect issues like this

Detection efforts can concentrate on both code and runtime behavior:

  • Static analysis and review: Search for file path construction that directly uses values from repomd.xml or other remote metadata without normalization functions or bounds checks; flag uses of relative paths that are not validated.
  • Policy enforcement: Introduce coding guidelines requiring canonicalization and directory boundary checks for any filesystem interaction based on external repository data, enforced via code review checklists and automated linters.
  • Runtime monitoring: Log and periodically audit file writes occurring during repository refresh or update operations, especially when they target unusual locations outside standard cache or key directories.
  • Automated security testing: Use fuzzing or metadata mutation tools to supply repomd.xml with crafted keyhint values (including ../ components) in a controlled environment to detect unexpected file write behavior.

Sources

SourceLink
bugzilla.suse.combugzilla.suse.com/show_bug.cgi?id=1267426
github.comgithub.com/openSUSE/libzypp/commit/294b1bad442d089ca671c5c03adc8031e3b29e04

Frequently asked

questions

Exploitability is tied to the ability to control or influence a repository consumed by libzypp. If an attacker can get a target system to use a malicious or compromised repository, they can reliably reach the vulnerable code path during normal update or refresh operations.

Not necessarily. The key requirement is control over the repository metadata, which can be achieved remotely if an attacker can host or redirect the system to a malicious repository. Direct local access to the victim machine is not required for exploitation, though misconfiguration or social engineering may be needed to add or modify repository settings.

The safest pattern is to treat all repository metadata as untrusted input, canonicalize any path values, and enforce that resulting paths stay inside a predefined repository or cache directory. This includes rejecting keyhint and similar fields containing directory traversal sequences, absolute paths, or unexpected prefixes, rather than attempting to auto-correct them.

Preventive measures include adopting a strict path-handling API that always resolves user- or network-supplied paths against a fixed root and verifies the canonical path; embedding these rules in shared utility functions; enforcing security-focused code review for all filesystem interactions; and augmenting CI pipelines with static checks that flag potentially unsafe concatenation of untrusted paths.

Find out what's already
exploitable in your codebase.