Fedora Account System
Red Hat Associate
Red Hat Customer
Upstream flac (libFLAC/metaflac) resolves a symlink target against the wrong base directory when rewriting metadata, allowing a local attacker to direct a victim's metadata edit at an arbitrary victim-writable file. MECHANISM (verified in xiph/flac master 59fa3402 and release 1.5.0, src/libFLAC/metadata_iterators.c; introduced by upstream commit 685f4f69 on 2024-08-30, "Let libFLAC handle symlinks on metadata handling"): - A size-changing metadata edit (e.g. metaflac --set-tag, or any FLAC__Metadata_Chain rewrite) on a FLAC file reached via a symbolic link writes the edited file to a temp file <input>.metadata_edit next to the input path, then transport_tempfile_() calls readlink() on the input and renames the temp file to the RAW link-target string: flac_rename(*tempfilename, linked_name). - POSIX rename() resolves a relative newpath against the process CWD, not the directory containing the symlink. A victim editing <dir>/song.flac -> .bashrc from CWD X therefore overwrites X/.bashrc with the edited FLAC (attacker-authored content including arbitrary Vorbis comment lines), destroying the original file. Both the simple-iterator and chain rewrite paths route through this rename; only size-changing edits reach it. - Prerequisites: attacker places a relative symlink plus a co-located valid FLAC in a location the victim will edit (shared writable directory, or an archive the victim extracts); victim runs a size-changing metadata edit from a predictable CWD; destination writable by the victim and on the same filesystem as the symlink's directory. - Demonstrated impact (reporter PoC, read and code-verified by us, not executed): overwrite of ~/.bashrc, ~/.config/*, ~/.gitconfig; overwrite of ~/.ssh/authorized_keys lets sshd accept an attacker-controlled key (login as victim) on hosts running sshd with pubkey auth. No direct read primitive; root-owned files unreachable. - Secondary bug in the same block: the readlink() return is not checked for -1 (only truncation is); on failure linked_name[-1] = 0 writes one NUL byte before a 1024-byte stack buffer and an uninitialized buffer is passed to rename(). Requires racing the lstat->readlink window. - Affected upstream versions: flac 1.5.0 (11-Feb-2025, the only release containing 685f4f69) and master. Fixed versions: none (no upstream fix, no public issue, no CVE as of 2026-11-18; 1.5.0 is the newest release). - Red Hat Enterprise Linux is NOT affected: RHEL 8 ships flac 1.3.2, RHEL 9 ships 1.3.3, RHEL 10 ships 1.4.3 (CRB repo) - all predate 685f4f69 and rename the temp file over the input path itself, replacing a symlink rather than following it. Verified statically against dist-git and dynamically on the RHEL 10 package (flac-1.4.3-6.el10): a size-changing edit on a relative symlink replaces the link and leaves the victim's CWD files untouched. - Reported by Calif.io via JSM PSIRTSUPT-30603 (PoC attachment ANT-2026-4EEM0BEH, tested against master 59fa3402 in a two-user container demo). Full triage artifacts on file. - Proposed CVSS for the upstream issue: CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:H = 6.6 (Medium).