Skip to content
Race condition Disclosed report Advanced CVE-2022-21658

Time-of-check to time-of-use vulnerability in the std::fs::remove_dir_all() function of the Rust standard library

The Rust standard library's remove_dir_all function had a time-of-check to time-of-use race condition that allowed an attacker to replace a directory with a symbolic link between the check and the deletion, causing the function to follow the link and delete files outside the intended directory. An attacker with write access to a directory being deleted by a privileged program could trick that program into deleting sensitive files or directories it could not otherwise access.

hkratz Follow

Originally disclosed on HackerOne

Bounty$4,000 High View original
  • Fixed in 8 hours
  • Paid in 8 hours
  • Disclosed after 9 hours

Summary by the program

Race condition in std::fs::remove_dir_all Description This is a cross-post of the official security advisory. The official advisory contains a signed version with our PGP key, as well.

The Rust Security Response WG was notified that the std::fs::remove_dir_all standard library function is vulnerable a race condition enabling symlink following (CWE-363). An attacker could use this security issue to trick a privileged program into deleting files and directories the attacker couldn't otherwise access or delete.

This issue has been assigned CVE-2022-21658.

Overview Let's suppose an attacker obtained unprivileged access to a system and needed to delete a system directory called sensitive/, but they didn't have the permissions to do so. If std::fs::remove_dir_all followed symbolic links, they could find a privileged program that removes a directory they have access to (called temp/), create a symlink from temp/foo to sensitive/, and wait for the privileged program to delete foo/. The privileged program would follow the symlink from temp/foo to sensitive/ while recursively deleting, resulting in sensitive/ being deleted.

To prevent such attacks, std::fs::remove_dir_all already includes protection to avoid recursively deleting symlinks, as described in its documentation:

This function does not follow symbolic links and it will simply remove the symbolic link itself.

Unfortunately that check was implemented incorrectly in the standard library, resulting in a TOCTOU (Time-of-check Time-of-use) race condition. 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.

This exposed a race condition: an attacker could create a directory and replace it with a symlink between the check and the actual deletion. While this attack likely won't work the first time it's attempted, in our experimentation we were able to reliably perform it within a couple of seconds.

Affected Versions Rust 1.0.0 through Rust 1.58.0 is affected by this vulnerability. We're going to release Rust 1.58.1 later today, which will include mitigations for this vulnerability. Patches to the Rust standard library are also available for custom-built Rust toolchains here.

Note that the following targets don't have usable APIs to properly mitigate the attack, and are thus still vulnerable even with a patched toolchain:

macOS before version 10.10 (Yosemite) REDOX Mitigations We recommend everyone to update to Rust 1.58.1 as soon as possible, especially people developing programs expected to run in privileged contexts (including system daemons and setuid binaries), as those have the highest risk of being affected by this.

Note 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 like remove_dir_all itself. The existing mitigation is working as intended outside of race conditions.

Acknowledgments We want to thank Hans Kratz for independently discovering and disclosing this issue to us according to the Rust security policy, for developing the fix for UNIX-like targets and for reviewing fixes for other platforms.

We also want to thank Florian Weimer for reviewing the UNIX-like fix and for reporting the same issue back in 2018, even though the Security Response WG didn't realize the severity of the issue at the time.

Finally we want to thank Pietro Albini for coordinating the security response and writing this advisory, Chris Denton for writing the Windows fix, Alex Crichton for writing the WASI fix, and Mara Bos for reviewing the patches.

https://github.com/rust-lang/rust/security/advisories/GHSA-r9cc-f5pr-p3j2

The report

The implementation of std::fs::remove_dir_all() in the Rust standard library is vulnerable to a time-of-check to time-of-use link replacement attack. This applies to all versions of Rust before 1.58.1.

Vulnerability details

The documentation of std::fs::remove_dir_all() guarantees that the function does not follow symbolic links:

Removes a directory at this path, after removing all its contents. Use carefully! This function does not follow symbolic links and it will simply remove the symbolic link itself.

The vulnerable implementation for Windows is in library/std/src/sys/windows/fs.rs. For other platforms it is in library/std/src/sys_common/fs.rs. Both use a remove_dir_all_recursive() helper function which does the actual recursion and deletion. It opens directory by the given path and iterates the directory entries. For each directory entry it checks if the entry is a directory and recurses into it if it is. If it is not it is deleted using std::fs::remove_file(). On the way back up the now empty directories are deleted using std::fs::remove_dir()

There are two problems with this implementation if the attacker has write access to a directory which is being deleted by the privileged process:

  1. The type of a directory entry is checked and it is being recursed into if it is a directory. There is a short time window between the check and the opening of the subdirectory which an attacker can exploit by replacing the subdirectory with symlink causing the symlink to be followed.

  2. The path given to std::fs::remove_dir_all() is extended with subentry paths which are then used to process subdirectories and delete directory entries. Paths are resolved by the operating system each time they are passed to a system call. If the attacker can replace a descendent directory of the directory passed to remove_dir_all() while a subdirectory of it is being processed with a symlink he can cause that symlink to be followed in subsequent filesystem operations.

A proof-of-concept code demonstrating the vulnerability is attached.

Mitigation

  • Update to Rust 1.58.1 or later which includes a fixed implementation for all supported platforms except for macOS before version 10.10 and REDOX.
  • Don't use the vulnerable std::fs::remove_dir_all() in a privileged process or any other security-senstitive context.
  • Make sure that std::fs::remove_dir_all() is only used on directories not accessible to processes from other security contexts.

Impact

If the attacker has write access to a directory which is being deleted by the privileged process using remove_dir_all() he can trick the process to delete any sensitive files or directory subtrees that the privileged process can.

The original report as published on HackerOne, by hkratz. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 7 min read.

Context

std::fs::remove_dir_all() is a function in the Rust standard library that removes a directory at a given path, after removing all of its contents. Its documentation makes a security-relevant promise:

Removes a directory at this path, after removing all its contents. Use carefully! This function does not follow symbolic links and it will simply remove the symbolic link itself.

That promise matters because the function is often called by privileged programs, including system daemons and setuid binaries. If such a program can be tricked into following a symlink while it recursively deletes a directory, it can be made to delete files and directories that the attacker could not otherwise access or delete. The issue described here is a time-of-check to time-of-use (TOCTOU) race condition that breaks exactly that guarantee. It was assigned CVE-2022-21658 and tracked as CWE-363 (symlink following).

Setup

The attack model is straightforward and needs no special tooling beyond the ability to run code as an unprivileged user on the same system as a privileged program:

  1. The attacker has unprivileged access to the system.
  2. A privileged program on that system calls std::fs::remove_dir_all() on a directory the attacker can write to.
  3. The attacker wants to delete a directory they cannot touch directly, for example one called sensitive/.

The affected versions are Rust 1.0.0 through Rust 1.58.0. The fix landed in Rust 1.58.1. Two targets have no usable APIs to properly mitigate the attack and remain vulnerable even with a patched toolchain: macOS before version 10.10 (Yosemite), and REDOX.

Finding it

The documented guarantee (no symlink following) was not enforced by the implementation. Instead of telling the operating system not to follow symlinks, the standard library first checked whether the thing it was about to delete was a symlink, and only if it was not did it proceed to recursively delete the directory. That check-then-act pattern is the classic setup for a race: an attacker can create a directory and replace it with a symlink between the check and the actual deletion.

The vulnerable implementation for Windows lives in library/std/src/sys/windows/fs.rs, and for other platforms in library/std/src/sys_common/fs.rs. Both use a remove_dir_all_recursive() helper that performs the recursion and deletion. It opens the directory by the given path and iterates its entries. For each entry it checks whether the entry is a directory and recurses into it if so. If it is not a directory, the entry is deleted with std::fs::remove_file(). On the way back up, the now empty directories are deleted with std::fs::remove_dir().

Exploitation

The report describes the attack in terms of a privileged program deleting a directory called temp/ that the attacker can write to, while the attacker wants sensitive/ gone.

Step 1: Find a privileged deletion of an attacker-writable directory

The attacker locates a privileged program that calls remove_dir_all() on a directory they have access to, here temp/. This is the precondition for everything that follows: without write access to a directory being deleted by the privileged process, the race cannot be won.

Step 2: Plant a symlink inside it

The attacker creates a symlink from temp/foo to sensitive/ and waits for the privileged program to delete foo/. If the deletion follows the symlink, the privileged program walks from temp/foo into sensitive/ while recursively deleting, and sensitive/ is removed.

Step 3: Win the race

The check and the deletion are separate operations, so the attacker has to swap a real directory for a symlink in the window between them. The report is explicit that this attack likely will not work the first time it is attempted, but in the authors' experimentation they were able to perform it reliably within a couple of seconds.

A proof-of-concept demonstrating the vulnerability was attached to the report.

Root cause

The report identifies two distinct problems, both of which require the attacker to have write access to a directory being deleted by the privileged process.

  1. Type check then recurse. The type of a directory entry is checked, and the code recurses into it if it is a directory. There is a short time window between the check and the opening of the subdirectory, and an attacker can exploit it by replacing the subdirectory with a symlink, causing the symlink to be followed.

  2. Path re-resolution. The path given to std::fs::remove_dir_all() is extended with subentry paths, and those paths are then used to process subdirectories and delete directory entries. Paths are resolved by the operating system each time they are passed to a system call. If the attacker can replace a descendant directory of the directory passed to remove_dir_all() with a symlink while a subdirectory of it is being processed, that symlink will be followed in subsequent filesystem operations.

The existing defence was the symlink check itself, and it failed because that check was implemented incorrectly. The report notes that the existing mitigation works as intended outside of race conditions.

Impact

If the attacker has write access to a directory that is being deleted by a privileged process using remove_dir_all(), they can trick that process into deleting any sensitive files or directory subtrees that the privileged process itself can reach. The report frames the highest risk as programs expected to run in privileged contexts, including system daemons and setuid binaries.

Fix

Rust 1.58.1 includes mitigations for the vulnerability, with a fixed implementation for all supported platforms except macOS before version 10.10 and REDOX, which remain vulnerable because they lack usable APIs to properly mitigate the attack. Patches to the Rust standard library are also available for custom-built Rust toolchains. Hans Kratz developed the fix for UNIX-like targets and reviewed fixes for other platforms; Chris Denton wrote the Windows fix, Alex Crichton wrote the WASI fix, Florian Weimer reviewed the UNIX-like fix, and Mara Bos reviewed the patches.

The advisory also gives guidance that is not a code change:

  1. Update to Rust 1.58.1 or later.
  2. Do not use the vulnerable std::fs::remove_dir_all() in a privileged process or any other security-sensitive context.
  3. Make sure std::fs::remove_dir_all() is only used on directories not accessible to processes from other security contexts.

Adding checks in your own codebase before calling remove_dir_all() does not mitigate the vulnerability, because those checks would be vulnerable to race conditions just like remove_dir_all itself.

Variants to test

  1. Other recursive delete helpers. Look for any library function that promises not to follow symlinks but implements that promise with a stat-style check followed by a separate open or delete. A positive result is a directory entry that can be swapped for a symlink between the two calls and ends up being traversed.
  2. Path-building recursion. Look for recursive deletion that concatenates child names onto the original path and re-resolves the whole path on each system call. A positive result is a descendant directory replaced by a symlink mid-walk whose target is then processed.
  3. Privileged callers. Enumerate daemons and setuid binaries that delete directories in locations writable by less privileged users, such as temporary or cache directories. A positive result is a deletion that reaches outside the writable directory into a path the caller could not otherwise remove.
  4. Platforms without safe primitives. Check targets the advisory lists as still vulnerable even when patched, macOS before 10.10 and REDOX, and any other platform where the library cannot ask the kernel not to follow links.

Hunting notes

This class of bug hides in standard library and utility code that implements a security promise with a check rather than with an atomic primitive. The signal during review is a documented guarantee about symlinks combined with an implementation that stats an entry and then acts on it in a later call, or that rebuilds paths and lets the operating system resolve them again. The report's own framing is the useful test: ask whether the code tells the system not to follow symlinks, or merely asks whether the thing is a symlink before proceeding.

On impact, the report makes the case through the privilege boundary rather than through a single victim application: an unprivileged user with write access to a directory deleted by a privileged process can cause deletion of sensitive files and subtrees that the privileged process can reach. The reliability claim matters too: the authors state they could perform the attack reliably within a couple of seconds, which turns a theoretical race into a practical one. The report credits Florian Weimer with reporting the same issue back in 2018, even though the Security Response WG did not realise the severity at the time.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 14 min read.

What happened, in plain words

Rust is a programming language. Programs written in Rust can use a large collection of ready-made code that ships with the language, called the standard library. One of its functions, std::fs::remove_dir_all(), deletes a folder and everything inside it. The word "fs" stands for filesystem, the part of the operating system that organises files and folders.

That function makes a promise in its documentation: it will not follow symbolic links. A symbolic link (symlink) is a small file that acts like a signpost pointing at another file or folder. If you delete the signpost, the thing it points at should stay untouched. The function promised to delete only the signpost itself.

