Skip to content

Fix trailing-slash behavior with O_NOFOLLOW. - #421

Merged
sunfishcode merged 1 commit into
3from
dgohman-fastly/3-patch
Aug 20, 2026
Merged

Fix trailing-slash behavior with O_NOFOLLOW.#421
sunfishcode merged 1 commit into
3from
dgohman-fastly/3-patch

Conversation

@sunfishcode

Copy link
Copy Markdown
Member

When a path has a trailing slash, the path component just before the trailing slash is not considered a final path component for the purposes of the OS O_NOFOLLOW flag. Fix cap-primitives to avoid re-appending a trailing slash when resolving paths with a trailing slash so that it doesn't inadvertently disable O_NOFOLLOW.

This fixes GHSA-hp8f-xmx4-4qrg.

When a path has a trailing slash, the path component just before
the trailing slash is not considered a final path component for the
purposes of the OS `O_NOFOLLOW` flag. Fix cap-primitives to avoid
re-appending a trailing slash when resolving paths with a trailing
slash so that it doesn't inadvertently disable `O_NOFOLLOW`.

This fixes GHSA-hp8f-xmx4-4qrg.
@sunfishcode
sunfishcode merged commit 3979d35 into 3 Aug 20, 2026
4 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant