When RPM installs a file/directory, it uses path-based operations afterwards to set the desired permissions and credentials. When the directory this is happening in is owned by an unprivileged user, that user can escalate privileges to root by exchanging the file/directory with a symbolic link to a security-critical file/directory.
Created rpm tracking bugs for this issue:
Affects: fedora-all [bug 1977844]
This flaw, along with CVE-2021-35937 and CVE-2021-35939, belong to a set of complex issues that may allow an unprivileged user to trick RPM into modifying root-owned files during installation, due to race conditions and/or symlink attacks. These issues do not have a solution upstream. Fixing would require rather involved refactoring of RPM internals.
Note that in this context, unprivileged users are actually system accounts (like the pcpqa user mentioned in one of the SUSE bugs) that are usually more tightly controlled than ordinary users. In general, access to files and directories installed by RPMs requires high privileges. Regular users should not be allowed to manipulate RPM artifacts during installation. A local attacker would first need to compromise a system account in order to exploit these flaws, thus reducing the overall impact considerably.