Abstract

Why does a privileged program that operates on a file name keep reaching a file it never meant to touch, and which controls close which part of that risk? The flaw has two forms. In a time-of-check to time-of-use race, an unprivileged user changes what a name refers to between two operations. In plain link following, the user, or an archive or image the user supplied, plants a link that the program later resolves without asking where it leads. Matt Bishop and Michael Dilger analysed the first form in 1996; between 26 November and 4 December 2026, fixes or CVE records for one form or the other appeared for Red Hat’s insights-core, Semtech AirLink OS, Canonical’s LXD and the node-tar and compressing libraries. Follow-up attacks broke both probabilistic race defences in the configurations they demonstrated, and Linux’s link restrictions help only where their settings and the directories’ modes and ownership make them apply. The controls that work are structural: resolve a name once and act through the resulting descriptor, confine resolution to a directory handle with openat2 or a library built on it, create files exclusively, and run work on a user’s files under that user’s full credentials.

Eight days of advisories

Between 26 November and 4 December 2026, fixes or CVE records appeared for several programs that ran with more authority than the people supplying their input and then followed a link those people controlled. The flaw is a close relative of path traversal: there the attacker supplies a name that escapes a directory, here the attacker changes or plants what an innocent-looking name refers to. Our path traversal article covers the string-level side, including how archive extractors and openat2 confine names; the privilege boundary and the time dimension are the subject here.

The cases fall into two groups. In most of them nothing has to change while the program runs: a link is planted in advance, by a local user, an uploaded archive or an imported backup, and the program later resolves it with its own authority. Only one of the cases below, the LXD socket, describes a check-then-act sequence in which the outcome depends on a change made between two operations.

  • Red Hat insights-core. On 3 December 2026 Red Hat issued RHSA-2026:107670, a Moderate update to insights-core 3.8.8 for Red Hat Enterprise Linux 10.2 channels, fixing CVE-2026-115220, “Symlink-Based Local File Disclosure in eap_json_reports Collection Path”.1 Red Hat’s description: “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.” Red Hat rates it Moderate because exploitation needs write access to that runtime directory and requires “the target file being modified within the preceding 24 hours”, and because in standard installations “the upload location is not exposed as a world-writable directory”.2
  • Semtech AirLink OS. Semtech’s CVE record for CVE-2026-137266, published on 1 December 2026, describes “a symbolic link following vulnerability in the ctrmgr container manager” that “allows an authenticated administrator to create or replace files as root on the /mnt/user partition, outside the container’s assigned volume”. It takes two uploads: “the first plants a symbolic link that the second follows”, and Semtech says this “can be used to gain root access on the device”. The record’s prose says “before 6.1.39”, while its structured data lists versions from 5.0.0 up to, but not including, 6.1.0.39; the fix is in the 6.2.0 release and was backported to 6.1.0.39.3 Semtech’s bulletin SEM-PSA-2026-003 of the same date lists it among four CVEs.4
  • node-tar. On 2 December 2026 the maintainers of the npm package tar published GHSA-3wwj-8j6r-q339 (CVE-2026-140250). With default options, extraction could create a symbolic link that resolves outside the extraction directory when its target passes through a link created earlier by the same archive and then uses ... Both of the library’s checks “collapse .. lexically before considering symlinks, so the intermediate symlink is never seen, while the kernel resolves it before applying ..“. The advisory reports a regression: 7.5.3 and 7.5.4 rejected the chain and 7.5.5 to 7.5.22 accepted it; 8.0.0 is fixed.5 A second advisory published the same day, GHSA-gvrf-jx37-rjv5 (CVE-2026-140247), reports a related lexical containment failure reached through a different chain, also fixed in 8.0.0.6
  • compressing. A GitHub advisory for the npm package compressing, published on 31 October 2026, reports a “tar symlink containment bypass via self-referential directory link”, an incomplete fix of an earlier advisory: the containment check judged a link’s target against the entry’s textual path, while on disk an earlier link made that path refer somewhere shallower. Versions up to 2.1.3 are affected and 2.1.4 is fixed.7 VulnCheck published the CVE, CVE-2026-144971, on 4 December 2026.8
  • LXD. On 26 November 2026 Canonical published LXD advisories that state they were copied from Incus advisories. In GHSA-fvhv-5r5f-xx7c (CVE-2026-137114, critical), a restricted tenant imports a backup or image whose metadata area contains a device node, a hard link or a symlink where a regular file should be, and “the daemon processes these files as root”. A hard link named backup.yaml is a second name for some other inode, so when the daemon writes the backup file through that name, the write lands on the file the attacker chose.9 In GHSA-fxg7-8r76-78r5 (CVE-2026-135381), proxy devices that listen on a Unix socket on the host “set the socket’s owner and mode by path after creating it”; a local user can “take ownership of, or make world-readable, any file on the host when a proxy device listens on a unix socket in a directory they can write to”.10

Two more belong in the list. On 30 November 2026 Red Hat shipped RHSA-2026:104718 for the crun container runtime, fixing CVE-2026-47766, “Arbitrary file creation/overwrite via symlink following”.11 The CVE record states the preconditions: before crun 1.28, “if an OCI bundle contains rootfs/dev as a symlink and the bundle configuration does not mount /dev, crun follows that symlink” and creates device nodes and symlinks outside the container root file system.12 Our container isolation article covers that flaw and the run of runc and crun /dev and /proc link bugs behind it. HashiCorp’s bulletins of 29 October 2026 describe two Nomad flaws. In HCSEC-2026-52 (CVE-2026-107347), Nomad “did not consistently prevent dispatch payload and executor log writes from following symbolic links to files outside the intended directories”; “when the client agent runs as root, this could lead to code execution as root on the client host”.13 In HCSEC-2026-53 (CVE-2026-119168), Nomad could “preserve a task-planted symbolic link and subsequently follow it when setting directory permissions and ownership” while migrating data between allocations.14

CaseNeeds a change during the operation?Who controls the namesAuthority used
insights-coreNot per Red Hat; a planted link sufficesWriter of the upload directoryHigher-privileged collector
AirLink OS ctrmgrNo; the link persists between two uploadsAuthenticated administrator’s archivesroot
node-tar, compressingNo; one sequential extractionArchive authorWhoever runs the extraction
LXD importNo; planted in the imported metadataRestricted tenantLXD daemon as root
LXD proxy socketYes; create, then chown and chmod by pathWriter of the socket’s directoryLXD daemon as root
Nomad (52, 53)No; planted by the taskJob submitter’s workloadClient agent, root in the vendor’s worst case
crunNo; a /dev symlink in the bundle’s root file system, where the configuration does not mount /devSupplier of the OCI bundleContainer runtime

None of these is a parser bug or a memory error. In each, a process with more authority than the source of its input resolved a name that the input could influence, and acted on whatever the name led to.

How often it is filed

MITRE’s weakness catalogue has entries for both forms. CWE-367, time-of-check time-of-use, is the race: “The product checks the state of a resource before using that resource, but the resource’s state can change between the check and the use in a way that invalidates the results of the check.”15 CWE-59, link following, is the file-specific weakness that covers both forms: “The product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.”16 Its children include CWE-61 for symbolic links and CWE-62 for hard links.1718 CWE-377, “Insecure Temporary File”, which older advisories often cite, is marked deprecated with mapping prohibited; MITRE’s note says it “has multiple widespread interpretations by CWE analysts, partially due to its ambiguous name”.19 The CWE-59 entry lists “insecure temporary file” as an alternate term some people use for link following, while noting that other weaknesses can produce insecure temporary files without any link.16

