bytecodealliance / bytecodealliance/cap-std

Use O_NOFOLLOW_ANY on macOS

Open
#179 0 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
821
Forks
57
Avg merge
1h 16m
Merged PRs (30d)
4

Description

According to [this blog post](https://blog.malwarebytes.com/mac/2021/08/macos-11s-hidden-security-improvements/#O_NOFOLLOW_ANY), macos 11 has a new `O_NOFOLLOW_ANY` flag that causes `open` to fail if any path component is a symlink. Assuming symlinks are relatively rare, cap-std could use this as a fast path -- check that the path contains no explicit `..` and then open with `O_NOFOLLOW_ANY`; if that succeeds, then we're done. If either of those fails, open with the slow path.

Contributor guide

Open the contributing guide

Research direction

Start by tracing cap-std's path-opening entry points and the existing fast and slow paths for symlink handling. Check how explicit `..` components are detected and how platform-specific open flags are defined. Done means macOS 11 can use `O_NOFOLLOW_ANY` when safe, while the existing slow path still handles fallback cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, rust
Domain
operating-systems, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.