Skip to content
vetkitChecksChangelogDocumentation

vetkit.c.race.access-then-open

A file is checked with access() and then opened by name; the file can be swapped (e.g. for a symlink) between the check and the use.

Last updated:

Suite: Security

c, cpp

A file is checked with access() and then opened by name; the file can be swapped (e.g. for a symlink) between the check and the use.

Category: SECURITY · Engine rule severity: INFO

How to fix it

Open the file directly (with O_NOFOLLOW where relevant) and inspect the descriptor with fstat; in privileged code drop privileges before opening instead of calling access().

References

Source: packages/engine/rules/sast/c.yml.

Generated from shipped rule definitions at build time. Matching is a review signal, not proof of exploitability. “generic” denotes text matching, not complete language or framework coverage. Runtime configuration and available tools affect whether a rule runs.