Neither CWE-59 nor CWE-367 appears in the 2025 CWE Top 25, which MITRE’s index still presented as the current edition on 4 December 2026; path traversal, CWE-22, ranked sixth.20

NVD gives a rough, classification-dependent count. Queries to the NVD CVE API 2.0 on 4 December 2026, at about 18:40 UTC, with cweId as the only filter returned 1,296 records for CWE-59, 348 for CWE-367, 3 for CWE-61 and none for CWE-62; CWE-22 returned 6,723.21 The API limits publication-date filters to 120-day windows, so the CWE-59 query was repeated with calendar-quarter windows (1 January to 31 March, 1 April to 30 June, 1 July to 30 September and 1 October to 31 December). It returned 18, 12, 12 and 9 records for 2024 (51 in total); 6, 8, 1 and 3 for 2025 (18); and 4, 19, 81 and 144 for 2026 up to 4 December (248). The last figure is 144 records published in the 65 days from 1 October to 4 December 2026, an average of about 2.2 a day over that period. These are counts of NVD records published in each window that carry the CWE-59 label. They are not counts of new bugs, and records with another label or none are not included. The low 2025 figure was not investigated and should not be read as a quiet year.

A file name is not a file

Every call resolves the name again

A Unix path name is a set of directions. To open /var/log/app/today.log, the kernel starts at the process’s root directory, looks up var in it, then log in that, then app, then today.log. The path_resolution(7) manual page describes the walk component by component: if a component is a symbolic link, the kernel resolves that link first, “with the current lookup directory as starting lookup directory”, and continues from wherever it leads, up to 40 links per path name on current Linux.22 Each operation that looks a path up performs its own resolution; some path arguments, such as the target of a new symbolic link, are stored as text and only interpreted when the link is later followed, and how the final component is treated depends on the operation.23 The kernel’s caches make lookups fast, but each lookup resolves the name against the directory entries as they stand at that moment, so two calls that take the same string can reach different objects if an entry on the route changed in between.

Bishop and Dilger put this precisely in “Checking for Race Conditions in File Accesses” (Computing Systems, Spring 1996). File path names, they wrote, “are resolved by indirection, requiring the naming and accessing of at least one object other than the file being addressed”, while file descriptors “bind directly to the object”. Their summary: “Path names are indirect pointers, so one of the interior pointers may be switched. File descriptors are direct pointers and hence not subject to such fiddling.”24 A descriptor fixes which object is meant. It does not freeze that object’s contents or metadata, which other processes with access can still change.

Whether an attacker can switch an interior pointer depends on more than write access to a directory. Changing an entry needs write and search permission on the directory, and in a sticky directory removing or renaming another user’s entry is further restricted; some of these rules are covered by path_resolution(7).22 Write access to a directory on the route is therefore a screening signal, not proof. Several things can change what a name means between two resolutions:

  • A symbolic link swapped in for a file or directory makes the walk continue somewhere else. A link in the middle of a path redirects every component after it.
  • A hard link is a second directory entry for the same inode. A user who can create one in a directory a privileged program uses can make a name there refer to someone else’s file, subject to the kernel restriction described below. Bishop and Dilger’s first example used a hard link in a shared temporary directory to a protected system file.24
  • A rename of a directory component moves everything beneath it. The Go team’s description of its os.Root API notes a variant in which a directory that forms part of a path is renamed while the open is in progress, so a later .. component climbs from a different place.25
  • A mount changes which file system a directory name leads into. Creating one normally needs privilege, but container managers and orchestrators create mounts on tenants’ behalf, which is why openat2(2) has a flag that refuses to cross mount points, “including all bind mounts”.26

The two conditions

Bishop and Dilger separated two things that must both hold for a race. The programming condition is an interval between two calls in which the program relies on an assumption created by the first. The environmental condition is that an attacker can affect that assumption, by changing the binding of the name, during the interval. “Both conditions must hold for there to be an exploitable TOCTTOU binding flaw.” In their example, “were the file in a directory that the attacker could not alter, the environmental condition would not hold and no exploitable TOCTTOU binding flaw would exist.”24

The split is still a useful way to review code, and it extends to plain link following. The programming condition is visible in the source: two path-based calls, or a path-based check followed by a path-based use. The environmental condition is visible only in the deployment: who can create, remove or rename entries in each directory on the route, and what a successful change would let them do. Red Hat’s severity reasoning for insights-core is an argument about the environmental condition, since the upload directory is not world-writable in a standard installation.2 Plain link following needs no check-to-use interval, but it still has two requirements: an attacker able to place a link where the program will resolve it, and program behaviour that follows the link and applies the program’s authority to the target in a way the intended policy does not allow.

Bishop and Dilger also built a static analyser and ran it on sendmail 8.6.10. It reported 24 possible intervals; after manual analysis, five met the programming condition, and “given appropriate environmental conditions and appropriate security policy elements, all 5 allow unauthorized actions”. Using Rice’s theorem, they argued that whether a program contains an exploitable flaw of this kind is undecidable in general, so any analyser either misses some or reports some that are not real.24

The canonical example

The pattern Bishop and Dilger called archetypal is a setuid-root program writing to a file the invoking user names. The code below is illustrative, adapted from their paper.

/* Illustrative only: the access()-then-open() pattern from Bishop and Dilger (1996). */
if (access(path, W_OK) == 0) {        /* resolution 1: checked against the real user ID */
    int fd = open(path, O_WRONLY);    /* resolution 2: opened with root's effective ID */
    write(fd, buf, len);
}

access() checks permissions using the real user and group IDs, so in this author’s gloss it answers “could the invoking user do this?”, and it looks designed for the job. Its Linux manual page says the opposite: using it to check authorisation before open() “creates a security hole, because the user might exploit the short time interval between checking and opening the file to manipulate it”, and “the use of this system call should be avoided”. For that specific case, the page suggests temporarily switching the effective user ID to the real ID and then calling open().27

That suggestion is narrower than it looks. Linux file permission checks use the filesystem user and group IDs and the supplementary group IDs, and two capabilities, CAP_DAC_OVERRIDE and CAP_DAC_READ_SEARCH, bypass the usual checks when present in the process’s effective capability set. Whether they are present depends on the capability sets, not on a user ID alone; capabilities(7) describes, for example, how changing the filesystem user ID from 0 to nonzero clears them from the effective set.282229 Changing only the effective user ID of a setuid-root program does not reproduce another user’s groups. The robust form of the idea is to do the open, or the whole job, in a process that holds the intended user’s complete credentials, which is discussed under the fixes below.

The patterns that keep recurring

Shared temporary directories

The classic setting is a shared, world-writable, sticky directory such as /tmp. A privileged process that writes to a predictable name there invites anyone who can write to the directory to pre-create that name as a link. The mktemp(3) manual page is blunt: “Never use mktemp().” Some implementations replace the template’s X characters with the process ID and a single letter, “so that at most 26 different names can be returned”, and “there is a race between testing whether the name exists and opening the file”, so “every use of mktemp() is a security risk”. It points instead to mkstemp(3) and mkdtemp(3).30 mkstemp() creates and opens the file in one call, with mode 0600, using O_EXCL, “guaranteeing that the caller is the process that creates the file”.31 The open(2) page states the property that matters: with O_CREAT and O_EXCL, “symbolic links are not followed: if path is a symbolic link, then open() fails regardless of where the symbolic link points”. It notes a caveat for NFS, where O_EXCL is supported only with NFSv3 or later on Linux 2.6 or later.32

