{"version":"2.1.277","anchor":"file-reads-hardened-against-symlinktoctou-races-boundread","canonical_anchor":"file-reads-hardened-against-symlinktoctou-races-boundread","heading":"File reads hardened against symlink\/TOCTOU races (boundRead)","tier":"notice","area":"Elsewhere","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.277\/e\/file-reads-hardened-against-symlinktoctou-races-boundread","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.277","markdown":"### File reads hardened against symlink\/TOCTOU races (boundRead)\n\nFile reads are now hardened against symlink-swap race conditions\n\n**What**\n\nA new internal function, `boundRead`, is used for file reads. It resolves a file's real path first, then opens it using flags that refuse to follow symlinks (`O_NOFOLLOW` on Linux, `F_NOFOLLOW_ANY` on macOS), and on Linux also double-checks `\/proc\/self\/fd` to confirm the opened file matches the expected path. If a symlink (a file that points to another location) is found along the way, or the opened file doesn't match what was expected, the read is refused and a warning is shown.\n\n**Why**\n\nThis protects against a class of security bug sometimes called TOCTOU (time-of-check-to-time-of-use), where a file is swapped for a symlink to a different, unintended file between the moment Claude Code checks it and the moment it actually reads it.\n\n- Area: Elsewhere\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 2\/5"}