The promise was not kept. The function checked whether something was a symlink, and then, a moment later, deleted it. Between the check and the deletion an attacker could swap a real folder for a symlink. The function would then follow the symlink and delete whatever it pointed at, even files the attacker had no permission to touch. This kind of bug is called a time-of-check to time-of-use (TOCTOU) race condition: the situation changes between the moment you check it and the moment you act on it.

The problem was assigned the identifier CVE-2022-21658 and classified as CWE-363, which is the label for "symlink following". It affected every version of Rust from 1.0.0 through 1.58.0, and was fixed in 1.58.1. The issue was reported by Hans Kratz.

Context

std::fs::remove_dir_all() is a function in the Rust standard library that removes a directory at a given path, after removing all of its contents. Its documentation makes a security-relevant promise:

Removes a directory at this path, after removing all its contents. Use carefully! This function does not follow symbolic links and it will simply remove the symbolic link itself.

That promise matters because the function is often called by privileged programs, including system daemons and setuid binaries. If such a program can be tricked into following a symlink while it recursively deletes a directory, it can be made to delete files and directories that the attacker could not otherwise access or delete. The issue described here is a time-of-check to time-of-use (TOCTOU) race condition that breaks exactly that guarantee. It was assigned CVE-2022-21658 and tracked as CWE-363 (symlink following).

A few of those words need unpacking. A path is the address of a file or folder, like temp/foo. A directory is a folder. Recursively means "and then everything inside it, and everything inside those, all the way down". A privileged program is one that runs with more power than an ordinary user, for example a background service (a daemon) or a program that temporarily borrows the permissions of whoever started it (a setuid binary). A CVE is a public catalogue number for a known security flaw, and a CWE is a catalogue number for a category of flaw.

Setup

The attack model is straightforward and needs no special tooling beyond the ability to run code as an unprivileged user on the same system as a privileged program:

  1. The attacker has unprivileged access to the system.
  2. A privileged program on that system calls std::fs::remove_dir_all() on a directory the attacker can write to.
  3. The attacker wants to delete a directory they cannot touch directly, for example one called sensitive/.

In plain terms: the attacker is an ordinary user on a shared computer. Some more powerful program on that computer occasionally cleans up a folder the attacker is allowed to put files in. The attacker wants a folder called sensitive/ gone but has no permission to delete it. The trick is to make the powerful program do the deleting on the attacker's behalf.

The affected versions are Rust 1.0.0 through Rust 1.58.0. The fix landed in Rust 1.58.1. Two targets have no usable APIs to properly mitigate the attack and remain vulnerable even with a patched toolchain: macOS before version 10.10 (Yosemite), and REDOX.

An API is the set of operations an operating system or library offers to programs, the way a shop counter offers services to customers. On those two targets the operating system does not offer the operation the fix needs, so the fix cannot be applied there. REDOX is an operating system written in Rust.

Finding it

The researcher noticed that the documented guarantee (no symlink following) was not actually enforced by the implementation. Instead of telling the operating system not to follow symlinks, the standard library first checked whether the thing it was about to delete was a symlink, and only if it was not did it proceed to recursively delete the directory. That check-then-act pattern is the classic setup for a race: an attacker can create a directory and replace it with a symlink between the check and the actual deletion.

Think of a security guard who looks at a parcel, confirms it is a harmless box, and then walks over to throw it away. If someone swaps the box for a live parcel while the guard is walking, the guard throws away the wrong thing. The guard did nothing wrong at the moment of checking; the problem is that checking and acting were two separate moments.

The vulnerable implementation for Windows lives in library/std/src/sys/windows/fs.rs, and for other platforms in library/std/src/sys_common/fs.rs. Both use a remove_dir_all_recursive() helper that performs the recursion and deletion. It opens the directory by the given path and iterates its entries. For each entry it checks whether the entry is a directory and recurses into it if so. If it is not a directory, the entry is deleted with std::fs::remove_file(). On the way back up, the now empty directories are deleted with std::fs::remove_dir().

Those file paths are locations inside the Rust source code repository, not web addresses. The helper function is the piece of code that does the actual walking and deleting. std::fs::remove_file() deletes a single file, and std::fs::remove_dir() deletes a single empty folder. The helper opens a folder, looks at each item inside, goes deeper if the item is a folder, deletes it if it is a file, and finally removes the folders it has emptied on the way back up.

Exploitation

The report describes the attack in terms of a privileged program deleting a directory called temp/ that the attacker can write to, while the attacker wants sensitive/ gone.

Step 1: Find a privileged deletion of an attacker-writable directory