Linux 3.11 added O_TMPFILE, which creates “an unnamed temporary regular file” in a given directory; there is no name for an attacker to anticipate, and linkat() can give the file a name later.32

Removing a temporary tree can be racy too. On 29 September 2026 the Python Software Foundation published CVE-2026-12345: “The cleanup of tempfile.TemporaryDirectory is vulnerable to a race condition. An attacker who can modify the tree during cleanup can replace a directory with a symbolic link, causing files outside of the temporary directory to be deleted or have their permissions and file flags reset, with the privileges of the process performing the cleanup.” The record lists as affected versions before 3.12.15, 3.13.0 up to but not including 3.13.18, 3.14.0 up to but not including 3.14.9, and 3.15.0a1 up to but not including 3.15.0rc3. It adds two residual caveats: platforms where shutil.rmtree.avoids_symlink_attacks is false “remain affected”, and “file flags may still be reset outside of the tree on all platforms”.33

Logs and service-owned directories

Log rotation often runs as root and renames, creates, compresses and changes the ownership of files in directories that a service account or group can write to. In that configuration the rotation job acts for whoever controls the directory. CVE-2011-1548 recorded that the default configuration of logrotate on Debian “uses root privileges to process files in directories that permit non-root write access”, allowing “symlink and hard link attacks”, as demonstrated by /var/log/postgresql/.34 In CVE-2019-11675, Debian’s groonga-httpd package made /var/log/groonga owned by the groonga account, and the CVE record describes a race in which an attacker inserts a symlink in that directory, with root access as the possible outcome.35

The logrotate manual page now carries the remedy as advice: “If logrotate runs with root privileges, it is recommended to use the su directive to rotate files in directories that are directly or indirectly in control of non-privileged users.”36

Recursive operations over user-writable trees

Recursive delete, copy, chown and chmod are where the stat()-then-act pattern is hardest to avoid, because the program enumerates a directory and then does something to each entry. If an attacker can change entries in any directory below the starting point, the entry can be swapped between the enumeration and the action.

Rust’s standard library shipped this bug from its first stable release. Its advisory of 20 January 2022 explains that std::fs::remove_dir_all was documented not to follow symbolic links, but “instead of telling the system not to follow symlinks, the standard library first checked whether the thing it was about to delete was a symlink, and otherwise it would proceed to recursively delete the directory”. Rust 1.0.0 through 1.58.0 were affected (CVE-2022-21658). The team reported that although the attack “likely won’t work the first time”, in their experimentation they “were able to reliably perform it within a couple of seconds”. It warned that “adding checks in your codebase before calling remove_dir_all will not mitigate the vulnerability, as they would also be vulnerable to race conditions”. On macOS before 10.10 and on Redox the necessary APIs were missing, and those targets remained vulnerable.37

Python met the same problem earlier. An issue titled “shutil.rmtree is vulnerable to a symlink attack” was opened on 2 December 2008 and closed on 28 June 2012.38 Since Python 3.3, on platforms that support the necessary fd-based functions, shutil.rmtree uses “a symlink attack resistant version” by default, and rmtree.avoids_symlink_attacks tells a program which version it has. On other platforms, “given proper timing and circumstances, attackers can manipulate symlinks on the filesystem to delete files they wouldn’t be able to access otherwise”.39 The 2026 TemporaryDirectory record shows that a safe primitive does not make every caller safe: the cleanup race reached permissions and file flags as well as deletion, and the record’s residual caveats depend on the platform.33

Nomad’s HCSEC-2026-53 is a recursive-permissions case: a task-planted link was followed “when setting directory permissions and ownership”.14 LXD’s socket flaw is the single-file race: create a socket, then change its owner and mode by path in a directory that, in the affected configuration, a local user can write to.10

systemd’s tmpfiles tool shows a configuration-dependent exposure. CVE-2017-18078 recorded that systemd-tmpfiles before version 237 “attempts to support ownership/permission changes on hardlinked files even if the fs.protected_hardlinks sysctl is turned off”, which let local users bypass access restrictions, “as demonstrated by changing the ownership of the /etc/passwd file”.40 The reported exposure arises with the kernel’s hard link restriction turned off.

Archive extraction is where link following needs neither local access nor a race: the archive creates a link, and a later entry or link is resolved through it, all within one sequential extraction. The path traversal article covers the history of Python’s tarfile and its extraction filters. The node-tar and compressing advisories add a specific lesson about why containment checks fail.

Both libraries decided whether a link target stays inside the destination by normalising strings. node-tar’s code carried a comment saying that “path.posix is safe to use because we’re operating on tar paths, not a filesystem”.5 The assumption fails once an earlier entry has created a real symbolic link on disk. A lexical normaliser removes .. by deleting the preceding component; the kernel applies .. to the directory the preceding component actually resolved to.22 The two answers can differ: they differ when the directory the link resolves to has a different parent from the link’s lexical parent, which is what the archives in these advisories arranged.57 Python’s documentation records a related subtlety in its own filter. Since 3.13.4 on the 3.13 branch, the data filter normalises link targets with os.path.normpath(), a transformation of the stored target, and the documentation notes that this “may change the meaning of the link if the path in TarInfo.linkname traverses symbolic links”.4142

Python’s documentation also names the exposure that filters do not address: “tarfile does not protect against issues with “live” data, e.g. an attacker tinkering with the destination (or source) directory while extraction (or archiving) is in progress.” It recommends extracting “to a new temporary directory to prevent e.g. exploiting pre-existing links”, and disallowing symbolic links where they are not needed.42

How winnable is the race?

For the race form, a common response is that the window is microseconds wide. The research reviewed here, from 2004 to 2009, says that judging winnability by the width of the window is unsafe, through a sequence of defences proposed and then defeated in experiments.

Dean and Hu: make the attacker win many races

At USENIX Security 2004, Drew Dean and Alan Hu published “Fixing Races for Fun and Profit: How to use access(2)”. They proved “the ‘folk theorem’ that no portable, deterministic solution exists without changes to the system call interface” for the access() and open() problem, and proposed a probabilistic scheme.43 Their k-race algorithm performs the access() and open() pair k + 1 times and, after each additional round, checks that the file opened is the same as the one opened before by comparing inodes, so an attacker must win a race between each pair of adjacent calls, 2k + 1 races in all. Assuming each race is an independent event with probability p, the attack succeeds with probability roughly p to the power 2k + 1; “Hence, the attacker must work exponentially harder as we increase k linearly.” The authors noted that the independence assumption “is obviously not realistic”, and in their own uniprocessor baseline “we did not observe any successful attacks in our initial experiments”.43

Borisov and colleagues: slow the victim down

Nikita Borisov, Rob Johnson, Naveen Sastry and David Wagner answered in “Fixing Races for Fun and Profit: How to abuse atime” (USENIX Security 2005). Against the recommended k = 7, the attack reported in their Table 1 won 92 of 100 trials on FreeBSD 4.10-PR2, 98 of 100 on Linux 2.6.8 and 100 of 100 on Solaris 9; they also reported defeating k = 100. They concluded that “access(2) must never be used in privileged Unix programs”.44

Their attack combined techniques that slowed the victim’s name resolution, which they called filesystem mazes, with techniques for tracking the victim’s progress through its system calls. The defensive consequence is that the cost of a lookup, and an attacker’s knowledge of when it happens, are not under the victim’s control when an attacker shapes the directories it walks.44

Tsafrir and colleagues, then Cai and colleagues

Dan Tsafrir, Tomer Hertz, David Wagner and Dilma Da Silva drew the general lesson at FAST 2008: “mazes constitute a generic way to deterministically win many TOCTTOU races (gone are the days when the probability was small)”. They proposed a stronger user-space defence, evaluated against hypothetical adversaries with complete and instantaneous knowledge of the defending program’s actions, and reported it undefeated by those attacks.45

Xiang Cai, Yuwei Gui and Rob Johnson attacked that defence, which they called atomic k-race, at the 2009 IEEE Symposium on Security and Privacy in “Exploiting Unix File-System Races via Algorithmic Complexity Attacks”. Atomic k-race avoided sleeping on I/O with very high probability, so the authors judged a full maze attack infeasible, while noting that some of its calls remained exposed to mazes. Instead, the attackers slowed the kernel’s in-memory name lookup: the name caches of the systems they studied used “a hash table with a hard-coded hash function”, and file names chosen to collide made the victim’s lookups slow. Combined with two scheduler techniques, the attack broke atomic k-race at the recommended k = 9 “on all the tested operating systems with probability at least 0.5”. For atomic k-race at that parameter, their opening summary table reports 60 of 70 trials won on Linux 2.6.24 (printed as 0.85), 16 of 20 on FreeBSD 7.0, 20 of 20 on OpenSolaris 5.11 and 53 of 100 on OpenBSD 3.4; other configurations in their evaluation reported lower rates, including none. The same paper also defeated a kernel-based race detector on OpenBSD. Its conclusion: “programmers should use provably-secure methods for avoiding race conditions when accessing the file-system.”46 Our algorithmic complexity attacks article covers the general technique.

Windows: opportunistic locks

Simon Zuckerbraun’s write-up for the Zero Day Initiative, published in March 2022 and updated in September 2024, shows how an arbitrary file delete performed by a SYSTEM process could be escalated to SYSTEM privileges by combining NTFS junctions, object manager symbolic links and opportunistic locks, which in the case study let the attacker hold the privileged operation while the redirection was put in place.47

What the history means

Both probabilistic defences were broken in configurations demonstrated by the follow-up papers, though not in every configuration evaluated, by mechanisms outside their models: disk I/O and access times for k-race, name-cache hash collisions and scheduler behaviour for atomic k-race. The lesson drawn by the later papers is to remove the race by construction rather than make it improbable. For reviewers, the safe default is that a race meeting both of Bishop and Dilger’s conditions should be treated as winnable unless the binding cannot change.

What the kernel already does

Linux 3.6, released on 30 September 2012, added “symlink and hardlink restrictions to the Linux VFS”; Kernel Newbies notes that “some distributions have been using this functionality for a while”.48 The kernel documentation describes the two settings, which are off at 0 and on at 1:

  • fs.protected_symlinks: when set to 1, “symlinks are permitted to be followed only when outside a sticky world-writable directory, or when the uid of the symlink and follower match, or when the directory owner matches the symlink’s owner”.49
  • fs.protected_hardlinks: when set to 1, “hardlinks cannot be created by users if they do not already own the source file, or do not have read/write access to it”. The implementation is more specific: it blocks a hard link only when the caller’s filesystem user ID does not own the file, the caller lacks CAP_FOWNER over it, and the file is not a “safe” source. A safe source must be a regular file, not setuid, not setgid with the group-execute bit also set, and readable and writable by the caller; the ownership and CAP_FOWNER checks take idmapped mounts and user namespaces into account.4950

The documentation credits both to “the restrictions in Openwall and grsecurity”.49

Linux 4.19, released on 22 October 2018, added two settings with three levels.51 At 1, fs.protected_fifos and fs.protected_regular refuse an O_CREAT open of a FIFO or regular file “that we don’t own in world writable sticky directories, unless they are owned by the owner of the directory”; at 2 they also apply to group-writable sticky directories; 0 leaves the behaviour unrestricted.49 They target a program that meant to create a file and instead opened one placed by someone else.

In mainline fs/namei.c the four variables are declared without an initial value, so the kernel’s built-in default is 0.50 systemd’s upstream 50-default.conf sets all four to 1; a system’s effective values depend on whether it ships that file and on later configuration, and are worth checking.52

What they do not cover

The symlink, FIFO and regular-file rules apply to sticky directories and turn on ownership; the hard link rule applies everywhere but has the conditions above. That leaves cases outside them:

  • Non-sticky directories an attacker can write to. Where a log directory, allocation directory or upload directory is owned by, or writable without a sticky bit by, the account that plants the link, the symlink rule does not apply, and it explicitly allows following links “when the directory owner matches the symlink’s owner”.49 Whether a given installation of the Nomad, insights-core, groonga or LXD cases is in this position depends on its actual directory ownership and modes, which the advisories describe only in part.
  • Links created by the privileged process itself. In archive extraction the extractor creates the link and then resolves it.5
  • Renames. No setting governs a directory being renamed during a walk.25
  • Files opened without `O_CREAT`. Kernel Newbies describes the 4.19 rule as excepting a file “opened without the O_CREAT flag”.51
  • Systems where they are off. CVE-2017-18078 is an example of exposure that appears when the hard link setting is off.40

The restrictions reduce the classic /tmp attacks and constrain hard links like the one in Bishop and Dilger’s example. They do not make it safe for a privileged process to resolve names in a directory someone else controls.

What closes the race

Resolve once, then act through the descriptor

The underlying fix is Bishop and Dilger’s observation turned into practice: open the object once, then do everything else through the file descriptor. fstat() on the descriptor reports on the object actually opened, and fchown() and fchmod() act on that object. CodeQL’s documentation for its C and C++ query cpp/toctou-race-condition, mapped to CWE-367 and rated high precision, gives the same advice, recommending functions that operate on file descriptors, for example fchmod in place of chmod.53

For directory trees, the *at() family extends this to walks. The open(2) page explains why it exists: with plain open(), “some component of the directory prefix given to open() could be changed in parallel”, and “such races can be avoided by opening a file descriptor for the target directory” and passing it to calls such as fstatat() and openat().32 A careful recursive operation opens each directory, lists it, opens each entry relative to the directory’s descriptor with flags that refuse links and non-directories where a directory is expected, and recurses with the new descriptor. Python’s documentation describes its resistant rmtree as relying on fd-based functions, and the Rust advisory says the affected targets lacked the APIs needed to mitigate the attack.3937

/* Illustrative only: change ownership of one child directory of a directory already held open.
   Assumes every directory from / down to the base is controlled by root, and that
   'name' was validated as a single component that is not "." or "..". */
int dfd = open("/srv/alloc/42/local", O_RDONLY | O_DIRECTORY | O_NOFOLLOW | O_CLOEXEC);
int fd  = openat(dfd, name, O_RDONLY | O_DIRECTORY | O_NOFOLLOW | O_NONBLOCK | O_CLOEXEC);
if (fd >= 0)
    fchown(fd, uid, gid);   /* acts on the object opened, not on a name */

The assumptions in the comment carry the safety. O_NOFOLLOW makes the open fail if the trailing component is a symbolic link, but “symbolic links in earlier components of the pathname will still be followed”; with O_PATH, the open(2) page describes a different behaviour that returns a descriptor for the link itself.32 The first open() is safe only if the directories leading to the base are controlled by root, and the second only if name is a single validated component. O_DIRECTORY makes the open fail on anything but a directory, which avoids opening a FIFO or device node; LXD’s import flaw included a named pipe that blocked the daemon and device nodes that reached host devices.329

Three properties need to be kept apart. A held directory descriptor is a stable reference to one directory object, “even if the directory is renamed”.32 That does not keep the directory beneath the original root: if others can move it, it can end up elsewhere, and a plain *at() call given a multi-component path is not a containment check. Containment during a single lookup is what openat2() resolution flags provide, and continued containment across a walk over directories others can modify needs assumptions about who can move them. Deleting and renaming also remain name operations: unlink(2) “deletes a name from the filesystem”, and renameat() takes separate directory descriptors for the source and the destination, each resolving its name in its directory when the call runs.5455 Recursive deletion therefore depends on validated single-component names, on each parent being held by descriptor, and on stated assumptions about who can change entries in, or move, those directories.

Create exclusively, or without a name

For new files, O_CREAT with O_EXCL combines what would otherwise be a separate existence check and creation into one call that fails if the final component is a symbolic link; earlier components are resolved as usual.32 mkstemp() packages that for temporary files, and O_TMPFILE removes the name altogether.3132 For temporary directories, mkdtemp(), which the mktemp(3) page names alongside mkstemp() as avoiding the race, creates the directory in one step with permissions 0700.3056 Whether the path used to reach it later stays stable still depends on its ancestor directories.

Resolution rules in the kernel: openat2

Linux 5.6 added openat2(), which lets the caller set rules that apply to every component of one resolution. The path traversal article covers RESOLVE_BENEATH, which fails if “any component of the resolution is not a descendant of the directory indicated by dirfd”, and RESOLVE_IN_ROOT, which treats that directory as the root for the call, “as though the calling process had used chroot”.26 Three further flags matter for links. RESOLVE_NO_SYMLINKS disallows symbolic links in all components, unlike O_NOFOLLOW; the man page notes an exception that returns an O_PATH descriptor for a trailing link when O_PATH and O_NOFOLLOW are also given. RESOLVE_NO_MAGICLINKS refuses procfs-style magic links. RESOLVE_NO_XDEV refuses to cross any mount point, including bind mounts.26

The interface admits a limit: with RESOLVE_IN_ROOT or RESOLVE_BENEATH, the call returns EAGAIN when “the kernel could not ensure that a “..” component didn’t escape (due to a race condition or potential attack)”, and “the caller may choose to retry”.26 glibc provides no wrapper, so callers use syscall().

/* Illustrative only: open a tenant-supplied relative path inside rootfd. */
struct open_how how = {
    .flags   = O_RDONLY | O_CLOEXEC,
    .resolve = RESOLVE_IN_ROOT | RESOLVE_NO_MAGICLINKS | RESOLVE_NO_XDEV,
};
int fd = syscall(SYS_openat2, rootfd, user_path, &how, sizeof how);
/* On EAGAIN, retry a bounded number of times, then fail closed. */

The guarantee is about that one resolution. Because the kernel applies the rule while it walks, after each link it meets, openat2() avoids the disagreement between a lexical check and the actual walk that the node-tar and compressing advisories describe. It does not decide whether an extractor should create a given link at all, and it does not constrain later calls: a program that obtains a descriptor inside the root must still decide what it is allowed to do with it, and creating links, deleting entries and setting ownership need their own controls. It is also Linux-only.

Libraries that wrap the descriptors

Most code should not hand-roll these walks. libpathrs, a Rust library by Aleksa Sarai with C, Go and Python bindings, offers APIs “to make path resolution within a potentially-untrusted directory safe on GNU/Linux”. Its README says it can run on kernels back to 2.6.39 in theory, strongly recommends at least Linux 5.6, and needs Linux 6.8 for all the hardening it uses.57 Go 1.24’s os.Root gives Go programs a directory handle whose methods are designed to refuse escapes through .. or symbolic links; the path traversal article covers its documented limits.25

These interfaces share an idea discussed in our capability security article: an open directory descriptor works as a capability, and names are resolved only relative to handles the program deliberately holds. During a constrained lookup, such as openat2() with RESOLVE_IN_ROOT, that keeps resolution inside the handle. It does not by itself keep a walk over modifiable directories contained across separate operations, and the libraries document their own limits: Go’s os.Root “does not limit traversal of mount points”, such as Linux bind mounts, and its protection depends on the platform, with the Go team noting that under GOOS=js it is vulnerable to TOCTOU races.25

Do the user’s work with the user’s credentials

The second structural fix removes the privilege instead of the race. If a privileged process needs to read or write a user’s files, the work can be done under that user’s credentials, so that any link the user plants leads only to files the user could already reach. Because Linux file permission checks use the filesystem user and group IDs, the supplementary groups and capabilities, matching only the user ID is not enough; the cleanest form is a separate process that has taken on the user’s full identity and holds no capabilities, with the privileged parent receiving only results.2822 The access(2) page’s effective-ID switch is a narrower version for its specific case.27 Linux’s setfsuid() changes only the filesystem user ID, and its manual page says it “is nowadays unneeded and should be avoided in new applications”, noting also that its return value cannot directly show whether it succeeded.58 logrotate’s su directive is the configuration-level version of the idea.36

Privilege separation has costs. The process boundary must be designed, and any switch back to privilege must be checked. It also does not fit every case: a container runtime acting on an image cannot meaningfully become “the image’s user”, and runtimes rely on descriptor-based resolution instead, as the container isolation article describes.

Keep the attacker out of the directory

The third fix addresses the environmental condition. Red Hat’s mitigation for insights-core is to restrict the upload directory to root or the dedicated service account, for example with mode 700, while noting that this may stop unprivileged services from publishing reports unless they are granted access.2 systemd’s PrivateTmp= gives a service its own /tmp and /var/tmp in a new file system namespace, “not shared with processes outside of the namespace”; it is off by default, and units can deliberately share such a namespace with JoinsNamespaceOf=.59 For extraction, Python’s documentation recommends a new destination directory.42 These measures protect a deployment, not the code: the same program installed with a looser directory mode is exposed again.

Windows

Windows has the same class with different parts. Creating an NTFS symbolic link normally requires SeCreateSymbolicLinkPrivilege, which by default is granted to the Administrators group, and Microsoft’s policy page warns that “symbolic links can expose security vulnerabilities in applications that aren’t designed to handle them”.60 There is a documented exception: CreateSymbolicLinkW accepts a flag to allow creation when the process is not elevated, and “Developer Mode must first be enabled on the machine before this option will function”.61 James Forshaw of Google Project Zero pointed out in 2015 that “there are three types of symbolic links you can access from a low privileged user, Object Manager Symbolic Links, Registry Key Symbolic Links and NTFS Mount Points”.62 He also showed that the Win32 CreateHardLink function requested write access to the target, while the underlying native call “works without needing write access to the target file”, and that the MS15-115 update broke the technique from a sandboxed context.63