The attacker locates a privileged program that calls remove_dir_all() on a directory they have access to, here temp/. This is the precondition for everything that follows: without write access to a directory being deleted by the privileged process, the race cannot be won.

This step is reconnaissance. The attacker is not breaking anything yet, just looking for a powerful program that will delete a folder the attacker controls. Without that, there is no way to get the powerful program to act on attacker-chosen content.

Step 2: Plant a symlink inside it

The attacker creates a symlink from temp/foo to sensitive/ and waits for the privileged program to delete foo/. If the deletion follows the symlink, the privileged program walks from temp/foo into sensitive/ while recursively deleting, and sensitive/ is removed.

Here temp/foo is the signpost and sensitive/ is the place it points to. The attacker is allowed to create things inside temp/, so creating the signpost is permitted. The hope is that the powerful program, when it reaches foo, treats it as a folder to walk into rather than as a signpost to remove.

Step 3: Win the race

The check and the deletion are separate operations, so the attacker has to swap a real directory for a symlink in the window between them. The report is explicit that this attack likely will not work the first time it is attempted, but in the authors' experimentation they were able to perform it reliably within a couple of seconds.

A race condition is a bug that depends on timing. Two things happen in sequence, and the attacker has to change the world in the tiny gap between them. Doing it once by luck is hard; doing it in a loop until it succeeds is practical, which is why the authors describe it as reliable within seconds.

A proof-of-concept demonstrating the vulnerability was attached to the report. A proof of concept is a small program written only to show that a flaw is real, not a finished attack tool.

Root cause

The report identifies two distinct problems, both of which require the attacker to have write access to a directory being deleted by the privileged process.

  1. Type check then recurse. The type of a directory entry is checked, and the code recurses into it if it is a directory. There is a short time window between the check and the opening of the subdirectory, and an attacker can exploit it by replacing the subdirectory with a symlink, causing the symlink to be followed.

  2. Path re-resolution. The path given to std::fs::remove_dir_all() is extended with subentry paths, and those paths are then used to process subdirectories and delete directory entries. Paths are resolved by the operating system each time they are passed to a system call. If the attacker can replace a descendant directory of the directory passed to remove_dir_all() with a symlink while a subdirectory of it is being processed, that symlink will be followed in subsequent filesystem operations.

The existing defence was the symlink check itself, and it failed because that check was implemented incorrectly. The report notes that the existing mitigation works as intended outside of race conditions.

To unpack the second problem: a system call is a program asking the operating system to do something, such as "open this path" or "delete this path". The operating system looks up the path from scratch every single time, following any signposts it meets along the way. So even if the code checked the top folder once, a deeper folder could be swapped for a signpost later, and the next system call would happily follow it. The kernel is the core of the operating system that actually performs these operations. The right fix is to tell the kernel "do not follow signposts here" as part of the operation itself, so there is no gap to exploit. A mitigation is a change that reduces or removes the danger.

Impact

If the attacker has write access to a directory that is being deleted by a privileged process using remove_dir_all(), they can trick that process into deleting any sensitive files or directory subtrees that the privileged process itself can reach. The report frames the highest risk as programs expected to run in privileged contexts, including system daemons and setuid binaries.

In everyday terms: the attacker cannot open the locked cupboard, but they can persuade the person with the key to empty it for them. The damage is limited to what the powerful program can reach, which is usually far more than the attacker could reach alone.

Fix

Rust 1.58.1 includes mitigations for the vulnerability, with a fixed implementation for all supported platforms except macOS before version 10.10 and REDOX, which remain vulnerable because they lack usable APIs to properly mitigate the attack. Patches to the Rust standard library are also available for custom-built Rust toolchains. Hans Kratz developed the fix for UNIX-like targets and reviewed fixes for other platforms; Chris Denton wrote the Windows fix, Alex Crichton wrote the WASI fix, Florian Weimer reviewed the UNIX-like fix, and Mara Bos reviewed the patches.

A patch is a small change to existing code that repairs a problem. A toolchain is the set of tools that turns source code into a runnable program. WASI is a standard way for programs to run in restricted sandbox environments. The advisory also credits Florian Weimer with reporting the same issue back in 2018, when the severity was not realised.

The advisory also gives guidance that is not a code change:

  1. Update to Rust 1.58.1 or later.
  2. Do not use the vulnerable std::fs::remove_dir_all() in a privileged process or any other security-sensitive context.
  3. Make sure std::fs::remove_dir_all() is only used on directories not accessible to processes from other security contexts.