Microsoft documents two related mitigations. RedirectionGuard is a process mitigation policy: with its enforce flag set, a process is prevented “from following filesystem junctions created by non-admin users” and the attempt is logged, and an audit flag logs such follows while allowing them.64 Separately, the Printers Policy CSP has a setting that applies Redirection Guard to the print spooler on Windows 11 version 22H2 and later; when enabled, “Redirection Guard will prevent any file redirections from being followed” within the spooler, and it defaults to enabled.65 The general code-level advice for Windows services follows the Unix advice: act through handles, avoid acting as SYSTEM on paths under user-writable directories, and do work on a client’s files under the client’s identity.

What a practitioner should do differently

In code review

  1. Find the name-resolving operations. In code that runs with more authority than whoever can influence the file system, list every call that takes a path: setuid programs, root daemons, container and orchestration agents, backup, logging and diagnostic tools, installers, updaters and anything that extracts archives. Flag any path used twice, any access(), stat() or lstat() followed by a path-based action, any path-based chown, chmod, unlink, rename or open in a recursive walk, and any path that passes through content supplied by a tenant or an archive.24
  2. Establish what an attacker can actually change. For each flagged path, record the owner and mode of every directory component in the deployed configuration, whether any is sticky, and which accounts can create, remove or rename entries there. Then identify the specific binding change the attacker would need (a planted link, a swapped entry, a renamed directory) and what the privileged operation would do to the redirected object. Only when both are established is the finding exploitable; write access alone is a screening signal.2422
  3. Remove the dependence on names. Replace pairs of path calls with one open and descriptor-based operations, use *at() calls relative to a held directory descriptor, and use openat2() or a library such as libpathrs or os.Root where names come from untrusted input.32265725
  4. Where the work is on a user’s files, use the user’s credentials in a separate process, not a partial identity switch.28
  5. Do not fix a race with another check. The Rust team’s warning about pre-checks applies generally: a test done by name before the action is itself racy.37

In configuration

  • Check the effective values of fs.protected_symlinks, fs.protected_hardlinks, fs.protected_fifos and fs.protected_regular, and keep them enabled; systemd’s upstream defaults set all four to 1.4952
  • Use PrivateTmp= for services that use temporary files, keeping in mind that units can deliberately share it.59
  • Use logrotate’s su directive for log directories controlled by non-privileged users.36
  • Restrict spool, upload and collection directories to the accounts that must write to them, and check that legitimate writers keep the access they need, as Red Hat’s insights-core mitigation notes.2

For archives

Extract into a new, empty directory created for the purpose, and reject symbolic and hard links unless the archive format’s users need them. In Python, use the data filter. PEP 706 introduced extraction filters in Python 3.12, and since 3.14 data is the default.6642 The documentation says filters “may be backported to older versions as security updates” and recommends checking hasattr(tarfile, 'data_filter') rather than the version number; where the feature exists on a release before 3.14, request it explicitly with filter='data', and where it is absent, update.42 The data filter refuses links to absolute paths or outside the destination and refuses device files and pipes, so archives that legitimately need such entries, for example system images, need a different, more trusting policy applied only to trusted sources.42 Python’s documentation is explicit that even data is not sufficient on its own and lists further checks.42 Upgrade node-tar to 8.0.0 and compressing to 2.1.4.57 Treat an extractor that validates link targets only by normalising strings as a red flag.

In testing

CodeQL’s cpp/toctou-race-condition query targets the classic shape, a check on a file name followed by an operation on the same name, and its documentation recommends descriptor-based functions or temporarily changing to the user’s identity.53 Static results still need the second review step, because whether anyone can change the binding is a property of the deployment.24

For dynamic and regression testing, the useful properties are invariants that can be checked in disposable fixtures: after a privileged operation on a tree that contains links, special files and hard links placed by an unprivileged test account, no file outside the intended root has changed content, ownership or mode, and no file outside it has been read into the output. For archive libraries, a regression corpus built from the published advisories’ scenarios, run in a throwaway directory, tests that links resolving outside the destination are never created and never written through.42 A test that passes is evidence about the cases it exercised; the research above is a reason not to treat a race that failed to trigger as proof that it cannot.

Where the evidence is thin

The academic papers reviewed here date from 1996 to 2009 and concentrate on access() and open() in setuid programs; for container runtimes, orchestrators and archive libraries, the evidence reviewed is single-case vendor and project advisories, and the NVD counts above reflect classification practice as well as the number of flaws.21

Conclusion

Privileged programs reach the wrong file because a file name passed as a string is a route, not the object the program means. The kernel resolves it afresh on each lookup, and whoever can change entries on that route, by planting a link in advance or by changing one between two operations, can change where it ends. Most of the late-2026 advisories sampled here are the first kind: a link supplied by a user, a tenant or an archive and later resolved with the program’s authority. The LXD socket case is the second, the race Bishop and Dilger described in 1996.

For the race, making it improbable has a poor record: both probabilistic defences in the papers reviewed here were broken in configurations the follow-up papers demonstrated. Linux’s link restrictions help where they are enabled and where the directories involved have the modes and ownership the rules test; the symlink and file-creation rules concern sticky directories, and the hard-link rule constrains link creation everywhere but with conditions.

What works is structural. Resolve a name once and act through the descriptor; walk trees relative to directory descriptors; let the kernel enforce containment during each resolution with openat2() or a library built on it, and decide separately what the program may do with what it finds; create files exclusively or without names; and do work on a user’s files in a process holding that user’s credentials. Where code cannot be changed quickly, removing other writers from the directories a privileged process uses addresses the environmental half. The node-tar advisories add a narrower rule for library authors: a containment check that normalises strings can disagree with the kernel once an earlier step has created a link.

Footnotes

  1. Red Hat, “RHSA-2026:107670 – Security Advisory: Moderate: insights-core security, bug fix, and enhancement update”, issued 3 December 2026. https://access.redhat.com/errata/RHSA-2026:107670 (opens in a new tab) ↩
  2. Red Hat, “CVE-2026-115220”, Red Hat Customer Portal CVE database, accessed 4 December 2026. https://access.redhat.com/security/cve/cve-2026-115220 (opens in a new tab) ↩1 ↩2 ↩3 ↩4
  3. Semtech (CNA), “CVE-2026-137266”, CVE record, published 1 December 2026 (read as CVE JSON 5 from the CVE Services API). https://cveawg.mitre.org/api/cve/CVE-2026-137266 (opens in a new tab) ↩
  4. Semtech, “SEM-PSA-2026-003: AOS Security Advisory”, 1 December 2026. https://www.semtech.com/company/security/security-bulletins/sem-psa-2026-003-aos-security-advisory (opens in a new tab) ↩
  5. GitHub Advisory Database, “node-tar: Symlink containment bypass via chained symlinks lets tar.x() create links that resolve outside the extraction directory (regression since 7.5.5)”, GHSA-3wwj-8j6r-q339 (CVE-2026-140250), 2 December 2026. https://github.com/advisories/GHSA-3wwj-8j6r-q339 (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5
  6. GitHub Advisory Database, “node-tar: Symlink linkpath escape check is lexical: ‘..’ after an in-archive symlink creates symlinks outside the extraction directory”, GHSA-gvrf-jx37-rjv5 (CVE-2026-140247), 2 December 2026. https://github.com/advisories/GHSA-gvrf-jx37-rjv5 (opens in a new tab) ↩
  7. node-modules/compressing, “tar symlink containment bypass via self-referential directory link (incomplete fix of GHSA-4c3q-x735-j3r5)”, GHSA-grx6-75c5-f738, GitHub, 31 October 2026. https://github.com/node-modules/compressing/security/advisories/GHSA-grx6-75c5-f738 (opens in a new tab) ↩1 ↩2 ↩3
  8. VulnCheck (CNA), “CVE-2026-144971: compressing symlink containment bypass”, CVE record, published 4 December 2026. https://cveawg.mitre.org/api/cve/CVE-2026-144971 (opens in a new tab) ↩
  9. canonical/lxd, “Restricted project users can read or overwrite host files through special files, hard links or symlinks in backup or image metadata”, GHSA-fvhv-5r5f-xx7c (CVE-2026-137114), GitHub, 26 November 2026. https://github.com/canonical/lxd/security/advisories/GHSA-fvhv-5r5f-xx7c (opens in a new tab) ↩1 ↩2
  10. canonical/lxd, “Local users can gain root on the host through transfer sockets, instance directories and disk staging mounts”, GHSA-fxg7-8r76-78r5 (CVE-2026-135381), GitHub, 26 November 2026. https://github.com/canonical/lxd/security/advisories/GHSA-fxg7-8r76-78r5 (opens in a new tab) ↩1 ↩2
  11. Red Hat, “RHSA-2026:104718 – Security Advisory: Important: crun security update”, issued 30 November 2026. https://access.redhat.com/errata/RHSA-2026:104718 (opens in a new tab) ↩
  12. GitHub, Inc. (CNA), “CVE-2026-47766: crun follows rootfs /dev symlink while creating default devices”, CVE record, published 14 August 2026. https://cveawg.mitre.org/api/cve/CVE-2026-47766 (opens in a new tab) ↩
  13. HashiCorp, “HCSEC-2026-52 - Nomad dispatch payload writes can escape the allocation directory through symlinks”, HashiCorp Discuss, 29 October 2026. https://discuss.hashicorp.com/t/hcsec-2026-52-nomad-dispatch-payload-writes-can-escape-the-allocation-directory-through-symlinks/77930 (opens in a new tab) ↩
  14. HashiCorp, “HCSEC-2026-53 - Nomad allocation data migration may allow host directory permission modification via symlink following”, HashiCorp Discuss, 29 October 2026. https://discuss.hashicorp.com/t/hcsec-2026-53-nomad-allocation-data-migration-may-allow-host-directory-permission-modification-via-symlink-following/77931 (opens in a new tab) ↩1 ↩2
  15. MITRE, “CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition”, Common Weakness Enumeration, accessed 4 December 2026. https://cwe.mitre.org/data/definitions/367.html (opens in a new tab) ↩
  16. MITRE, “CWE-59: Improper Link Resolution Before File Access (‘Link Following’)”, Common Weakness Enumeration, accessed 4 December 2026. https://cwe.mitre.org/data/definitions/59.html (opens in a new tab) ↩1 ↩2
  17. MITRE, “CWE-61: UNIX Symbolic Link (Symlink) Following”, Common Weakness Enumeration, accessed 4 December 2026. https://cwe.mitre.org/data/definitions/61.html (opens in a new tab) ↩
  18. MITRE, “CWE-62: UNIX Hard Link”, Common Weakness Enumeration, accessed 4 December 2026. https://cwe.mitre.org/data/definitions/62.html (opens in a new tab) ↩
  19. MITRE, “CWE-377: DEPRECATED: Insecure Temporary File (5.0)”, Common Weakness Enumeration, accessed 4 December 2026. https://cwe.mitre.org/data/definitions/377.html (opens in a new tab) ↩
  20. MITRE, “2025 CWE Top 25 Most Dangerous Software Weaknesses”, Common Weakness Enumeration, accessed 4 December 2026. https://cwe.mitre.org/top25/archive/2025/2025_cwe_top25.html (opens in a new tab) ↩
  21. National Vulnerability Database, CVE API 2.0 query with cweId=CWE-59 (also run with CWE-61, CWE-62, CWE-367 and CWE-22, and with quarterly pubStartDate and pubEndDate windows for 2024 to 2026), run 4 December 2026 at about 18:40 UTC. https://services.nvd.nist.gov/rest/json/cves/2.0?cweId=CWE-59&resultsPerPage=1 (opens in a new tab) ↩1 ↩2
  22. Linux man-pages project, “path_resolution(7)”, accessed 4 December 2026. https://man7.org/linux/man-pages/man7/path_resolution.7.html (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6
  23. Linux man-pages project, “symlink(2)”, accessed 4 December 2026. https://man7.org/linux/man-pages/man2/symlink.2.html (opens in a new tab) ↩
  24. Matt Bishop and Michael Dilger, “Checking for Race Conditions in File Accesses”, Computing Systems 9(2), pp. 131–152, Spring 1996 (author’s copy). https://nob.cs.ucdavis.edu/bishop/papers/1996-compsys/racecond.pdf (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7
  25. Damien Neil, “Traversal-resistant file APIs”, The Go Blog, 12 March 2025. https://go.dev/blog/osroot (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5
  26. Linux man-pages project, “openat2(2)”, accessed 4 December 2026. https://man7.org/linux/man-pages/man2/openat2.2.html (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5
  27. Linux man-pages project, “access(2)”, accessed 4 December 2026. https://man7.org/linux/man-pages/man2/access.2.html (opens in a new tab) ↩1 ↩2
  28. Linux man-pages project, “credentials(7)”, accessed 4 December 2026. https://man7.org/linux/man-pages/man7/credentials.7.html (opens in a new tab) ↩1 ↩2 ↩3
  29. Linux man-pages project, “capabilities(7)”, accessed 4 December 2026. https://man7.org/linux/man-pages/man7/capabilities.7.html (opens in a new tab) ↩
  30. Linux man-pages project, “mktemp(3)”, accessed 4 December 2026. https://man7.org/linux/man-pages/man3/mktemp.3.html (opens in a new tab) ↩1 ↩2
  31. Linux man-pages project, “mkstemp(3)”, accessed 4 December 2026. https://man7.org/linux/man-pages/man3/mkstemp.3.html (opens in a new tab) ↩1 ↩2
  32. Linux man-pages project, “open(2)”, accessed 4 December 2026. https://man7.org/linux/man-pages/man2/open.2.html (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9
  33. Python Software Foundation (CNA), “CVE-2026-12345: tempfile.TemporaryDirectory cleanup race”, CVE record, published 29 September 2026, updated 1 December 2026. https://cveawg.mitre.org/api/cve/CVE-2026-12345 (opens in a new tab) ↩1 ↩2
  34. MITRE (CNA), “CVE-2011-1548: logrotate default configuration on Debian”, CVE record, published 30 March 2011. https://cveawg.mitre.org/api/cve/CVE-2011-1548 (opens in a new tab) ↩
  35. MITRE (CNA), “CVE-2019-11675: groonga-httpd log directory ownership on Debian”, CVE record, published 2 May 2019. https://cveawg.mitre.org/api/cve/CVE-2019-11675 (opens in a new tab) ↩
  36. Linux man-pages project (logrotate), “logrotate(8)”, accessed 4 December 2026. https://man7.org/linux/man-pages/man8/logrotate.8.html (opens in a new tab) ↩1 ↩2 ↩3
  37. The Rust Security Response WG, “Security advisory for the standard library (CVE-2022-21658)”, Rust Blog, 20 January 2022. https://blog.rust-lang.org/2022/01/20/cve-2022-21658/ (opens in a new tab) ↩1 ↩2 ↩3
  38. python/cpython, “shutil.rmtree is vulnerable to a symlink attack”, issue #48739 (bpo-4489), GitHub, opened 2 December 2008, closed 28 June 2012. https://github.com/python/cpython/issues/48739 (opens in a new tab) ↩
  39. Python Software Foundation, “shutil: High-level file operations”, Python documentation, accessed 4 December 2026. https://docs.python.org/3/library/shutil.html (opens in a new tab) ↩1 ↩2
  40. MITRE (CNA), “CVE-2017-18078: systemd-tmpfiles hard link handling”, CVE record, published 29 January 2018. https://cveawg.mitre.org/api/cve/CVE-2017-18078 (opens in a new tab) ↩1 ↩2
  41. Python Software Foundation, “tarfile: Read and write tar archive files” (Python 3.13 documentation), accessed 4 December 2026. https://docs.python.org/3.13/library/tarfile.html (opens in a new tab) ↩
  42. Python Software Foundation, “tarfile: Read and write tar archive files”, Python documentation, accessed 4 December 2026. https://docs.python.org/3/library/tarfile.html (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8
  43. Drew Dean and Alan J. Hu, “Fixing Races for Fun and Profit: How to use access(2)”, Proceedings of the 13th USENIX Security Symposium, San Diego, August 2004. https://www.usenix.org/legacy/event/sec04/tech/full_papers/dean/dean.pdf (opens in a new tab) ↩1 ↩2
  44. Nikita Borisov, Rob Johnson, Naveen Sastry and David Wagner, “Fixing Races for Fun and Profit: How to abuse atime”, Proceedings of the 14th USENIX Security Symposium, 2005. https://www.usenix.org/legacy/event/sec05/tech/full_papers/borisov/borisov.pdf (opens in a new tab) ↩1 ↩2
  45. Dan Tsafrir, Tomer Hertz, David Wagner and Dilma Da Silva, “Portably Solving File TOCTTOU Races with Hardness Amplification”, FAST ‘08: 6th USENIX Conference on File and Storage Technologies, 2008. https://www.usenix.org/legacy/event/fast08/tech/full_papers/tsafrir/tsafrir.pdf (opens in a new tab) ↩
  46. Xiang Cai, Yuwei Gui and Rob Johnson, “Exploiting Unix File-System Races via Algorithmic Complexity Attacks”, 2009 30th IEEE Symposium on Security and Privacy, pp. 27–41 (DOI 10.1109/SP.2009.10; copy read hosted by UC Riverside course materials). https://www.cs.ucr.edu/~trentj/cse598-f11/docs/cai_oakland09_races2.pdf (opens in a new tab) ↩
  47. Simon Zuckerbraun, “Abusing Arbitrary File Deletes to Escalate Privilege and Other Great Tricks”, Zero Day Initiative blog, 17 March 2022, updated 3 September 2024. https://www.zerodayinitiative.com/blog/2022/3/16/abusing-arbitrary-file-deletes-to-escalate-privilege-and-other-great-tricks (opens in a new tab) ↩
  48. Kernel Newbies, “Linux 3.6”, accessed 4 December 2026. https://kernelnewbies.org/Linux_3.6 (opens in a new tab) ↩
  49. The Linux kernel documentation, “Documentation for /proc/sys/fs/”, accessed 4 December 2026. https://docs.kernel.org/admin-guide/sysctl/fs.html (opens in a new tab) ↩1 ↩2 ↩3 ↩4 ↩5 ↩6
  50. Linux kernel source, fs/namei.c (mainline), accessed 4 December 2026. https://github.com/torvalds/linux/blob/master/fs/namei.c (opens in a new tab) ↩1 ↩2
  51. Kernel Newbies, “Linux 4.19”, accessed 4 December 2026. https://kernelnewbies.org/Linux_4.19 (opens in a new tab) ↩1 ↩2
  52. systemd project, sysctl.d/50-default.conf, accessed 4 December 2026. https://github.com/systemd/systemd/blob/main/sysctl.d/50-default.conf (opens in a new tab) ↩1 ↩2
  53. GitHub, “Time-of-check time-of-use filesystem race condition” (cpp/toctou-race-condition), CodeQL query help, accessed 4 December 2026. https://codeql.github.com/codeql-query-help/cpp/cpp-toctou-race-condition/ (opens in a new tab) ↩1 ↩2
  54. Linux man-pages project, “unlink(2)”, accessed 4 December 2026. https://man7.org/linux/man-pages/man2/unlink.2.html (opens in a new tab) ↩
  55. Linux man-pages project, “rename(2)”, accessed 4 December 2026. https://man7.org/linux/man-pages/man2/rename.2.html (opens in a new tab) ↩
  56. Linux man-pages project, “mkdtemp(3)”, accessed 4 December 2026. https://man7.org/linux/man-pages/man3/mkdtemp.3.html (opens in a new tab) ↩
  57. Aleksa Sarai, “libpathrs”, README, GitHub, accessed 4 December 2026. https://github.com/cyphar/libpathrs (opens in a new tab) ↩1 ↩2
  58. Linux man-pages project, “setfsuid(2)”, accessed 4 December 2026. https://man7.org/linux/man-pages/man2/setfsuid.2.html (opens in a new tab) ↩
  59. systemd project, “systemd.exec”, PrivateTmp=, accessed 4 December 2026. https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html (opens in a new tab) ↩1 ↩2
  60. Microsoft, “Create symbolic links”, Windows security policy settings documentation, accessed 4 December 2026. https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/security-policy-settings/create-symbolic-links (opens in a new tab) ↩
  61. Microsoft, “CreateSymbolicLinkW function (winbase.h)”, Win32 API documentation, accessed 4 December 2026. https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createsymboliclinkw (opens in a new tab) ↩
  62. James Forshaw, “Windows 10^H^H Symbolic Link Mitigations”, Google Project Zero, 25 August 2015. https://googleprojectzero.blogspot.com/2015/08/windows-10hh-symbolic-link-mitigations.html (opens in a new tab) ↩
  63. James Forshaw, “Between a Rock and a Hard Link”, Google Project Zero, 4 December 2015. https://googleprojectzero.blogspot.com/2015/12/between-rock-and-hard-link.html (opens in a new tab) ↩
  64. Microsoft, “PROCESS_MITIGATION_REDIRECTION_TRUST_POLICY structure (winnt.h)”, Win32 API documentation, accessed 4 December 2026. https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-process-mitigation-redirection-trust-policy (opens in a new tab) ↩
  65. Microsoft, “Printers Policy CSP: ConfigureRedirectionGuardPolicy”, Windows client management documentation, accessed 4 December 2026. https://learn.microsoft.com/en-us/windows/client-management/mdm/policy-csp-printers (opens in a new tab) ↩
  66. Petr Viktorin, “PEP 706 – Filter for tarfile.extractall”, Python Enhancement Proposals, created 9 February 2023, Python 3.12. https://peps.python.org/pep-0706/ (opens in a new tab) ↩