Adding checks in your own codebase before calling remove_dir_all() does not mitigate the vulnerability, because those checks would be vulnerable to race conditions just like remove_dir_all itself.

That last point is the important lesson for anyone writing code: adding your own guard in front of a broken operation does not help, because your guard has the same gap between checking and acting. The protection has to be part of the operation itself.

Variants to test

  1. Other recursive delete helpers. Look for any library function that promises not to follow symlinks but implements that promise with a stat-style check followed by a separate open or delete. A positive result is a directory entry that can be swapped for a symlink between the two calls and ends up being traversed.
  2. Path-building recursion. Look for recursive deletion that concatenates child names onto the original path and re-resolves the whole path on each system call. A positive result is a descendant directory replaced by a symlink mid-walk whose target is then processed.
  3. Privileged callers. Enumerate daemons and setuid binaries that delete directories in locations writable by less privileged users, such as temporary or cache directories. A positive result is a deletion that reaches outside the writable directory into a path the caller could not otherwise remove.
  4. Platforms without safe primitives. Check targets the advisory lists as still vulnerable even when patched, macOS before 10.10 and REDOX, and any other platform where the library cannot ask the kernel not to follow links.

A variant here means the same kind of mistake appearing somewhere else. "Stat-style check" refers to asking the operating system for information about a file before acting on it, as a separate step. "Primitives" are the basic building blocks an operating system offers; if a safe building block is missing, the library has to fall back on the unsafe pattern.

Hunting notes

This class of bug hides in standard library and utility code that implements a security promise with a check rather than with an atomic primitive. The signal during review is a documented guarantee about symlinks combined with an implementation that stats an entry and then acts on it in a later call, or that rebuilds paths and lets the operating system resolve them again. The report's own framing is the useful test: ask whether the code tells the system not to follow symlinks, or merely asks whether the thing is a symlink before proceeding.

Atomic means "all in one indivisible step, with no gap in the middle". A check followed by an action is two steps and therefore not atomic. The practical review question is simple: does the code give the operating system an instruction, or does it ask a question and then hope nothing changes before it acts on the answer?

On impact, the report makes the case through the privilege boundary rather than through a single victim application: an unprivileged user with write access to a directory deleted by a privileged process can cause deletion of sensitive files and subtrees that the privileged process can reach. The reliability claim matters too: the authors state they could perform the attack reliably within a couple of seconds, which turns a theoretical race into a practical one. The report credits Florian Weimer with reporting the same issue back in 2018, even though the Security Response WG did not realise the severity at the time.

A privilege boundary is the line between what an ordinary user may do and what a more powerful program may do. The whole attack is about getting something on the powerful side of that line to act on something from the ordinary side. A threat model is the description of who might attack a system and what they are able to do; when that description changes, an old report can become newly serious.

Glossary

  • API: the set of operations an operating system or library offers to programs.
  • Atomic: done in one indivisible step, with no gap in the middle.
  • CVE: a public catalogue number for a known security flaw.
  • CWE: a catalogue number for a category of security flaw; CWE-363 is symlink following.
  • Daemon: a background program that runs without a person operating it.
  • Directory: a folder.
  • Kernel: the core of the operating system that performs operations such as opening and deleting files.
  • Mitigation: a change that reduces or removes a danger.
  • Patch: a small change to existing code that repairs a problem.
  • Path: the address of a file or folder, such as temp/foo.
  • Privilege boundary: the line between what an ordinary user may do and what a more powerful program may do.
  • Privileged program: a program that runs with more power than an ordinary user.
  • Proof of concept: a small program written only to show that a flaw is real.
  • Race condition: a bug that depends on timing, where the situation changes between two steps.
  • Recursive: applied to a folder and then to everything inside it, all the way down.
  • REDOX: an operating system written in Rust.
  • Setuid binary: a program that temporarily borrows the permissions of whoever started it.
  • Standard library: the collection of ready-made code that ships with a programming language.
  • Symbolic link (symlink): a small file that acts like a signpost pointing at another file or folder.
  • System call: a program asking the operating system to do something, such as open or delete a path.
  • Threat model: the description of who might attack a system and what they are able to do.
  • Time-of-check to time-of-use (TOCTOU): a race condition where the situation changes between checking it and acting on it.
  • Toolchain: the set of tools that turns source code into a runnable program.
  • Variant: the same kind of mistake appearing somewhere else.
  • WASI: a standard way for programs to run in restricted sandbox environments.

More from Internet Bug Bounty

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Race conditions

The lesson behind this report.

Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.